Massage the data going into download graph #426
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #305
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
will become (spaces indicate null)
Leaving the boundary 0s makes the graph look more continuous.
BEFORE

# AFTER