Spaces:
Running
Running
Update app.py
Browse files
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=
|
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=
|
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=
|
230 |
trend_plot = gr.Plot(
|
231 |
label="Daily Rank Trend",
|
232 |
container=True
|
233 |
)
|
234 |
-
with gr.Column(scale=
|
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)
|