Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,6 @@ st.markdown("""
|
|
| 16 |
<style>
|
| 17 |
/* CSS แก้ปัญหาการสั่นของหน้าจอ */
|
| 18 |
.stApp { transition: none !important; }
|
| 19 |
-
/* กำหนดความสูงตายตัวให้กับ container กราฟ */
|
| 20 |
-
.fixed-height-chart { min-height: 500px; display: flex; align-items: center; justify-content: center; }
|
| 21 |
html, body, [class*="st-"] {
|
| 22 |
font-size: 18px;
|
| 23 |
}
|
|
@@ -110,9 +108,9 @@ def draw_kspace_diagram():
|
|
| 110 |
ax.annotate('', xy=(0.95, 0), xytext=(-0.95, 0), arrowprops=dict(arrowstyle='<|-|>', color='black', lw=2))
|
| 111 |
ax.annotate('', xy=(0, 0.95), xytext=(0, -0.95), arrowprops=dict(arrowstyle='<|-|>', color='black', lw=2))
|
| 112 |
|
| 113 |
-
# ตัวอักษรบอกทิศทาง +kx, -kx, +ky, -ky
|
| 114 |
ax.text(1.1, 0, '+kx', fontsize=20, fontweight='bold', va='center')
|
| 115 |
-
ax.text(-1.
|
| 116 |
ax.text(0, 1.1, '+ky', fontsize=20, fontweight='bold', ha='center')
|
| 117 |
ax.text(0, -1.1, '-ky', fontsize=20, fontweight='bold', ha='center', va='top')
|
| 118 |
|
|
@@ -325,16 +323,14 @@ with col_main:
|
|
| 325 |
|
| 326 |
st.progress((st.session_state.fill_step + 1) / total_anim_steps)
|
| 327 |
|
| 328 |
-
#
|
| 329 |
-
st.
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
st.image(draw_kspace_filling(st.session_state.fill_step, total_anim_steps), use_container_width=True)
|
| 337 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 338 |
|
| 339 |
st.markdown("""
|
| 340 |
---
|
|
|
|
| 16 |
<style>
|
| 17 |
/* CSS แก้ปัญหาการสั่นของหน้าจอ */
|
| 18 |
.stApp { transition: none !important; }
|
|
|
|
|
|
|
| 19 |
html, body, [class*="st-"] {
|
| 20 |
font-size: 18px;
|
| 21 |
}
|
|
|
|
| 108 |
ax.annotate('', xy=(0.95, 0), xytext=(-0.95, 0), arrowprops=dict(arrowstyle='<|-|>', color='black', lw=2))
|
| 109 |
ax.annotate('', xy=(0, 0.95), xytext=(0, -0.95), arrowprops=dict(arrowstyle='<|-|>', color='black', lw=2))
|
| 110 |
|
| 111 |
+
# ตัวอักษรบอกทิศทาง +kx, -kx, +ky, -ky (ปรับระยะ -kx ให้ห่างเส้นมากขึ้น)
|
| 112 |
ax.text(1.1, 0, '+kx', fontsize=20, fontweight='bold', va='center')
|
| 113 |
+
ax.text(-1.2, 0, '-kx', fontsize=20, fontweight='bold', va='center', ha='right')
|
| 114 |
ax.text(0, 1.1, '+ky', fontsize=20, fontweight='bold', ha='center')
|
| 115 |
ax.text(0, -1.1, '-ky', fontsize=20, fontweight='bold', ha='center', va='top')
|
| 116 |
|
|
|
|
| 323 |
|
| 324 |
st.progress((st.session_state.fill_step + 1) / total_anim_steps)
|
| 325 |
|
| 326 |
+
# แก้ปัญหาหน้าจอโหลดกระตุก โดยใช้ st.empty() คุมทีละภาพแทนที่จะคุมทั้ง Container
|
| 327 |
+
col_anim1, col_anim2 = st.columns([1, 1])
|
| 328 |
+
with col_anim1:
|
| 329 |
+
img1_ph = st.empty()
|
| 330 |
+
img1_ph.image(draw_pulse_sequence(st.session_state.fill_step, total_anim_steps), use_container_width=True)
|
| 331 |
+
with col_anim2:
|
| 332 |
+
img2_ph = st.empty()
|
| 333 |
+
img2_ph.image(draw_kspace_filling(st.session_state.fill_step, total_anim_steps), use_container_width=True)
|
|
|
|
|
|
|
| 334 |
|
| 335 |
st.markdown("""
|
| 336 |
---
|