Skip to content

Smarter automatic rounding. #306

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

Merged
merged 1 commit into from
Apr 10, 2021
Merged

Smarter automatic rounding. #306

merged 1 commit into from
Apr 10, 2021

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Apr 8, 2021

Fixes #72 (at least by default). Ordinal scales now only round by default if the unrounded step is greater than five pixels. This heuristic estimates the cardinality of the domain relative to the available range and should prevent bars from disappearing by default. (You can still make the bars disappear by rounding explicitly, which we would need to fix in d3-scale.)

@mbostock mbostock requested a review from Fil April 8, 2021 21:09
@mbostock
Copy link
Member Author

I’m going to land this. Let me know if you have objections.

@mbostock mbostock merged commit 2cff033 into main Apr 10, 2021
@mbostock mbostock deleted the mbostock/autoround branch April 10, 2021 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bars shouldn’t disappear if there are too many of them.
1 participant