Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,9 +94,9 @@ if st.session_state.initialized:
|
|
| 94 |
for condition, count in st.session_state.condition_counts.items():
|
| 95 |
fig = create_gauge(f"Patients with {condition}", count, 200, {'x': [0, 1], 'y': [0, 1]}, 'blue')
|
| 96 |
st.plotly_chart(fig, use_container_width=True)
|
| 97 |
-
time.sleep(
|
| 98 |
placeholder1.empty() # Clear the previous frame
|
| 99 |
-
time.sleep(
|
| 100 |
|
| 101 |
# Animation 2: Treatment Metrics
|
| 102 |
with st.empty() as placeholder2:
|
|
@@ -105,13 +105,13 @@ if st.session_state.initialized:
|
|
| 105 |
fig2 = create_gauge("Successful Treatments", st.session_state.successful_treatments, st.session_state.total_treatments, {'x': [0.5, 1], 'y': [0, 0.5]}, 'orange')
|
| 106 |
fig3 = create_gauge("Unsuccessful Treatments", st.session_state.unsuccessful_treatments, st.session_state.total_treatments, {'x': [0.5, 1], 'y': [0.5, 1]}, 'red')
|
| 107 |
st.plotly_chart(fig1, use_container_width=True)
|
| 108 |
-
time.sleep(
|
| 109 |
placeholder2.empty() # Clear the previous frame
|
| 110 |
st.plotly_chart(fig2, use_container_width=True)
|
| 111 |
-
time.sleep(
|
| 112 |
placeholder2.empty() # Clear the previous frame
|
| 113 |
st.plotly_chart(fig3, use_container_width=True)
|
| 114 |
-
time.sleep(
|
| 115 |
|
| 116 |
# Animation 3: Doctor Actions
|
| 117 |
with st.empty() as placeholder3:
|
|
@@ -119,9 +119,9 @@ if st.session_state.initialized:
|
|
| 119 |
for action, count in st.session_state.doctor_actions.items():
|
| 120 |
fig = create_gauge(f"Doctor Action: {action}", count, st.session_state.total_treatments, {'x': [0, 1], 'y': [0, 1]}, 'purple')
|
| 121 |
st.plotly_chart(fig, use_container_width=True)
|
| 122 |
-
time.sleep(
|
| 123 |
placeholder3.empty() # Clear the previous frame
|
| 124 |
-
time.sleep(
|
| 125 |
|
| 126 |
# Animation 4: Penalties
|
| 127 |
with st.empty() as placeholder4:
|
|
@@ -129,9 +129,9 @@ if st.session_state.initialized:
|
|
| 129 |
for penalty, count in st.session_state.penalties.items():
|
| 130 |
fig = create_gauge(f"Penalty: {penalty}", count, st.session_state.total_treatments // 6, {'x': [0, 1], 'y': [0, 1]}, 'red')
|
| 131 |
st.plotly_chart(fig, use_container_width=True)
|
| 132 |
-
time.sleep(
|
| 133 |
placeholder4.empty() # Clear the previous frame
|
| 134 |
-
time.sleep(
|
| 135 |
|
| 136 |
# Animation 5: Patient Feedback
|
| 137 |
with st.empty() as placeholder5:
|
|
@@ -139,7 +139,7 @@ if st.session_state.initialized:
|
|
| 139 |
for fb, count in st.session_state.feedback.items():
|
| 140 |
fig = create_gauge(f"Feedback: {fb}", count, st.session_state.total_treatments, {'x': [0, 1], 'y': [0, 1]}, 'blue')
|
| 141 |
st.plotly_chart(fig, use_container_width=True)
|
| 142 |
-
time.sleep(
|
| 143 |
placeholder5.empty() # Clear the previous frame
|
| 144 |
st.write("**End of Animations.**")
|
| 145 |
|
|
|
|
| 94 |
for condition, count in st.session_state.condition_counts.items():
|
| 95 |
fig = create_gauge(f"Patients with {condition}", count, 200, {'x': [0, 1], 'y': [0, 1]}, 'blue')
|
| 96 |
st.plotly_chart(fig, use_container_width=True)
|
| 97 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 98 |
placeholder1.empty() # Clear the previous frame
|
| 99 |
+
time.sleep(3) # Additional pause before moving to the next animation
|
| 100 |
|
| 101 |
# Animation 2: Treatment Metrics
|
| 102 |
with st.empty() as placeholder2:
|
|
|
|
| 105 |
fig2 = create_gauge("Successful Treatments", st.session_state.successful_treatments, st.session_state.total_treatments, {'x': [0.5, 1], 'y': [0, 0.5]}, 'orange')
|
| 106 |
fig3 = create_gauge("Unsuccessful Treatments", st.session_state.unsuccessful_treatments, st.session_state.total_treatments, {'x': [0.5, 1], 'y': [0.5, 1]}, 'red')
|
| 107 |
st.plotly_chart(fig1, use_container_width=True)
|
| 108 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 109 |
placeholder2.empty() # Clear the previous frame
|
| 110 |
st.plotly_chart(fig2, use_container_width=True)
|
| 111 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 112 |
placeholder2.empty() # Clear the previous frame
|
| 113 |
st.plotly_chart(fig3, use_container_width=True)
|
| 114 |
+
time.sleep(3) # Additional pause before moving to the next animation
|
| 115 |
|
| 116 |
# Animation 3: Doctor Actions
|
| 117 |
with st.empty() as placeholder3:
|
|
|
|
| 119 |
for action, count in st.session_state.doctor_actions.items():
|
| 120 |
fig = create_gauge(f"Doctor Action: {action}", count, st.session_state.total_treatments, {'x': [0, 1], 'y': [0, 1]}, 'purple')
|
| 121 |
st.plotly_chart(fig, use_container_width=True)
|
| 122 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 123 |
placeholder3.empty() # Clear the previous frame
|
| 124 |
+
time.sleep(3) # Additional pause before moving to the next animation
|
| 125 |
|
| 126 |
# Animation 4: Penalties
|
| 127 |
with st.empty() as placeholder4:
|
|
|
|
| 129 |
for penalty, count in st.session_state.penalties.items():
|
| 130 |
fig = create_gauge(f"Penalty: {penalty}", count, st.session_state.total_treatments // 6, {'x': [0, 1], 'y': [0, 1]}, 'red')
|
| 131 |
st.plotly_chart(fig, use_container_width=True)
|
| 132 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 133 |
placeholder4.empty() # Clear the previous frame
|
| 134 |
+
time.sleep(3) # Additional pause before moving to the next animation
|
| 135 |
|
| 136 |
# Animation 5: Patient Feedback
|
| 137 |
with st.empty() as placeholder5:
|
|
|
|
| 139 |
for fb, count in st.session_state.feedback.items():
|
| 140 |
fig = create_gauge(f"Feedback: {fb}", count, st.session_state.total_treatments, {'x': [0, 1], 'y': [0, 1]}, 'blue')
|
| 141 |
st.plotly_chart(fig, use_container_width=True)
|
| 142 |
+
time.sleep(3) # Wait for 3 seconds before showing the next frame
|
| 143 |
placeholder5.empty() # Clear the previous frame
|
| 144 |
st.write("**End of Animations.**")
|
| 145 |
|