Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,7 +108,6 @@ def save_radar_chart_image(fig):
|
|
| 108 |
img_bytes = pio.to_image(fig, format="png", engine="kaleido")
|
| 109 |
return img_bytes
|
| 110 |
|
| 111 |
-
|
| 112 |
def main():
|
| 113 |
st.title('ๅญธ็ๆ็ธพ้ท้ๅ็ข็ๅจ')
|
| 114 |
|
|
@@ -140,15 +139,15 @@ def main():
|
|
| 140 |
|
| 141 |
st.write("### ้ธๆ่ฆไธ่ผ็ๅ็")
|
| 142 |
|
| 143 |
-
|
| 144 |
if 'selected_images' not in st.session_state:
|
| 145 |
-
|
| 146 |
|
| 147 |
# ๅปบ็ซๅ็ๆ ธๅๆนๅก
|
| 148 |
image_bytes = {}
|
| 149 |
for student in df['ๅงๅ']:
|
| 150 |
if student in comparison_rows:
|
| 151 |
-
|
| 152 |
|
| 153 |
fig = create_radar_chart(df, [student] + comparison_rows, selected_columns)
|
| 154 |
fig = apply_font_to_all_text(fig)
|
|
@@ -158,9 +157,14 @@ def main():
|
|
| 158 |
cols = st.columns(3) # ๆๆไธๅ
|
| 159 |
for i, student in enumerate(image_bytes.keys()):
|
| 160 |
with cols[i%3]:
|
| 161 |
-
st.image(image_bytes[student],
|
| 162 |
-
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
#ๅ
จ้จ้ธๅๅๅ
จ้จไธ้ธ
|
| 166 |
if st.button("ๅ
จ้จ้ธๅ"):
|
|
|
|
| 108 |
img_bytes = pio.to_image(fig, format="png", engine="kaleido")
|
| 109 |
return img_bytes
|
| 110 |
|
|
|
|
| 111 |
def main():
|
| 112 |
st.title('ๅญธ็ๆ็ธพ้ท้ๅ็ข็ๅจ')
|
| 113 |
|
|
|
|
| 139 |
|
| 140 |
st.write("### ้ธๆ่ฆไธ่ผ็ๅ็")
|
| 141 |
|
| 142 |
+
# ๅๅงๅ้ธๅ็ๆ
|
| 143 |
if 'selected_images' not in st.session_state:
|
| 144 |
+
st.session_state.selected_images = {}
|
| 145 |
|
| 146 |
# ๅปบ็ซๅ็ๆ ธๅๆนๅก
|
| 147 |
image_bytes = {}
|
| 148 |
for student in df['ๅงๅ']:
|
| 149 |
if student in comparison_rows:
|
| 150 |
+
continue
|
| 151 |
|
| 152 |
fig = create_radar_chart(df, [student] + comparison_rows, selected_columns)
|
| 153 |
fig = apply_font_to_all_text(fig)
|
|
|
|
| 157 |
cols = st.columns(3) # ๆๆไธๅ
|
| 158 |
for i, student in enumerate(image_bytes.keys()):
|
| 159 |
with cols[i%3]:
|
| 160 |
+
st.image(image_bytes[student],use_container_width=True)
|
| 161 |
+
try:
|
| 162 |
+
st.checkbox(f"ไธ่ผ {student}", key=student, value=st.session_state.selected_images[student])
|
| 163 |
+
st.session_state.selected_images[student] = st.session_state[student] # ๆดๆฐ้ธๅ็ๆ
|
| 164 |
+
except KeyError:
|
| 165 |
+
st.session_state.selected_images[student] = False #ๅฆๆ้ๆฒๆ้ๅๅญธ็ๅ้ ่จญ็บไธ้ธ
|
| 166 |
+
st.checkbox(f"ไธ่ผ {student}", key=student, value=st.session_state.selected_images[student])
|
| 167 |
+
st.session_state.selected_images[student] = st.session_state[student] # ๆดๆฐ้ธๅ็ๆ
|
| 168 |
|
| 169 |
#ๅ
จ้จ้ธๅๅๅ
จ้จไธ้ธ
|
| 170 |
if st.button("ๅ
จ้จ้ธๅ"):
|