plotly / plotly/plotly.js

Plotly.relayout call stops the _fullLayout of the DOM object to track subsequent layout changes triggered by mouse interaction

Open
#6,156 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
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:
9b5587a0-2caa-4334-b17f-2f999ebcc46e

and the related codepen link:
https://codepen.io/disberd/pen/xxpgEVq

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.