You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google graphs does not treat 0-values in a stacked area-graph very well.
The default behavior for something like the crates.io download graph is
to draw many lines right over the top of eachother, meaning that a
recently released version will have its lines drawn over the top of
the the other versions.
This can be fixed by passing google graphs a dataset with nulls instead
of zeros for areas where the line shouldn't be drawn.
This is an implementation of an algorithm that detects sequences of
zeros and removes all the zeroes in the middle of the sequence,
replacing them with null.
For example
[1, 2, 0, 0, 0, 0, 5, 10, 0, 0, 0, 3, 0, 0]
will become (spaces indicate null)
[1, 2, 0, , , 0, 5, 10, 0, , 0, 3, 0, 0]
Leaving the boundary 0s makes the graph look more continuous.
See the PR for before/after photos.
0 commit comments