openfree commited on
Commit
a9b57aa
ยท
verified ยท
1 Parent(s): 6985598

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -655,11 +655,10 @@ 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
- # ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„ ์ƒ์„ฑ (๊ฐ ์ˆœ์œ„์—์„œ 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',
@@ -679,10 +678,10 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
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,
 
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
  fig.add_trace(go.Bar(
660
  x=ids,
661
+ y=ranks,
 
662
  text=[f"Rank: {r}<br>Title: {t}<br>Likes: {l}"
663
  for r, t, l in zip(ranks, titles, likes)],
664
  textposition='auto',
 
678
  yaxis_title='Rank',
679
  yaxis=dict(
680
  autorange='reversed', # Y์ถ•์„ ๋ฐ˜์ „
681
+ tickmode='array',
682
+ ticktext=[str(i) for i in range(1, 401, 20)], # 1๋ถ€ํ„ฐ 400๊นŒ์ง€ 20 ๊ฐ„๊ฒฉ์œผ๋กœ ํ‘œ์‹œ
683
+ tickvals=[i for i in range(1, 401, 20)],
684
+ range=[1, 400] # Y์ถ• ๋ฒ”์œ„๋ฅผ 1๋ถ€ํ„ฐ 400๊นŒ์ง€๋กœ ์„ค์ •
685
  ),
686
  height=800,
687
  showlegend=False,