-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat: sort values in actions by closest to cursor #1023
feat: sort values in actions by closest to cursor #1023
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.
Tested locally and works fine when pushing out events on click/over.
Can you describe what is the current use case for that sorting?
@markov00 for now, the only use case is in |
# [24.6.0](v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([#1019](#1019)) ([45bd0d5](45bd0d5)) ### Features * sort values in actions by closest to cursor ([#1023](#1023)) ([e1da4e5](e1da4e5)) * **axis:** small multiples axis improvements ([#1004](#1004)) ([514466f](514466f)) * **partition:** drilldown ([#995](#995)) ([20bbdae](20bbdae))
🎉 This PR is included in version 24.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [24.6.0](elastic/elastic-charts@v24.5.1...v24.6.0) (2021-02-15) ### Bug Fixes * **legend:** width with scroll bar ([opensearch-project#1019](elastic/elastic-charts#1019)) ([3f9c858](elastic/elastic-charts@3f9c858)) ### Features * sort values in actions by closest to cursor ([opensearch-project#1023](elastic/elastic-charts#1023)) ([4f99c63](elastic/elastic-charts@4f99c63)) * **axis:** small multiples axis improvements ([opensearch-project#1004](elastic/elastic-charts#1004)) ([5896cfa](elastic/elastic-charts@5896cfa)) * **partition:** drilldown ([opensearch-project#995](elastic/elastic-charts#995)) ([de0cba6](elastic/elastic-charts@de0cba6))
Summary
closes #835
Sorts values when finding indexed geometries by closest to cursor
Point
. This is determined by the spatial distance between the index points and the cursor point. Will only compare across different x values in spatially indexed charts (i.e. bubble).Example
Clicking near the yellow arrow will now return the values in the array as
7.0
then6.8
because the cursor is closest to7.0
Clicking near the pink arrow will now return the values in the array as
6.8
then7.0
because the cursor is closest to6.8
This will also be performed on spatial maps with bubble charts and will use the closest distance, including across different x values.
Checklist
src/index.ts
(and stories only import from../src
except for test data & storybook)