My code is currently using “uirevision: ‘true’” to preserve the zoom UI state. However, it is not able to preserve the zoom UI state of the very first click of a data point of a graph (it will result in the graph automatically zooming back to default UI state). After that initial click, I can zoom in and out and click on as many points as I want without it automatically zooming back to default, thus preserving the zoom UI state.
Whenever I click on another option in the option bar like turning on the toggle scroll to zoom function, if I zoom in, the very next click will result in the graph automatically zooming back to default UI state, but afterwards, I can zoom in and out and click on as many points as I want without it zooming back to default. When I toggle the scroll to zoom function to turn it off, the very next click will once again result in the graph automatically zooming back to default UI state, meanwhile, afterwards will work fine.
I thought a change of state in my code might be causing the rerendering but when I use the effect hook with a selected point to skip the step of needing to change state, the initial click of data point still results in automatic zooming back to default UI state.
Does anyone have any idea on what is causing this and how it can be solved? Even if you don’t, please give it your best shot, I am all ears.
Any help is very much appreciated, thank you!