plotly / plotly/react-plotly.js
onUpdate - reset the zoom in Nextjs (React)
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
When use onUpdate the big problem with read any X and Y of selection.
After selection using useState - setTempXandY reset the zoom in, state.
How to solve the the reseting the zoom in, after XXXX seconds?
onUpdate={(EvEnT) => tempUpDaTe(EvEnT)}
const tempUpDaTe= (EvEnT: any) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
setTempXandY(prevState => ({
...prevState,
x: e.layout.xaxis.range[0],
y: e.layout.yaxis.range[0]
}));
}, 5500);
};
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 by reproducing the zoom reset around the onUpdate callback, useState, and setTempXandY flow shown in the issue. Trace how the selection coordinates and zoom range are updated, then verify that updating the selection no longer unexpectedly resets the chart zoom after the timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, react
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100