Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve axis tick increment #5114

Merged
merged 10 commits into from
Sep 2, 2020
Merged

Improve axis tick increment #5114

merged 10 commits into from
Sep 2, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Sep 1, 2020

Fixes #3814 and fixes #5069.
Supersedes #4070.

Demo 1: Before vs After

Demo2: Before vs After

@plotly/plotly_js

@nicolaskruchten
Copy link
Contributor

Nice improvements! This fixes the -0% in most cases? What's up with the 55 in this case?

@archmoj
Copy link
Contributor Author

archmoj commented Sep 1, 2020

Nice improvements!
This fixes the -0% in most cases?

I think so.

What's up with the 55 in this case?

There is a number formatting bug related to d3 v3 where passing 0.55 to %p does not return exact 55%.
d3format55p.

And that one would be fixed if/when we could switch to use latest d3-format.

src/lib/increment.js Outdated Show resolved Hide resolved
@alexcjohnson
Copy link
Collaborator

@archmoj this looks good - just a couple of comments to keep performance high (axes.tickIncrement is called during interactive pan/zoom) and some possibly problematic edge cases.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great now! 💃

@archmoj archmoj merged commit b57760f into master Sep 2, 2020
@archmoj archmoj deleted the improve-axis-tick-increment branch September 2, 2020 21:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

negative sign on zero percent Tickmark precision with percentage formatting
3 participants