react-plotly.js
react-plotly.js copied to clipboard
onUpdate - reset the zoom in Nextjs (React)
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);
};
use Lodash should work
use Lodash should work
This wrapper library (react-plotly.js) is bad by design. For now better solution is just use plotly.js.
Jarrison, please provide a (working) code example.