Update app.py
Browse files
app.py
CHANGED
|
@@ -362,8 +362,15 @@ def update_chart():
|
|
| 362 |
|
| 363 |
chart_placeholder.plotly_chart(st.session_state.fig, use_container_width=True)
|
| 364 |
|
|
|
|
|
|
|
|
|
|
| 365 |
# Main loop
|
| 366 |
while True:
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
|
| 363 |
chart_placeholder.plotly_chart(st.session_state.fig, use_container_width=True)
|
| 364 |
|
| 365 |
+
# Main loop placeholder
|
| 366 |
+
main_placeholder = st.empty()
|
| 367 |
+
|
| 368 |
# Main loop
|
| 369 |
while True:
|
| 370 |
+
with main_placeholder.container():
|
| 371 |
+
run_simulation_step()
|
| 372 |
+
time.sleep(update_interval)
|
| 373 |
+
|
| 374 |
+
# Break the loop if the simulation is stopped
|
| 375 |
+
if not st.session_state.running:
|
| 376 |
+
break
|