Update app.py
Browse files
app.py
CHANGED
@@ -116,6 +116,7 @@ def draw_world(seq, axs, step, cnt_hist, ent_hist, ac_hist):
|
|
116 |
|
117 |
# --- Запуск анимации в Streamlit ---
|
118 |
if st.button("Начать анимацию"):
|
|
|
119 |
for step in range(steps):
|
120 |
seq = bio_mutate(seq)
|
121 |
torsion_profile = np.array([ANGLE_MAP.get(nt, 0.0) for nt in seq])
|
@@ -126,5 +127,6 @@ if st.button("Начать анимацию"):
|
|
126 |
acorr = compute_autocorr(torsion_profile)
|
127 |
stat_autocorr.append(acorr)
|
128 |
draw_world(seq, axs, step, stat_bist_counts, stat_entropy, stat_autocorr)
|
129 |
-
|
130 |
-
|
|
|
|
116 |
|
117 |
# --- Запуск анимации в Streamlit ---
|
118 |
if st.button("Начать анимацию"):
|
119 |
+
chart_placeholder = st.empty() # создаем пустое место для графиков
|
120 |
for step in range(steps):
|
121 |
seq = bio_mutate(seq)
|
122 |
torsion_profile = np.array([ANGLE_MAP.get(nt, 0.0) for nt in seq])
|
|
|
127 |
acorr = compute_autocorr(torsion_profile)
|
128 |
stat_autocorr.append(acorr)
|
129 |
draw_world(seq, axs, step, stat_bist_counts, stat_entropy, stat_autocorr)
|
130 |
+
|
131 |
+
chart_placeholder.pyplot(fig) # обновляем график
|
132 |
+
# После каждого шага Streamlit перерисует график
|