First post ![]()
Hi Streamlit community,
I’m working on an interactive Streamlit dashboard using st.plotly_chart, but I’ve run into an issue with rerun behavior. Whenever a user interacts with a widget or a Plotly element - like trying to censor a datapoint from the graph, the entire app script reruns from top to bottom, causing unnecessary recomputation and lag—especially with multiple charts or heavy data processing.
Is there a way to:
-
Prevent the entire app from rerunning when updating Plotly charts?
-
Achieve partial reruns or selectively update only the affected chart/container?
-
Use session state, containers, or any experimental fragment rerun features for this?
-
Any best practices or code patterns recommended for handling Plotly chart updates efficiently in Streamlit?
I want the app to stay responsive and avoid rerunning unrelated parts of my code. Any advice or examples would be greatly appreciated!
Thanks in advance!
Streamlit version: 1.38.0
Python version: 3.11.3