Skip to content

Double-click to reset uses previous x range, not new one #2957

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
seansfkelley opened this issue Aug 30, 2018 · 4 comments
Closed

Double-click to reset uses previous x range, not new one #2957

seansfkelley opened this issue Aug 30, 2018 · 4 comments

Comments

@seansfkelley
Copy link

When using Plotly.react to update a chart and change the X range, something seems to retain a reference to the old X range, because double-clicking to reset the range respects the old range, not the new.

Repro

https://codepen.io/anon/pen/oPYRav?editors=0010#0

  1. Double click the chart.

Actual

Chart zooms to [ 0, 2 ].

Expected

Chart zooms to [ -1, 3 ].

Other

For some reason, this only happens if data is present in newPlot. If you comment that line out, resetting doesn't work at all (unrelated bug?).

@fourgates
Copy link

i thought that was a "feature" lol. I thought it was nice to revert back to the original range.

@etpinard
Copy link
Contributor

This looks like a duplicate of #2718

@seansfkelley
Copy link
Author

It's certainly at least related, though I'm not clear if it's a duplicate.

In #2718, the repro has different behaviors when you click the "reset axes" button versus double-clicking the X axis versus double-clicking the main plot area. I purposely didn't put any data in my example to keep the repo minimal, but perhaps it would be the same if I did?

That said, I'm using plotly through react-plotly, so I don't have the option to switch from react to newPlot or relayout as appears to be suggested in that ticket.

@etpinard
Copy link
Contributor

etpinard commented Sep 6, 2018

Thanks for the detailed report @seansfkelley

From a plotly.js dev's perspective this ticket and #2718 are two manifestations of the same "less-than-ideal" behavior in plotly.js and bugging behavior in react-plotly.js.

Merging with #2718

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