plotly / plotly/react-plotly.js
Props should not be mutated by Plot component
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
It seems like the Plot component mutates its props (at least layout) instead of cloning the data.
Mutation of props is to me unexpected (and undesired) behavior for a react component.
If for instance the layout is stored in the state of a component and then fed to the Plot component as a prop, like
render() {
<Plot
layout={this.state.layout},
...
/>
we will have a problem, since this.state only should be updated with the react setState() method.
Contributor guide
No contributing guide indexed for this repository
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
The issue names the Plot component and its layout prop; begin by locating the component's layout handling and reproducing the behavior with a state-held layout. Done means the component no longer mutates the supplied layout, verified with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100