Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Plotly.js mutates data passed into Graph component #287

Open
valentijnnieman opened this issue Aug 28, 2018 · 1 comment
Open

Plotly.js mutates data passed into Graph component #287

valentijnnieman opened this issue Aug 28, 2018 · 1 comment

Comments

@valentijnnieman
Copy link
Contributor

We've discovered that plotly.js mutates not just the figure (which caused the Graph resizing bug in Tabs #279) but also the data. Our contract with props in our components is that they are immutable, so that subsequent renders of the components will not cause side-effects. We've solved the issue of the Graph resizing by cloning the figure.layout array. We could do this with data as well, but the data could get very big, and cloning that on every render could get very expensive very quickly. At some point, it would be nice to make sure that data and other props passed to plotly.js are treated as immutable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants