-
Notifications
You must be signed in to change notification settings - Fork 106
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
plotly pan is not working in covidtrends #117
Comments
I am not a frontend developer and can only speculate about the cause of the issue: |
@joachimneumann, thanks for filing this bug. I believe this may be the section causing the bug. If you change line 75 to the version below, you recover panning behavior (but introduce other bugs with zooming in/out).
I'll look into this some more to investigate. Some background: On a recent redesign we switched to using Plotly.react as this allowed us to simplify the codebase. As before, I needed to control the x and y range of the graph so that when you click autoscale after zooming in, we return to the initial x and y range set by the code (and not to an automatic range determined by Plotly). However, I ran into an known issue with Plotly where it mutates the layout object when the user interacts with the graph, leading to unexpected side effects. The workaround I adopted was to pass Plotly a deep copy of the layout object, so that original layout object is not mutated. However, this seems to be causing the issues you point out. |
@all-contributors add @joachimneumann for bug |
I've put up a pull request to add @joachimneumann! 🎉 |
Expected behavior:
After zooming into the plot and pressing on the plotly pan Icon at the top, the mouse cursor should change to the cross-shaped pan cursor image and allow moving the plotted data under the cursor to see the data from other countries with the current zoom level.
This expected behavior can be observed at https://plotly.com/~demos/1698
I have observed this bug on April 18, April 21 and April 22 of 2020 with up-to-date Chrome and Safari on MacOS
Observed behavior in covidtrends:
The cursor does not change and panning is not possible
Remarks:
The text was updated successfully, but these errors were encountered: