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

Allow access data on the plotly_doubleclick event #7303

Open
Lexachoc opened this issue Dec 8, 2024 · 1 comment
Open

Allow access data on the plotly_doubleclick event #7303

Lexachoc opened this issue Dec 8, 2024 · 1 comment
Labels
feature something new P2 considered for next cycle

Comments

@Lexachoc
Copy link
Contributor

Lexachoc commented Dec 8, 2024

The double click event will trigger the single click event as well as reported in #1546. But the issue has been closed.

Here's the example showing the issue:
https://codepen.io/Lexachoc/pen/qEWZJxb

Only the single click event plotly_click can access the data.

There are usecases to access the data points on double click e.g., in plotly/react-plotly.js#257.

It would be nice to allow access the data also on double click. And maybe also to avoid triggering a single-click event. (which will solve the issue report in #1546)

@Lexachoc
Copy link
Contributor Author

Lexachoc commented Dec 8, 2024

I managed to implement this feature.
Image

But since the double-click event is applied to the whole plot(?), the first response is null, which is fine since I can access the data from the second response.
I reused the plotly_click event, and trigger the second plotly_doubleclick manually, that's why only the second response has point data available.

There's still an issue that the double click on points will force the plot to reset zoom. So I have to prevent the zoom reset if there's hover data.

I would like to hear what the Plotly team thinks about whether or not to add support for accessing data by double-clicking on points. (Of course, don't trigger zoom reset.)

Below is a usecase, double click on the points to show popup information of point (I use a toast for example):

Image

@gvwilson gvwilson added feature something new P2 considered for next cycle labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

2 participants