Plotly.relayout call stops the _fullLayout of the DOM object to track subsequent layout changes triggered by mouse interaction
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用链接的 CodePen 重现相机持久化失败:调用 Plotly.Plots.resize 或 Plotly.relayout,随后进行鼠标交互,并使用相同的 uirevision 调用 Plotly.react。跟踪 _fullLayout.scene.camera.eye 的更新方式,并比较有无手动调用时的行为。完成的标准是:调整大小或 relayout 后,后续的 Plotly.react 调用能够保留交互后的相机视图。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100