ginipick commited on
Commit
481f908
ยท
verified ยท
1 Parent(s): 310dcf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -23,7 +23,7 @@ def create_trend_chart(space_id, daily_ranks_df):
23
  title=f'Daily Rank Trend for {space_id}',
24
  labels={'date': 'Date', 'rank': 'Rank'},
25
  markers=True,
26
- height=400
27
  )
28
 
29
  fig.update_layout(
@@ -92,8 +92,8 @@ def create_duplicates_chart(score_sums):
92
  x='id',
93
  y='rank',
94
  title="Top 20 Spaces by Combined Trending Score",
95
- height=400,
96
- text='total_score' # ์Šค์ฝ”์–ด ๊ฐ’์„ ๋ฐ” ์œ„์— ํ‘œ์‹œ
97
  )
98
 
99
  fig.update_layout(
@@ -112,7 +112,7 @@ def create_duplicates_chart(score_sums):
112
 
113
  fig.update_traces(
114
  marker_color='#4CAF50',
115
- texttemplate='%{text:.1f}', # ์Šค์ฝ”์–ด ํฌ๋งท
116
  textposition='outside',
117
  hovertemplate='ID: %{x}<br>Rank: %{y}<br>Total Score: %{text:.1f}<extra></extra>'
118
  )
@@ -226,12 +226,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
226
  with gr.Tabs():
227
  with gr.Tab("Dashboard"):
228
  with gr.Row(variant="panel"):
229
- with gr.Column(scale=7):
230
  trend_plot = gr.Plot(
231
  label="Daily Rank Trend",
232
  container=True
233
  )
234
- with gr.Column(scale=3):
235
  duplicates_plot = gr.Plot(
236
  label="Multiple Entries Analysis",
237
  value=duplicates_chart,
@@ -243,14 +243,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
243
  value="<div style='text-align: center; padding: 20px; color: #666;'>Select a space to view details</div>"
244
  )
245
 
246
- # ๋ผ๋””์˜ค ๋ฒ„ํŠผ์„ ๋จผ์ € ์ •์˜
247
  space_selection = gr.Radio(
248
  choices=[row['id'] for _, row in top_100_spaces.iterrows()],
249
  value=None,
250
  visible=False
251
  )
252
 
253
- # HTML์—์„œ JavaScript ์ด๋ฒคํŠธ๋ฅผ ์ง์ ‘ ์ฒ˜๋ฆฌ
254
  html_content = """
255
  <div style='display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;'>
256
  """ + "".join([
@@ -343,7 +341,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
343
  Experience the pulse of the AI community through our daily updated rankings and discover what's making waves in the world of practical AI applications.
344
  """)
345
 
346
- # ๋ผ๋””์˜ค ๋ฒ„ํŠผ ๋ณ€๊ฒฝ ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
347
  space_selection.change(
348
  fn=update_display,
349
  inputs=[space_selection],
@@ -352,4 +349,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
352
  )
353
 
354
  if __name__ == "__main__":
355
- demo.launch(share=True)
 
23
  title=f'Daily Rank Trend for {space_id}',
24
  labels={'date': 'Date', 'rank': 'Rank'},
25
  markers=True,
26
+ height=500 # ์ˆ˜์ •๋œ ๋ถ€๋ถ„
27
  )
28
 
29
  fig.update_layout(
 
92
  x='id',
93
  y='rank',
94
  title="Top 20 Spaces by Combined Trending Score",
95
+ height=500, # ์ˆ˜์ •๋œ ๋ถ€๋ถ„
96
+ text='total_score'
97
  )
98
 
99
  fig.update_layout(
 
112
 
113
  fig.update_traces(
114
  marker_color='#4CAF50',
115
+ texttemplate='%{text:.1f}',
116
  textposition='outside',
117
  hovertemplate='ID: %{x}<br>Rank: %{y}<br>Total Score: %{text:.1f}<extra></extra>'
118
  )
 
226
  with gr.Tabs():
227
  with gr.Tab("Dashboard"):
228
  with gr.Row(variant="panel"):
229
+ with gr.Column(scale=5): # ์ˆ˜์ •๋œ ๋ถ€๋ถ„
230
  trend_plot = gr.Plot(
231
  label="Daily Rank Trend",
232
  container=True
233
  )
234
+ with gr.Column(scale=5): # ์ˆ˜์ •๋œ ๋ถ€๋ถ„
235
  duplicates_plot = gr.Plot(
236
  label="Multiple Entries Analysis",
237
  value=duplicates_chart,
 
243
  value="<div style='text-align: center; padding: 20px; color: #666;'>Select a space to view details</div>"
244
  )
245
 
 
246
  space_selection = gr.Radio(
247
  choices=[row['id'] for _, row in top_100_spaces.iterrows()],
248
  value=None,
249
  visible=False
250
  )
251
 
 
252
  html_content = """
253
  <div style='display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;'>
254
  """ + "".join([
 
341
  Experience the pulse of the AI community through our daily updated rankings and discover what's making waves in the world of practical AI applications.
342
  """)
343
 
 
344
  space_selection.change(
345
  fn=update_display,
346
  inputs=[space_selection],
 
349
  )
350
 
351
  if __name__ == "__main__":
352
+ demo.launch(share=True)