Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onUpdate - reset the zoom in Nextjs (React) #328

Open
tannath opened this issue Sep 1, 2023 · 2 comments
Open

onUpdate - reset the zoom in Nextjs (React) #328

tannath opened this issue Sep 1, 2023 · 2 comments

Comments

@tannath
Copy link

tannath commented Sep 1, 2023

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);
};
@jarrisondev
Copy link

jarrisondev commented Sep 14, 2023

use Lodash should work

@tannath
Copy link
Author

tannath commented Sep 15, 2023

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.

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

No branches or pull requests

2 participants