Update app.py
Browse files
app.py
CHANGED
@@ -299,7 +299,11 @@ stop_button = st.button("Stop Simulation", on_click=stop_simulation)
|
|
299 |
while True:
|
300 |
try:
|
301 |
fig = q.get(timeout=0.1)
|
302 |
-
|
|
|
|
|
|
|
|
|
303 |
except queue.Empty:
|
304 |
time.sleep(0.1)
|
305 |
continue
|
|
|
299 |
while True:
|
300 |
try:
|
301 |
fig = q.get(timeout=0.1)
|
302 |
+
if fig is not None:
|
303 |
+
chart_placeholder.plotly_chart(fig, use_container_width=True)
|
304 |
+
else:
|
305 |
+
print("Received None figure from queue. Stopping simulation.")
|
306 |
+
break
|
307 |
except queue.Empty:
|
308 |
time.sleep(0.1)
|
309 |
continue
|