Skip to content
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

Hover rules for non-period-positioned bars #5554

Closed
nicolaskruchten opened this issue Mar 16, 2021 · 7 comments
Closed

Hover rules for non-period-positioned bars #5554

nicolaskruchten opened this issue Mar 16, 2021 · 7 comments
Labels
bug something broken

Comments

@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Mar 16, 2021

The new hover invariants in both compare and unified hovermodes for bars that are not period-positioned are:

  • the bar cannot win the hover if the cursor is not within the range of the bar (bar.x +/- width/2)
  • the bar is in the hover set if-and-only-if the point that wins the hover is within the range of the bar (bar.x +/- width/2)

N.B. (bar.x +/- width/2) here includes the gap

@nicolaskruchten
Copy link
Contributor Author

In the case of very-narrow bars, we might need some pixel minimum?

@nicolaskruchten
Copy link
Contributor Author

nicolaskruchten commented Apr 20, 2021

Open questions:

  1. does the code already basically intend to do this?
  2. do we need to find specific cases where these are not met?

@archmoj archmoj added the bug something broken label Apr 29, 2021
@nicolaskruchten
Copy link
Contributor Author

For very-narrow bars, it seems like what's on master already either does this or closely-approximates it: {data: [{ type: "bar", x: [1, 10, 1000], y: [1, 2, 3] }] }

@nicolaskruchten
Copy link
Contributor Author

And if I add a scatter trace, then the scatter rules about the winning point take over, and then the bars get pulled into the hoverset in a compatible way to the invariants above:

{
  data: [
    { type: "bar", x: [1, 10, 1000], y: [1, 2, 3] },
    { type: "scatter", x: [1, 10, 1000], y: [1, 2, 3] }
  ]
}

@nicolaskruchten
Copy link
Contributor Author

@archmoj can you please take a close look at this issue this week and see if you can find any cases where, assuming that #5618 is merged, we are not in compliance with these invariants?

@nicolaskruchten
Copy link
Contributor Author

To recap what we discussed in Slack today... in the pen here https://codepen.io/MojtabaSamimi/pen/QWpKvPO it should not be possible to get just a single scatter point in the hoverset in compare or unified modes.

@nicolaskruchten
Copy link
Contributor Author

Also, please note that the intent of this issue is bar traces only. Let's discuss box traces in another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants