New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add distribution graphs to documentation #1434
base: master
Are you sure you want to change the base?
Add distribution graphs to documentation #1434
Conversation
Need to look into it more, but maybe whatever solution we decide on here could also be used for #278 |
Not an issue: you already feature-gated it.
Good to have in the same repo, but it doesn't need to be in the generated crate package. Could you try investigating why this happens? We already have an explicit
We don't package any of these files except by embedding, so we don't need an Or, simpler: forget Bernoulli (doesn't really need it) and put all the rest under PlotsBernoulliX-axis values should be false, true; not 0, 1. BinomialCan we add a second parameterisation, e.g. n=6, p=0.5? Cauchy👍 (straight copy from WP, I see) |
I think SVG would be a better fit (separate files, not embedded into HTML). You should be able to generate the same plots with Python without issues. |
@newpavlov you missed the discussions in #131 (specifically, how to make this work on docs.rs). SVG appears larger in some cases, smaller in others. It does scale better. |
Ah, I misread the discussion and thought it was about embedding SVG into HTML. I don't think the terrible diff objection is important, plus we probably should use compression either way (i.e. use SVGZ instead of plain SVG). Though there may be some issues with browser support of SVGZ files. In RustCrypto we use links to images which reside in the RustCrypto/media repository, e.g. see docs for the |
I think it may be because the folder was named
Got it. That also removes the need for the added dependency on
I went ahead and added n=10, p=0.6 because I think it looks better next to n=10, p=0.2. If you think having a demonstration of a different
I prefer SVG as well. However, I just did the switch and the diff count exploded to +11,000. Wowza. |
The Python script folder should probably be explicitly excluded from packaged crate (check if it gets included by running It also may be worth to consider the separate repo approach described above. It will be a simpler solution than relying on |
Ah, thanks for the tip! According to this
Certainly. I'm not attached to embedding them if we find a better solution. |
Diffs normally ignore binary files; this is just because SVG is text based? If so, switching to SVGZ may avoid this?
Aha!
The only real issue is versioning. I see usage of commit hashes in the URLs that There is also the minor issue that repo clones don't include all docs, but we already have that with the book. The other issue is that anyone trying to make themselves a copy of the docs for offline usage likely won't have the plots, but that's not critical. Considering these plots aren't directly tied to the Rust code in any way, a separate repo probably is the way to go. |
Yes, SVGZ is better in this regard. However embed-doc-image doesn't support it.
Okay then! Want to create it? |
|
Can you authorize me to push in that repo, or should I make a fork? |
@MichaelOwenDyer you should already have admin privileges on that repo. |
Hm, strange, I am getting a 403 whenever I try to push. Edit: Nevermind, I logged in using a GitHub token and then it worked. |
We can tell Git via attributes to treat the files as binary if necessary. |
CHANGELOG.md
entrySummary
This PR adds some graphs to the documentation of different distributions in
rand_distr
to illustrate their behavior.Motivation
Make the distributions in this crate easier to understand via visual aids.
Details
The diagrams will be hosted in https://github.com/rust-random/charts (see this PR) and links will be inserted into the documentation.
While this PR is still in draft, not all links have been added yet.
Closes #131.
Links Progress:
binomial::Binomial
cauchy::Cauchy
dirichlet::Dirichlet
exponential::Exp
exponential::Exp1
frechet::Frechet
gamma::Gamma
gamma::ChiSquared
gamma::FisherF
gamma::StudentT
gamma::Beta
geometric::Geometric
geometric::StandardGeometric
gumbel::Gumbel
hypergeometric::Hypergeometric
inverse_gaussian::InverseGaussian
normal::Normal
normal::StandardNormal
normal::LogNormal
normal_inverse_gaussian::NormalInverseGaussian
pareto::Pareto
pert::Pert
poisson::Poisson
skew_normal::SkewNormal
triangular::Triangular
unit_ball::UnitBall
unit_circle::UnitCircle
unit_disc::UnitDisc
unit_sphere::UnitSphere
weibull::Weibull
zipf::Zeta
zipf::Zipf