Skip to content

Zoom not working well on Scatter3d plots with FigureWidgets #1086

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
ivirshup opened this issue Aug 1, 2018 · 2 comments
Closed

Zoom not working well on Scatter3d plots with FigureWidgets #1086

ivirshup opened this issue Aug 1, 2018 · 2 comments
Labels
bug something broken
Milestone

Comments

@ivirshup
Copy link
Contributor

ivirshup commented Aug 1, 2018

Trying to zoom using the mouse wheel on a Scatter3d plot shown via FigureWidget makes the plot stutter more than zoom. Here's an example:

weird_figure_widget_zoom

I get this effect while running plotly.py v3.1.0 on both Safari and Chrome.

@jonmmease
Copy link
Contributor

Thanks for the report @ivirshup ,

When I test this the zoom works as it should when zooming by clicking and dragging up and down, but I get the same stutter you're seeing if I use a wheel zoom.

I can also confirm that this isn't a problem if the plot is displayed using iplot.

Technical notes:

Plotly.js emits a relayout event at the end of a drag zoom. This event is sent to the Python side where we update the Python model. Then the event is sent back to the JavaScript side to update all of the views (i.e. when the figure is displayed in multiple output cells). This is how the zoom level of multiple views is synchronized. Right now, we allow the round trip event to update all of the views, even the view that originated the relayout event. This isn't a problem for a single relayout event.

My guess is that during a wheel zoom, the relayout events are emitted by Plotly.js continually. So we end up updating the view of the figure we're performing the drag on, while the drag is still ongoing.

The solution in this case is probably just to not apply the relayout events to the originating view. However, we used to do this but I removed it in bd16d77. Unfortunately I didn't explain the problem that this was causing in the commit message. I think it had to do with the calculation of the unspecified default properties on the JavaScript side and sending them back to the Python side.

Plan: don't apply relayout events to originating view. Carefully test that the axis ranges and autorange properties are properly synced back to the Python model.

@jonmmease
Copy link
Contributor

Hi @ivirshup ,

I just pushed out release candidates for plotly.py 3.1.1 and plotlywidget 0.2.1. Installation instructions for the release candidates are at https://github.com/plotly/plotly.py/blob/bc1d4d188ab999cd9c21e3a7908729f156bc200f/README.md.

If you have a chance to confirm that this issue is resolved in the release candidate that would be awesome!

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