Yuxuan-Zhang-Dexter commited on
Commit
226d8fa
·
1 Parent(s): 4693d14

hide the group bar chart tab

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -289,20 +289,21 @@ def update_leaderboard(mario_overall, mario_details,
289
 
290
  # Always create a new chart for detailed view
291
  chart = create_horizontal_bar_chart(df, leaderboard_state["current_game"])
292
- # For detailed view, we'll use the same chart for all visualizations
293
  radar_chart = chart
294
  group_bar_chart = chart
295
  else:
296
  # For overall view
297
- df, group_bar_chart = get_combined_leaderboard_with_group_bar(rank_data, selected_games)
298
  # Format the DataFrame for display
299
  display_df = prepare_dataframe_for_display(df)
300
  # Use the same selected_games for radar chart
301
  _, radar_chart = get_combined_leaderboard_with_single_radar(rank_data, selected_games)
302
- chart = group_bar_chart
 
303
 
304
  # Return exactly 16 values to match the expected outputs
305
- return (update_df_with_height(display_df), chart, radar_chart, group_bar_chart,
306
  current_overall["Super Mario Bros"], current_details["Super Mario Bros"],
307
  current_overall["Sokoban"], current_details["Sokoban"],
308
  current_overall["2048"], current_details["2048"],
@@ -378,7 +379,7 @@ def clear_filters():
378
  leaderboard_state = get_initial_state()
379
 
380
  # Return exactly 16 values to match the expected outputs
381
- return (update_df_with_height(display_df), group_bar_chart, radar_chart, group_bar_chart,
382
  True, False, # mario
383
  True, False, # sokoban
384
  True, False, # 2048
@@ -791,12 +792,15 @@ def build_app():
791
  label="Comparative Analysis (Radar Chart)",
792
  elem_classes="visualization-container"
793
  )
 
794
  # with gr.Tab("📊 Group Bar Chart"):
795
  # group_bar_visualization = gr.Plot(
796
  # label="Comparative Analysis (Group Bar Chart)",
797
  # elem_classes="visualization-container"
798
  # )
799
 
 
 
800
 
801
  # Game selection section
802
  with gr.Row():
 
289
 
290
  # Always create a new chart for detailed view
291
  chart = create_horizontal_bar_chart(df, leaderboard_state["current_game"])
292
+ # Use the same chart for all visualizations in detailed view
293
  radar_chart = chart
294
  group_bar_chart = chart
295
  else:
296
  # For overall view
297
+ df, _ = get_combined_leaderboard_with_group_bar(rank_data, selected_games)
298
  # Format the DataFrame for display
299
  display_df = prepare_dataframe_for_display(df)
300
  # Use the same selected_games for radar chart
301
  _, radar_chart = get_combined_leaderboard_with_single_radar(rank_data, selected_games)
302
+ chart = radar_chart
303
+ group_bar_chart = radar_chart # Use radar chart instead of bar chart
304
 
305
  # Return exactly 16 values to match the expected outputs
306
+ return (update_df_with_height(display_df), chart, radar_chart, radar_chart,
307
  current_overall["Super Mario Bros"], current_details["Super Mario Bros"],
308
  current_overall["Sokoban"], current_details["Sokoban"],
309
  current_overall["2048"], current_details["2048"],
 
379
  leaderboard_state = get_initial_state()
380
 
381
  # Return exactly 16 values to match the expected outputs
382
+ return (update_df_with_height(display_df), radar_chart, radar_chart, radar_chart,
383
  True, False, # mario
384
  True, False, # sokoban
385
  True, False, # 2048
 
792
  label="Comparative Analysis (Radar Chart)",
793
  elem_classes="visualization-container"
794
  )
795
+ # Comment out the Group Bar Chart tab
796
  # with gr.Tab("📊 Group Bar Chart"):
797
  # group_bar_visualization = gr.Plot(
798
  # label="Comparative Analysis (Group Bar Chart)",
799
  # elem_classes="visualization-container"
800
  # )
801
 
802
+ # Hidden placeholder for group bar visualization (to maintain code references)
803
+ group_bar_visualization = gr.Plot(visible=False)
804
 
805
  # Game selection section
806
  with gr.Row():