Plotly.relayout call stops the _fullLayout of the DOM object to track subsequent layout changes triggered by mouse interaction
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Hi,
I had been doing some tests with layout persistence using uirevision and noticed that a manual call to Plotly.Plots.resize or Plotly.relayout after a plot object has been created stops _fullLayout.scene.camera.eye of the DOM object associated to the plot to track the actual value of scene.camera.eye shown in the Plot.
This causes subsequent calls to Plotly.react with the same uirevision to reset the view. This problem does not exist if no manual relayout is done, but I needed resize (and thus relayout) for my use case to adapt the plot size after creation.
Here is a gif example:

and the related codepen link:
https://codepen.io/disberd/pen/xxpgEVq
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the camera persistence failure with the linked CodePen, using Plotly.Plots.resize or Plotly.relayout followed by mouse interaction and Plotly.react with the same uirevision. Trace how _fullLayout.scene.camera.eye is updated and compare the behavior with and without the manual call. Done means subsequent Plotly.react calls preserve the interacted camera view after resizing or relayout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100