openfree commited on
Commit
bc9f2c1
Β·
verified Β·
1 Parent(s): b9747e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
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=y_values, # λ³€ν™˜λœ 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,