Skip to content

Plotly.react during axis drag #6681

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
mitja-p opened this issue Jul 24, 2023 · 3 comments
Closed

Plotly.react during axis drag #6681

mitja-p opened this issue Jul 24, 2023 · 3 comments

Comments

@mitja-p
Copy link

mitja-p commented Jul 24, 2023

I have a plot with live data and sometimes when dragging the x axis the plotted signal moves, but the axis doesn't move. I found issue #3305 and there the example https://codepen.io/swiperii/pen/wyPEBW?editors=0010 which reproduces my problem totally. Click Add data and then drag the x axis. Wait and you will see that the signal and axis jump back when new data arrives. If you move the signal more the signal moves as before, but the axis stays fixed.

As far as I am concerned during dragging / zooming the layout should stay the same and nothing should jump back to original plot.
Can anyone tell me what is happening here?

@mitja-p
Copy link
Author

mitja-p commented Jul 24, 2023

I was debugging the code and noticed that when it fails the axis object in gd._fulllayout and the axis object in dragbox are not the same. It then fails to update the axis due to:

dragbox.js, ticksAndAnnotations method:
var ax = getFromId(gd, axId);

this gets axis from gd not the axis used and calculated in dragbox and it then draws that axis which was not update instead of the updated one.

@mitja-p
Copy link
Author

mitja-p commented Jul 25, 2023

Workaround is to call gd._fullLayout._redrag() with a timeout of 0 seconds on startrelayouting event. This seems to fix things and from then on it works fine.

@gvwilson
Copy link
Contributor

gvwilson commented Jul 5, 2024

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Alternatively, if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

@gvwilson gvwilson closed this as completed Jul 5, 2024
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

2 participants