-
Notifications
You must be signed in to change notification settings - Fork 120
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
fix: interaction in linear/log x scales #1258
fix: interaction in linear/log x scales #1258
Conversation
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.
Nice! LGTM - tested locally, thanks for the story addition 👍🏻
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.
Nice!! One liner magic! 🎱
## [33.0.2](v33.0.1...v33.0.2) (2021-07-20) ### Bug Fixes * **xy:** interaction in linear/log x scales ([#1258](#1258)) ([db94db2](db94db2))
🎉 This PR is included in version 33.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
The interaction with a log scale across the X axis is now fixed and works correctly. A bug that wrongly computes the inverse value from a projected mouse coordinate is fixed.
Before:
Jul-19-2021.16-42-33.mp4
After:
Jul-19-2021.16-42-50.mp4
Details
The
inverseWithStep
function takes care of inverting a set of screen coordinates to data coordinates.We have two main scales: a continuous and a band/categorical one. There is a third scale type: a continuous scale that is actually formed by consecutive bands (used with time bar charts for example). This third scale type works like a continuous scale but the internal logic make use of bandwidth and minInterval to correctly compute the bar width.
This is true only for bar charts, for line/area charts there is no bandwidth. The code was checking for the wrong parameter, instead of bandwidth it was checking for the minInterval that is always present and > 0.
Issues
Checklist
packages/charts/src/index.ts
(and stories only import from../src
except for test data & storybook)