fix: interaction in linear/log x scales#1258
Merged
markov00 merged 2 commits intoelastic:masterfrom Jul 20, 2021
Merged
Conversation
rshen91
approved these changes
Jul 19, 2021
Contributor
rshen91
left a comment
There was a problem hiding this comment.
Nice! LGTM - tested locally, thanks for the story addition 👍🏻
nickofthyme
approved these changes
Jul 20, 2021
Collaborator
nickofthyme
left a comment
There was a problem hiding this comment.
Nice!! One liner magic! 🎱
markov00
added a commit
to markov00/elastic-charts
that referenced
this pull request
Jul 20, 2021
markov00
added a commit
that referenced
this pull request
Jul 20, 2021
nickofthyme
pushed a commit
that referenced
this pull request
Jul 20, 2021
## [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))
Collaborator
|
🎉 This PR is included in version 33.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
inverseWithStepfunction 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../srcexcept for test data & storybook)