Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -232,17 +232,20 @@ def create_app():
|
|
| 232 |
chart_summary_state = gr.State(value="No chart yet.")
|
| 233 |
|
| 234 |
with gr.Tabs():
|
| 235 |
-
# ── Tab 1: Timeline Chart ──
|
| 236 |
with gr.TabItem("Timeline Chart"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
with gr.Row():
|
| 238 |
start_year = gr.Number(label="Start Year", value=1500, precision=0)
|
| 239 |
end_year = gr.Number(label="End Year", value=2500, precision=0)
|
| 240 |
-
zoom_in
|
| 241 |
-
zoom_out
|
|
|
|
| 242 |
|
| 243 |
-
fig0, summ0 = build_chart(1500, 2500)
|
| 244 |
-
plot = gr.Plot(value=fig0)
|
| 245 |
-
chart_summary_state.value = summ0
|
| 246 |
|
| 247 |
def refresh(s, e):
|
| 248 |
fig, summ = build_chart(int(s), int(e))
|
|
|
|
| 232 |
chart_summary_state = gr.State(value="No chart yet.")
|
| 233 |
|
| 234 |
with gr.Tabs():
|
|
|
|
| 235 |
with gr.TabItem("Timeline Chart"):
|
| 236 |
+
# 1️⃣ 먼저 차트를 만들고 화면에 배치
|
| 237 |
+
fig0, summ0 = build_chart(1500, 2500)
|
| 238 |
+
plot = gr.Plot(value=fig0) # ⬆️ 차트가 맨 위에 위치
|
| 239 |
+
chart_summary_state.value = summ0
|
| 240 |
+
|
| 241 |
+
# 2️⃣ 차트 아래에 컨트롤(연도 입력 + 줌 버튼) 배치
|
| 242 |
with gr.Row():
|
| 243 |
start_year = gr.Number(label="Start Year", value=1500, precision=0)
|
| 244 |
end_year = gr.Number(label="End Year", value=2500, precision=0)
|
| 245 |
+
zoom_in = gr.Button("🔍 Zoom In")
|
| 246 |
+
zoom_out = gr.Button("🔎 Zoom Out")
|
| 247 |
+
|
| 248 |
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
def refresh(s, e):
|
| 251 |
fig, summ = build_chart(int(s), int(e))
|