plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.94k stars 1.86k forks source link

3d camera reset after react #5005

Open nicolaskruchten opened 4 years ago

nicolaskruchten commented 4 years ago

This one has a very specific replication path from this pen: https://codepen.io/nicolaskruchten/pen/NWxoWGR?editors=0010

  1. newPlot@0
  2. react@1 (this is the critical step to get the figure into the broken state)
  3. do turntable interaction via drag
  4. click on "zoom" modebar icon: the turntable interaction is undone!

Alternate path:

  1. newPlot@0
  2. react@1 (this is the critical step to get the figure into the broken state)
  3. click on "zoom" modebar icon and zoom a bit via drag
  4. click on "turntable" modebar icon: the zoom interaction is undone!
nicolaskruchten commented 4 years ago

Related to https://github.com/plotly/plotly.js/issues/5004 ? same pen... with uirevision set.

archmoj commented 4 years ago

This one is a regression since v1.51.0 and the side effect of #4292.

nicolaskruchten commented 4 years ago

Even in 1.50.0 it doesn't behave particularly well... it's easy to get into situations where clicking among the modebar buttons changes the zoom level.

archmoj commented 4 years ago

Even in 1.50.0 it doesn't behave particularly well... it's easy to get into situations where clicking among the modebar buttons changes the zoom level.

@nicolaskruchten thanks for investigating that using v1.50.0. Concerning replicating the original issue, would you please keep the version in the original pen at 1.54.6? Thank you.

nicolaskruchten commented 4 years ago

Sorry, I didn't fork! I've pinned the pen to -latest

nicolaskruchten commented 4 years ago

this seems to be the case even switching from zoom to pan and back

archmoj commented 4 years ago

Seems related to undefined initial camera position.

archmoj commented 4 years ago

This is very strange bug. The fix works in the dashboard but not in a codepen!