Dynamic bar Map, update map instead of re-render

Hello,

I am pretty new to streamlit but really like it so far. However, I ran into a problem when trying to visualize a simulation that simulates a forecast. As the results of the simulation should be visualized after each simulation step, the simulation is run in a loop in streamlit with a sleep. I would like to show the results of each simulation step in a map.
Is there any way to update the map instead of re-drawing/re-rendering it every simulation step? It seems that this functionality is there for Folium (Streamlit Folium Update -- more dynamic maps) but not for pydeck and st.map. I tried using the update function provided by pydeck (Updating Data in a pydeck_chart Object) but this seems not to work. A similar request was made here: pydeck update() Map Animation Β· Issue #1491 Β· streamlit/streamlit Β· GitHub

Please find a rough code scribble below:

st.header('Rough Code Scribble')
initialize_bar_map()
while True:
    results = simulation_step()
    update_map(results)
    sleep(2)

Is there any way how to do that?

I would really appreciate any tips or tricks :slight_smile:

Thanks!

Background Information:

  1. Are you running your app locally or is it deployed? Locally
  2. Share the Streamlit and Python versions. Streamlit 1.29.0, Python 3.10.12