James McCool commited on
Commit
2d5e1b4
·
1 Parent(s): cca826c

Refine game rotation timeline sorting and x-axis configuration

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -690,7 +690,7 @@ with tab5:
690
  working_data = game_rot
691
  display = st.container()
692
  stats_disp = st.container()
693
- check_rotation = team_backlog.sort_values(by='GAME_DATE', ascending=False)
694
  check_rotation['Task'] = check_rotation['Task'] + ' - ' + check_rotation['Start'].astype(str)
695
  st.write(check_rotation)
696
  game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
@@ -699,8 +699,8 @@ with tab5:
699
  fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='delta')
700
  fig.update_yaxes(autorange="reversed")
701
 
702
- # fig.layout.xaxis.type = 'linear'
703
- # fig.data[0].x = check_rotation.delta.tolist()
704
  # Create a color map for each unique player
705
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
706
  color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
 
690
  working_data = game_rot
691
  display = st.container()
692
  stats_disp = st.container()
693
+ check_rotation = team_backlog.sort_values(by=['GAME_DATE', 'Finish'], ascending=False)
694
  check_rotation['Task'] = check_rotation['Task'] + ' - ' + check_rotation['Start'].astype(str)
695
  st.write(check_rotation)
696
  game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
 
699
  fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='delta')
700
  fig.update_yaxes(autorange="reversed")
701
 
702
+ fig.layout.xaxis.type = 'linear'
703
+ fig.data[0].x = check_rotation.delta.tolist()
704
  # Create a color map for each unique player
705
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
706
  color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))