Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -144,18 +144,30 @@ def main():
|
|
| 144 |
st.plotly_chart(fig, use_container_width=True)
|
| 145 |
except Exception as e:
|
| 146 |
st.error(f"็ๆ้ท้ๅๆ็ผ็้ฏ่ชค๏ผ{e}")
|
| 147 |
-
|
| 148 |
st.write("### ๆนๆฌก็นช่ฃฝๅๅฅๅญธ็ๆฏ่ผๅ")
|
| 149 |
|
| 150 |
individual_students = st.multiselect("้ธๆ่ฆๅๅฅๆฏ่ผ็ๅญธ็", df['ๅงๅ'].tolist(), key = "student")
|
| 151 |
comparison_items = st.multiselect("้ธๆ่ฆๆฏ่ผ็้
็ฎ", df['ๅงๅ'].tolist(), key = "item")
|
| 152 |
|
| 153 |
if individual_students and comparison_items:
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
if __name__ == "__main__":
|
| 160 |
import numpy as np
|
| 161 |
main()
|
|
|
|
| 144 |
st.plotly_chart(fig, use_container_width=True)
|
| 145 |
except Exception as e:
|
| 146 |
st.error(f"็ๆ้ท้ๅๆ็ผ็้ฏ่ชค๏ผ{e}")
|
| 147 |
+
|
| 148 |
st.write("### ๆนๆฌก็นช่ฃฝๅๅฅๅญธ็ๆฏ่ผๅ")
|
| 149 |
|
| 150 |
individual_students = st.multiselect("้ธๆ่ฆๅๅฅๆฏ่ผ็ๅญธ็", df['ๅงๅ'].tolist(), key = "student")
|
| 151 |
comparison_items = st.multiselect("้ธๆ่ฆๆฏ่ผ็้
็ฎ", df['ๅงๅ'].tolist(), key = "item")
|
| 152 |
|
| 153 |
if individual_students and comparison_items:
|
| 154 |
+
|
| 155 |
+
image_options = []
|
| 156 |
+
image_bytes = {}
|
| 157 |
+
for student in individual_students:
|
| 158 |
+
fig = create_radar_chart(df, [student] + comparison_items, selected_columns)
|
| 159 |
+
image_bytes[student] = create_composite_image(fig,student)
|
| 160 |
+
image_options.append(f"{student} ่ {', '.join(comparison_items)} ็ๆฏ่ผ")
|
| 161 |
+
|
| 162 |
+
selected_image_options = st.multiselect("้ธๆ่ฆ้กฏ็คบ็ๅ็", options=image_options)
|
| 163 |
+
|
| 164 |
+
cols = st.columns(3) # ๆๆไธๅ
|
| 165 |
+
for i, option in enumerate(selected_image_options):
|
| 166 |
+
student = option.split(" ่ ")[0]
|
| 167 |
+
with cols[i%3]:
|
| 168 |
+
st.image(image_bytes[student], use_container_width=True)
|
| 169 |
+
st.text(option)
|
| 170 |
+
|
| 171 |
if __name__ == "__main__":
|
| 172 |
import numpy as np
|
| 173 |
main()
|