How to keep the view of a plotly plot when changing a parameter

Hi, I have a slider that updates the value of a plotly plot (in this case a 3D cone plot). I would like the plot to remember the previous camera position when the slider is moved, however as the script is run top to bottom, it’s not clear to me how to pass this information “between runs”.


Hi @Oliver_Wang, welcome to the forum !

Client-side state is being tracked there but for now on the Streamlit roadmap it’s planned for somewhere around 2020.

In the meantime you can work with the st.cache gist to preserve info between runs. You can check a working example of this here.