Dmtlant commited on
Commit
61ee2ab
·
verified ·
1 Parent(s): 1b826be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- st.pyplot(fig)
130
- st.experimental_rerun() # Обновление страницы после каждого шага
 
 
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 перерисует график