James McCool commited on
Commit
28ae670
·
1 Parent(s): d36c337

Improved game rotation timeline visualization with enhanced x-axis configuration

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -696,10 +696,8 @@ with tab5:
696
  game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
697
 
698
  fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='minutes')
699
- fig.update_yaxes(autorange="reversed")
700
 
701
- fig.layout.xaxis.type = 'linear'
702
- fig.data[0].x = check_rotation.delta.tolist()
703
  # Create a color map for each unique player
704
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
705
  color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
@@ -711,7 +709,17 @@ with tab5:
711
  fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
712
  fig.add_vline(x=24, line_width=3, line_dash="dash", line_color="green")
713
  fig.add_vline(x=36, line_width=3, line_dash="dash", line_color="green")
714
- # pages = pages.set_index('Player')
 
 
 
 
 
 
 
 
 
 
715
  display.plotly_chart(fig, use_container_width=True)
716
  stats_disp.dataframe(game_rot_stats.style.format(precision=2), hide_index=True, use_container_width = True)
717
 
 
696
  game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
697
 
698
  fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='minutes')
699
+ fig.update_yaxes(autorange="reversed")
700
 
 
 
701
  # Create a color map for each unique player
702
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
703
  color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
 
709
  fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
710
  fig.add_vline(x=24, line_width=3, line_dash="dash", line_color="green")
711
  fig.add_vline(x=36, line_width=3, line_dash="dash", line_color="green")
712
+
713
+ # Configure the layout
714
+ fig.update_layout(
715
+ xaxis=dict(
716
+ title="Game Time (Minutes)",
717
+ range=[0, check_rotation["Finish"].max()],
718
+ tickmode='linear',
719
+ dtick=6
720
+ )
721
+ )
722
+
723
  display.plotly_chart(fig, use_container_width=True)
724
  stats_disp.dataframe(game_rot_stats.style.format(precision=2), hide_index=True, use_container_width = True)
725