Update app.py
Browse files
app.py
CHANGED
@@ -655,13 +655,11 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
|
|
655 |
likes = [space.get('likes', 0) for space in spaces]
|
656 |
titles = [space.get('cardData', {}).get('title') or space.get('title', 'No Title') for space in spaces]
|
657 |
|
658 |
-
# λ§λ
|
659 |
-
y_values = [400 - r + 1 for r in ranks]
|
660 |
-
|
661 |
-
# λ§λ κ·Έλν μμ±
|
662 |
fig.add_trace(go.Bar(
|
663 |
x=ids,
|
664 |
-
y=
|
|
|
665 |
text=[f"Rank: {r}<br>Title: {t}<br>Likes: {l}"
|
666 |
for r, t, l in zip(ranks, titles, likes)],
|
667 |
textposition='auto',
|
@@ -680,12 +678,11 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
|
|
680 |
xaxis_title='Space ID',
|
681 |
yaxis_title='Rank',
|
682 |
yaxis=dict(
|
|
|
683 |
tickmode='linear',
|
684 |
tick0=0,
|
685 |
dtick=20,
|
686 |
-
range=[0, 400],
|
687 |
-
ticktext=[str(400-i) for i in range(0, 401, 20)], # μμ λ μ΄λΈ
|
688 |
-
tickvals=[i for i in range(0, 401, 20)], # λκΈ μμΉ
|
689 |
),
|
690 |
height=800,
|
691 |
showlegend=False,
|
|
|
655 |
likes = [space.get('likes', 0) for space in spaces]
|
656 |
titles = [space.get('cardData', {}).get('title') or space.get('title', 'No Title') for space in spaces]
|
657 |
|
658 |
+
# λ§λ κ·Έλν μμ± (κ° μμμμ 400κΉμ§μ κΈΈμ΄λ‘ λ§λ μμ±)
|
|
|
|
|
|
|
659 |
fig.add_trace(go.Bar(
|
660 |
x=ids,
|
661 |
+
y=ranks, # μ€μ μμ μ¬μ©
|
662 |
+
base=400, # λ§λμ κΈ°μ€μ μ 400μΌλ‘ μ€μ
|
663 |
text=[f"Rank: {r}<br>Title: {t}<br>Likes: {l}"
|
664 |
for r, t, l in zip(ranks, titles, likes)],
|
665 |
textposition='auto',
|
|
|
678 |
xaxis_title='Space ID',
|
679 |
yaxis_title='Rank',
|
680 |
yaxis=dict(
|
681 |
+
autorange='reversed', # YμΆμ λ°μ
|
682 |
tickmode='linear',
|
683 |
tick0=0,
|
684 |
dtick=20,
|
685 |
+
range=[0, 400], # YμΆ λ²μ
|
|
|
|
|
686 |
),
|
687 |
height=800,
|
688 |
showlegend=False,
|