plotly / plotly/react-plotly.js
Custom ModeBar Button click uses old state values
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
modeBarButtonsToAdd: [{ name: 'customDownload', title: 'Download', icon: Plotly.Icons.disk, click: (div) => {console.log(div); console.log(chartState); console.log(chartData); } }
chartState is the Plotly state variable passed to the Plot element (data, layout, frames, config)
chartData is the raw data source that is used to generate the data traces for chartState
chartData gets updated during app cycle which updates chartState
All of the data outputs from click event are logged as point of init which has an empty data array, even the chart div that gets passed from the click function
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
Start with the custom ModeBar button configuration and the React Plot component that receives chartState and chartData. Reproduce the click after chartData updates, then trace what values the callback and chart div expose; done means the callback reports the current state and data rather than the values from initialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100