Spaces:
Runtime error
Runtime error
Claude commited on
feat: 실시간 의견 통계를 토론 보드 아래로 이동
Browse fileshttps://claude.ai/code/session_016DE3uHLsVmA5Uv7gZGGaKT
- components/chat_board.py +21 -21
components/chat_board.py
CHANGED
|
@@ -39,27 +39,6 @@ def _live_chat_board_core(supabase, room_name, user_role, teacher_auth, student_
|
|
| 39 |
)
|
| 40 |
stats_opinion_df = opinion_df
|
| 41 |
|
| 42 |
-
with st.expander("📊 실시간 의견 통계", expanded=False):
|
| 43 |
-
if not stats_opinion_df.empty:
|
| 44 |
-
left_col, right_col = st.columns(2)
|
| 45 |
-
with left_col:
|
| 46 |
-
st.caption("의견 유형 분포 그래프")
|
| 47 |
-
live_pie_fig = px.pie(stats_opinion_df, names="sentiment", hole=0.4, height=320)
|
| 48 |
-
live_pie_fig.update_layout(font={"family": UI_FONT_FAMILY})
|
| 49 |
-
st.plotly_chart(live_pie_fig, use_container_width=True, config={'displayModeBar': False, 'scrollZoom': False})
|
| 50 |
-
with right_col:
|
| 51 |
-
st.caption("누적 토의/토론 워드클라우드")
|
| 52 |
-
wc_html, top_words = _cached_wordcloud(
|
| 53 |
-
tuple(stats_opinion_df["content"].fillna("").tolist())
|
| 54 |
-
)
|
| 55 |
-
if wc_html:
|
| 56 |
-
st.markdown(wc_html, unsafe_allow_html=True)
|
| 57 |
-
st.caption(f"상위 키워드: {top_words}")
|
| 58 |
-
else:
|
| 59 |
-
st.info("워드클라우드를 만들 단어가 아직 부족합니다.")
|
| 60 |
-
else:
|
| 61 |
-
st.write("데이터 수집 중...")
|
| 62 |
-
|
| 63 |
col_board_title, col_board_ref = st.columns([8, 2])
|
| 64 |
with col_board_title:
|
| 65 |
st.subheader(f"💬 실시간 {act_type} 보드")
|
|
@@ -189,6 +168,27 @@ def _live_chat_board_core(supabase, room_name, user_role, teacher_auth, student_
|
|
| 189 |
else:
|
| 190 |
st.info(f"아직 대화가 없습니다. 첫 {act_type} 의견을 남겨주세요!")
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
@st.fragment(run_every=LIVE_REFRESH_INTERVAL)
|
| 194 |
def _live_chat_board_auto(supabase, room_name, user_role, teacher_auth, student_name, current_mode, act_type):
|
|
|
|
| 39 |
)
|
| 40 |
stats_opinion_df = opinion_df
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
col_board_title, col_board_ref = st.columns([8, 2])
|
| 43 |
with col_board_title:
|
| 44 |
st.subheader(f"💬 실시간 {act_type} 보드")
|
|
|
|
| 168 |
else:
|
| 169 |
st.info(f"아직 대화가 없습니다. 첫 {act_type} 의견을 남겨주세요!")
|
| 170 |
|
| 171 |
+
with st.expander("📊 실시간 의견 통계", expanded=False):
|
| 172 |
+
if not stats_opinion_df.empty:
|
| 173 |
+
left_col, right_col = st.columns(2)
|
| 174 |
+
with left_col:
|
| 175 |
+
st.caption("의견 유형 분포 그래프")
|
| 176 |
+
live_pie_fig = px.pie(stats_opinion_df, names="sentiment", hole=0.4, height=320)
|
| 177 |
+
live_pie_fig.update_layout(font={"family": UI_FONT_FAMILY})
|
| 178 |
+
st.plotly_chart(live_pie_fig, use_container_width=True, config={'displayModeBar': False, 'scrollZoom': False})
|
| 179 |
+
with right_col:
|
| 180 |
+
st.caption("누적 토의/토론 워드클라우드")
|
| 181 |
+
wc_html, top_words = _cached_wordcloud(
|
| 182 |
+
tuple(stats_opinion_df["content"].fillna("").tolist())
|
| 183 |
+
)
|
| 184 |
+
if wc_html:
|
| 185 |
+
st.markdown(wc_html, unsafe_allow_html=True)
|
| 186 |
+
st.caption(f"상위 키워드: {top_words}")
|
| 187 |
+
else:
|
| 188 |
+
st.info("워드클라우드를 만들 단어가 아직 부족합니다.")
|
| 189 |
+
else:
|
| 190 |
+
st.write("데이터 수집 중...")
|
| 191 |
+
|
| 192 |
|
| 193 |
@st.fragment(run_every=LIVE_REFRESH_INTERVAL)
|
| 194 |
def _live_chat_board_auto(supabase, room_name, user_role, teacher_auth, student_name, current_mode, act_type):
|