Plotlyview - retain state of view

Hello world,

Does anyone know if there is a way (or workaround) to retain the state of a plotlyview when related data is updated? Now: every time when I change a parameter the view is ofcourse updated, but it would be nice if the state of the view (zoom,rotation etc.) could be retained in some cases.

Regards, Wichard

Hi Wichard,

I am not sure how to do that, but if I would have to guess I think I’d start with trying to implement some zoom slider button in the plotly figure (never done that myself but I know of app where a user can select a plot variant from a dropdown, so it should be possible), and read the results from that slider for setting x- and y-limits of the figure as you are creating it in the controller. Perhaps through storing the “zoom level” in a hiddenfield, though I am not sure that required.

As you can tell, I’ve no clear answer but perhaps this is a direction of thought that can lead you somewhere relevant.

Also: I found this link in plotly’s docs that could be relevant