-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixup hover filters #5668
Fixup hover filters #5668
Conversation
https://observablehq.com/@nicolaskruchten/plotly-js-branch-tip-chooser on this current branch. Start with your mouse on the far right and very slowly scan it towards the left. There is a very narrow zone between the two right-most markers where this happens. |
Thanks. Fixed by 3b85534. |
@nicolaskruchten @alexcjohnson I fixed the issues we noticed today and updated the codepens. |
Wow, this looks pretty great, behaviour-wise, thanks! Nice bug-fixing too 👍 |
The situation I'm describing in the above two comments violates the second rule in #5554:
Note that that rule references "the point that wins the hover" and says nothing about where the cursor is. |
After trying out a number of potential fixes towards enforcing that rule, and after looking at |
@archmoj please expand on why you think this needs relaxing? |
The point at 1.49 wins by hovering at 1.75. There is no harm to display bar at position 2 which is the closest bar. If we instead pick bar at position 1, it would be misleading. Please note that the unified hover is attached to cursor as well. |
Thanks for the explanation. I still think the invariant as described is the right one but I'll think about it a bit more over the weekend. It's too hard to reason about things if the hover set depends on the cursor position and the winning point IMO. My next question is how comes a scatter point at 1.49 wins with the cursor at 1.75 if there is a bar at 2? My instinct is to stick with the invariant as described and dig into the winning point logic after 2.0. |
Yeah. Let's think about it during weekend. |
OK. I made the adjustment to respect the rule. It doesn't look bad :) |
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.
Looks perfect now! 💃
Fixes bug mentioned in #5554 (comment),
also simplifies
period
andnon-period
hovers in respect to #5553 and #5554.Also closes #5572 : Demo Before vs After.
And closes #4787 : Demo Before vs After
@plotly/plotly_js