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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -224,14 +224,20 @@ if st.session_state['chat_logs']:
224
  )
225
 
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()
 
224
  )
225
 
226
  # κ·Έλž˜ν”„ 좜λ ₯
227
+ st.plotly_chart(fig, use_container_width=True)
228
+
229
+ # μ„ νƒν•œ μ‹œκ°„λŒ€λ₯Ό 좜λ ₯ν•  곡간
230
+ if 'selected_time' not in st.session_state:
231
+ st.session_state['selected_time'] = None
232
+
233
+ # 클릭 이벀트 처리
234
+ clicked_time = st.button("μ„ νƒλœ μ‹œκ°„λŒ€ 좜λ ₯")
235
+ if clicked_time:
236
+ st.session_state['selected_time'] = clicked_time # 클릭된 μ‹œκ°„μœΌλ‘œ μ—…λ°μ΄νŠΈ
237
+
238
+ # μ„ νƒλœ μ‹œκ°„λŒ€ ν‘œμ‹œ
239
+ if st.session_state['selected_time']:
240
+ st.write(f"μ„ νƒλœ μ‹œκ°„λŒ€: {st.session_state['selected_time']}")
241
 
242
  # μ„ νƒλœ μ‹œκ°„λŒ€ ν‘œμ‹œ
243
  display_selected_times()