Skip to content

No click events in geo plots with dragmode=select #2542

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
darabos opened this issue Apr 11, 2018 · 2 comments
Closed

No click events in geo plots with dragmode=select #2542

darabos opened this issue Apr 11, 2018 · 2 comments
Labels
bug something broken

Comments

@darabos
Copy link
Contributor

darabos commented Apr 11, 2018

If I add dragmode: 'select' to the basic choropleth example, plotly_click events are no longer emitted. plotly_selected events are emitted for clicks, but with an undefined data. So I cannot handle clicks in this mode.

Example: https://codepen.io/anon/pen/QmoxOP

The same events work for cartesian plots. I think this is because dragElement there is initialized with a clickFn that forwards simple clicks. I thought I'd add Fx.click() to geo.js's clickFn too. But I cannot create a repro in Jasmine.

I tried making a copy of the choropleth click events test and adding Plotly.relayout(gd, { dragmode: 'select' }, [0]).then(...). But it still passes. I cannot figure out why.

Thanks for any advice!

@etpinard
Copy link
Contributor

Thanks for the very clear report!

Any inconsistencies across subplot types should be addressed, but come to think of it, I'm not sure the cartesian behavior is correct. More clearly, should plotly_click be emitted under dragmode: 'select' || 'pan'?

Cleaning this up will be especially important when implementing selection by click (in #1848 (comment)).

@etpinard etpinard added the bug something broken label Apr 11, 2018
@etpinard
Copy link
Contributor

This appears fixed in v1.41.0.

#2944 standardized the behavior across all subplots that support selections.

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