Update app.py
Browse files
app.py
CHANGED
|
@@ -17,11 +17,6 @@ st.markdown("""
|
|
| 17 |
html, body, .stApp {
|
| 18 |
overflow-x: hidden !important;
|
| 19 |
}
|
| 20 |
-
/* Force scrollbar always visible on Streamlit's real scroll container */
|
| 21 |
-
.main {
|
| 22 |
-
overflow-y: scroll !important;
|
| 23 |
-
scrollbar-gutter: stable;
|
| 24 |
-
}
|
| 25 |
.stApp {
|
| 26 |
overflow-y: scroll !important;
|
| 27 |
transition: none !important;
|
|
@@ -121,11 +116,9 @@ kspace_bg_image = format_kspace_display(kspace_raw)
|
|
| 121 |
|
| 122 |
def get_image_from_plot(fig):
|
| 123 |
buf = io.BytesIO()
|
| 124 |
-
# เซฟภาพด้วยขนาดพิกเซลตายตัว ห้ามใช้ bbox_inches='tight' เด็ดขาดเพื่อป้องกันเว็บสั่น
|
| 125 |
plt.savefig(buf, format='png', dpi=100)
|
| 126 |
plt.close(fig)
|
| 127 |
-
buf.
|
| 128 |
-
return Image.open(buf)
|
| 129 |
|
| 130 |
@st.cache_data
|
| 131 |
def draw_kspace_diagram():
|
|
|
|
| 17 |
html, body, .stApp {
|
| 18 |
overflow-x: hidden !important;
|
| 19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
.stApp {
|
| 21 |
overflow-y: scroll !important;
|
| 22 |
transition: none !important;
|
|
|
|
| 116 |
|
| 117 |
def get_image_from_plot(fig):
|
| 118 |
buf = io.BytesIO()
|
|
|
|
| 119 |
plt.savefig(buf, format='png', dpi=100)
|
| 120 |
plt.close(fig)
|
| 121 |
+
return buf.getvalue() # Return bytes — reliably cacheable by st.cache_data
|
|
|
|
| 122 |
|
| 123 |
@st.cache_data
|
| 124 |
def draw_kspace_diagram():
|