-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Change ticks.mode
to scale.distribution
#4582
Conversation
src/scales/scale.time.js
Outdated
return [ | ||
{time: min, pos: 0}, | ||
{time: max, pos: 1} | ||
]; | ||
} | ||
|
||
var table = []; | ||
var items = timestamps.slice(0); | ||
var items = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should you just make this var items = [min];
and avoid the need for items.push(min)
below?
src/scales/scale.time.js
Outdated
me._horizontal = me.isHorizontal(); | ||
me._labels = labels.sort(sorter); // Sort labels **after** data have been converted | ||
me._timestamps = timestamps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might call this _dataTimestamps
to distinguish from ticks and labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_data
then to be consistent with _labels
and _datasets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not all the data though (just the timestamps), so I think that might make it harder to read. Maybe _dataMillis
, _labelMillis
, and _datasetMillis
?
lgtm |
thank you for this!! |
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
d86cc9c
to
85c59c5
Compare
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
Fix
ticks.mode
behavior whenticks.source
isauto
: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option todistribution
(more explicit thanmode
) and since this option applies from now on the data, it seems better to have it underscale
insteadscale.ticks
.Related to #4507
@benmccann