Skip to content

Should traces with hovermode: 'none' impact hover radius for other traces? #678

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

Closed
john-soklaski opened this issue Jun 22, 2016 · 7 comments
Labels
community community contribution feature something new

Comments

@john-soklaski
Copy link
Contributor

I am using a trace as an error interval around a main trace. I don't want the user to be able to hover over the error interval, so I've marked it as hovermode: 'none'. However, this makes it very difficult to hover over the trace which it surrounds.

In the example, the dark green trace labeled "Fair" is difficult to hover over due to its interval. The blue trace labeled "Premium" is easy to hover over.

http://codepen.io/john-soklaski/pen/vKyxNQ

This seems like it is a bug, or is there a better way to accomplish this?
Thanks!

@etpinard
Copy link
Contributor

I wouldn't call this bug because we -- on purpose -- consider hoverinfo: 'none' traces in the hover picking routine in order to fire plotly_hover events from them. See PR #385 for more info.

But, this is a limitation of our API. I think we should add a hoverinfo flag (something like 'hide') to handle the case where a user wants to hide the hover labels but still be able to grab event data from them. Correspondingly, hoverinfo: 'none' would effectively remove the trace from the hover picking routine all together and thus remove its impact on the hover radius, like you desire here.

@etpinard
Copy link
Contributor

[...], or is there a better way to accomplish this?

I can't think of an easy way to accomplish this unfortunately.

@etpinard etpinard changed the title Trace with hovermode: 'none' impacts hover radius for other traces Should traces with hovermode: 'none' impact hover radius for other traces? Jun 22, 2016
@john-soklaski
Copy link
Contributor Author

@etpinard Is this along the lines you were thinking? master...john-soklaski:hoverinfo_hide

@etpinard
Copy link
Contributor

@john-soklaski looks like you're on the right track.

In its current form, we can't merge your patch in the v1.x branch, because we're effectively changing the hoverinfo: 'none' behaviour. In other words, what 'none' currently does is transferred to hoverinfo: 'hide'.

Instead, maybe we should keep hoverinfo: 'none' the way it is and add e.g. hoverinfo: 'skip' - which would make the picking routine completely skip over the trace in general.

Thoughts?

@john-soklaski
Copy link
Contributor Author

john-soklaski commented Aug 12, 2016

@etpinard I think that is a good solution, I'll update my branch and send a PR.

@etpinard
Copy link
Contributor

@john-soklaski Great.

Make sure to test out the behaviour in gl3d traces (which I think don't have hoverinfo: 'none' hover test at the moment).

@etpinard etpinard added feature something new community community contribution and removed status: discussion needed labels Aug 17, 2016
@etpinard
Copy link
Contributor

closed via #851

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

No branches or pull requests

2 participants