lcjln commited on
Commit
12624e0
Β·
verified Β·
1 Parent(s): 2f5189b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -115,11 +115,6 @@ def crawl_chats(vod_url):
115
 
116
  return "\n".join(chat_logs), chat_counts, laugh_counts
117
 
118
- # ν΄λ¦­ν•œ μ‹œκ°„λŒ€λ₯Ό 선택 및 좜λ ₯
119
- def add_selected_time(time):
120
- if time not in st.session_state['selected_times']:
121
- st.session_state['selected_times'].append(time)
122
-
123
  # μ„ νƒλœ μ‹œκ°„λŒ€λ₯Ό ν‘œμ‹œ 및 μ‚­μ œ κΈ°λŠ₯
124
  def display_selected_times():
125
  if st.session_state['selected_times']:
@@ -231,10 +226,12 @@ if st.session_state['chat_logs']:
231
  # κ·Έλž˜ν”„ 좜λ ₯
232
  clicked_time = st.plotly_chart(fig, use_container_width=True)
233
 
234
- # ν΄λ¦­ν•œ μ‹œκ°„λŒ€ μ €μž₯
 
235
  if clicked_time and 'points' in clicked_time:
236
  selected_time = clicked_time['points'][0]['x']
237
- add_selected_time(selected_time)
 
238
 
239
  # μ„ νƒλœ μ‹œκ°„λŒ€ ν‘œμ‹œ
240
  display_selected_times()
 
115
 
116
  return "\n".join(chat_logs), chat_counts, laugh_counts
117
 
 
 
 
 
 
118
  # μ„ νƒλœ μ‹œκ°„λŒ€λ₯Ό ν‘œμ‹œ 및 μ‚­μ œ κΈ°λŠ₯
119
  def display_selected_times():
120
  if st.session_state['selected_times']:
 
226
  # κ·Έλž˜ν”„ 좜λ ₯
227
  clicked_time = st.plotly_chart(fig, use_container_width=True)
228
 
229
+ # μ„ νƒν•œ μ‹œκ°„λŒ€λ₯Ό ν΄λ¦­ν–ˆμ„ λ•Œ ν•΄λ‹Ή μ‹œκ°„λŒ€ 좜λ ₯
230
+ selected_time = st.session_state.get('selected_time', None)
231
  if clicked_time and 'points' in clicked_time:
232
  selected_time = clicked_time['points'][0]['x']
233
+ if selected_time not in st.session_state['selected_times']:
234
+ st.session_state['selected_times'].append(selected_time)
235
 
236
  # μ„ νƒλœ μ‹œκ°„λŒ€ ν‘œμ‹œ
237
  display_selected_times()