Plotly.js: 3d camera and uirevision

Created on 5 Aug 2020  路  2Comments  路  Source: plotly/plotly.js

In this pen https://codepen.io/nicolaskruchten/pen/BajgePw?editors=0010

case 1: good

  1. newPlot 0
  2. react 1 (this just changes the uirevision and camera angle, so far so good)
  3. react 2 (this just changes the data, good)

case 2: good

  1. newPlot 1
  2. rotate the camera a bit
  3. react 2 (just changes the data and leaves the camera angle alone, good)

case 3: bad (both together)

  1. newPlot 0
  2. react 1
  3. rotate the scene a bit
  4. react 2 (the camera angle is wrong now!)
bug

All 2 comments

That鈥檚 a weird one indeed! The key question, I would say, is how can the state possibly be different immediately prior to the rotation in case 2 vs case 3? Ideally, (newPlot 1) and (newPlot 0 -> react 1) should be identical in both visible and internal state.

One observation - that doesn't directly get at this "key question" but could be important in finding a solution, and in fact may represent another bug: camera.eye has some pieces the same and some different between states 0 and 1. But we should treat any change to any component of camera.eye as invalidating user edits to all of camera.eye. See https://codepen.io/alexcjohnson/pen/wvGvREO?editors=0010 where I've set uirevision to a constant for all three figures, and do:

  1. newPlot 0
  2. rotate the scene
  3. react 1

Ideally (based on my argument above), this would be the same as just newPlot 1, but you can see that it's different if you then click newPlot 1.

We may need to look into how attributes are recorded in _preGUI, and have this and possibly other attributes recorded together rather than separately.

The fact that to trigger the bug we need to newPlot-0/react-1 makes it smell like #5005 which needs the same "setup" step.

Was this page helpful?
0 / 5 - 0 ratings