-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
✨ use 'nice' axis ticks for linear scales / TAS-795 #4404
Conversation
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 770 (d81997) ❌ Edited: 2025-01-22 16:05:19 UTC |
5dc4d1c
to
0a553e6
Compare
3d2b603
to
d6d2059
Compare
95887fb
to
1b2911e
Compare
05bf774
to
7531258
Compare
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.
Awesome!
Should we enable this for even more chart types? Slope charts come to mind.
🚧 remember nice ticks fine-tune
ah yes, I forgot about slopes! |
7531258
to
1fa3c16
Compare
Resolves #3978
See 3790bad 😅
Relying on d3's nice implementation sometimes leads to suboptimal results because d3 adds grid lines too eagerly (some examples below). That's why I ended up writing a custom 'nice' function for Grapher. It only adds an additional grid line if any data value exceeds the highest grid line by more than 25%.
Examples of d3.nice where grid lines are placed to eagerly
If any data value is just above a grid line, then showing an additional grid line 'squishes' the rest of the chart.