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.
fixes https://github.com/plotly/streambed/issues/8512 - date histograms with small bins failed. Turns out it was any uniform date bins, ie intervals smaller than 1 month, that were broken.
Note that there are still some issues including and relating to #1151 uncovered in the course of this fix, some TODOs added describing these.
At its root, the issue is that
Lib.findBin
doesn't know anything about the axis it's binning onto, so needs bins specified entirely by numbers, either{start, end, size}
or[edge0, edge1, edge2, ... edgeN]
, but in the new date system,start
andend
are date strings. For performance it's important that these be turned into numbers only once, so rather than hack date conversion intofindBin
we convert the bins object everywhere it gets called.In addition to histograms, this routine gets called in:
traces/box/calc.js
traces/heatmap/convert_column_xyz.js
traces/heatmap/hover.js
traces/heatmap/plot.js
But as far as I can tell these callers can only provide numeric data for the bins so they should be safe.