openfree commited on
Commit
56a590f
ยท
verified ยท
1 Parent(s): f40cbb9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -653,13 +653,10 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
653
  likes = [space.get('likes', 0) for space in spaces]
654
  titles = [space.get('cardData', {}).get('title') or space.get('title', 'No Title') for space in spaces]
655
 
656
- # Y์ถ• ๊ฐ’์„ ๋ฐ˜์ „
657
- y_values = [301 - r for r in ranks]
658
-
659
- # ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„ ์ƒ์„ฑ
660
  fig.add_trace(go.Bar(
661
  x=ids,
662
- y=y_values,
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,8 +675,10 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
678
  xaxis_title='Space ID',
679
  yaxis_title='Rank',
680
  yaxis=dict(
681
- ticktext=[str(i) for i in range(1, 401, 20)],
682
- tickvals=[401 - i for i in range(1, 401, 20)],
 
 
683
  range=[0, 400]
684
  ),
685
  height=800,
@@ -703,7 +702,6 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
703
  title = space.get('cardData', {}).get('title') or space.get('title', 'No Title')
704
  likes = space.get('likes', 0)
705
 
706
- # ์ŠคํŽ˜์ด์Šค ํ•จ์ˆ˜์˜ HTML ์นด๋“œ ์ƒ์„ฑ ๋ถ€๋ถ„ ์ˆ˜์ •
707
  html_content += f"""
708
  <div style='
709
  background: white;
@@ -740,8 +738,6 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
740
  </a>
741
  </div>
742
  """
743
-
744
-
745
 
746
  html_content += "</div></div>"
747
 
 
653
  likes = [space.get('likes', 0) for space in spaces]
654
  titles = [space.get('cardData', {}).get('title') or space.get('title', 'No Title') for space in spaces]
655
 
656
+ # ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„ ์ƒ์„ฑ (Y์ถ• ๊ฐ’ ๊ณ„์‚ฐ ์ˆ˜์ •)
 
 
 
657
  fig.add_trace(go.Bar(
658
  x=ids,
659
+ y=ranks, # ์ง์ ‘ rank ๊ฐ’ ์‚ฌ์šฉ
660
  text=[f"Rank: {r}<br>Title: {t}<br>Likes: {l}"
661
  for r, t, l in zip(ranks, titles, likes)],
662
  textposition='auto',
 
675
  xaxis_title='Space ID',
676
  yaxis_title='Rank',
677
  yaxis=dict(
678
+ autorange='reversed', # Y์ถ• ๋ฐ˜์ „
679
+ tickmode='linear',
680
+ tick0=0,
681
+ dtick=20,
682
  range=[0, 400]
683
  ),
684
  height=800,
 
702
  title = space.get('cardData', {}).get('title') or space.get('title', 'No Title')
703
  likes = space.get('likes', 0)
704
 
 
705
  html_content += f"""
706
  <div style='
707
  background: white;
 
738
  </a>
739
  </div>
740
  """
 
 
741
 
742
  html_content += "</div></div>"
743