Skip to content

Click-drag zooming does not trigger a plotly_relayout event for 'scattergl' #134

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
halfs13 opened this issue Dec 18, 2015 · 4 comments
Closed
Milestone

Comments

@halfs13
Copy link

halfs13 commented Dec 18, 2015

As shown in this JSfiddle, for type: 'scatter' using the click-drag zoom triggers the event; for type: 'scattergl' doing the same does not trigger the event.

@etpinard
Copy link
Contributor

You're correct. Zooming in on a scattergl graph does not emit plotly_relayout.

@halfs13 Zooming in on gl and svg graphs work differently at the moment.

In svg, zooming modifies the xaxis and yaxis ranges to selection box and redraw the graph with the help of Plotly.relayout.

In gl, that operation would take much longer to perform; we try to shortcut most of the drawing logic. In other words, zooming does not call Plotly.relayout.

We could still emit a plotly_relayout event when zooming on a gl graph so that users could use hook in custom functionality, but wouldn't that be an abuse of language?

We could solve the problem by adding a plotly_zoom event to be emitted on both svg and gl zooms.

@etpinard etpinard added this to the On-par gl2d milestone Dec 18, 2015
@halfs13
Copy link
Author

halfs13 commented Dec 19, 2015

plotly_zoom would be very helpful. And either the same event or something similar to trigger when panning using the pan tool.

@kevintc
Copy link

kevintc commented Apr 18, 2016

+1, I just stumbled on this issue, I'm trying to implement a callback when the user zooms on a scattergl graph and couldn't make it work. I understand why now :)

Is there any news regarding this implementation ? (either plotly_relayout or plotly_zoom would be nice). Is there any callback available when using scattergl ?

@etpinard
Copy link
Contributor

done in #466

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