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

[Feature Request] Disable click/hover events per line/data #3959

Closed
dummdidumm opened this issue Jun 13, 2019 · 6 comments
Closed

[Feature Request] Disable click/hover events per line/data #3959

dummdidumm opened this issue Jun 13, 2019 · 6 comments

Comments

@dummdidumm
Copy link

dummdidumm commented Jun 13, 2019

Feature Request

It would be great if there was a functionality to disable hover and/or click events per line/data. Something like this:

Plotly.newPlot(
  "myDiv",
  [{
     x: [1, 2, 3, 4],
     y: [16, 15, 11, 9],
     type: "scatter",
     // If I hover over a data point, there will be no plolty_hover/unhover event for this line.
     // There will be no hoverlabel, too.
     // Default is true
     hoverevents: false,
     // If I click on a data point, there will be no plolty_click event for this line.
     // Default is true
     clickevents: false
  }]
);
@etpinard
Copy link
Contributor

hoverinfo: 'none' or hoverinfo: 'skip' should do the trick.

@dummdidumm
Copy link
Author

Thanks for the info on hoverinfo: 'skip', I did not know about that. hoverinfo: 'none' is not enough because when I hover a datapoint from a line with hoverinfo: 'none' which superimposes a datapoint from another line, the hoverinfo: 'none'-line will still get priority when hovermode: 'closest' is active.

But there still is no way to distinguish between hover and click events, so you cannot deactivate one thing when you don't want to deactivate the other.

Maybe there could be a new field clickinfo which has the same options as hoverinfo. When clickinfo is not set, it will use the options of hoverinfo, but you can override them to have specific behavior for click events.

@etpinard
Copy link
Contributor

Fair point. I'm curious though @dummdidumm how are you handling your click events? There should be a way to tell which points to "skip" in the handler.

@dummdidumm
Copy link
Author

dummdidumm commented Jun 14, 2019

The same things that I wrote above about the hover-event are also true for the click event. So if I hover over/click on a datapoint which is exactly on top of another datapoint, inside points of the event handler I only get the datapoint which is on top.

So if I would like click events to happen on the datapoint but not hover events, I cannot achieve this currently.

The "only the top-most point is passed to points, I want all points in that area" is a topic/feature request on its own I think.

@etpinard
Copy link
Contributor

etpinard commented Jul 2, 2019

The "only the top-most point is passed to points, I want all points in that area" is a topic/feature request on its own I think.

That's tracked in: #720

@gvwilson
Copy link
Contributor

Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson

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

No branches or pull requests

3 participants