James McCool commited on
Commit
da67115
·
1 Parent(s): b821708

Simplify game rotation timeline plot and update data rendering

Browse files
Files changed (1) hide show
  1. app.py +5 -22
app.py CHANGED
@@ -700,30 +700,13 @@ with tab5:
700
  game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
701
  game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
702
 
703
- # Create proper time segments
704
- check_rotation['TimeSegment'] = check_rotation.apply(
705
- lambda row: {
706
- 'Start': row['Start'],
707
- 'Total': row['Finish'] - row['Start']
708
- }, axis=1
709
- )
710
-
711
- fig = px.timeline(data_frame=check_rotation,
712
- x_start='Start',
713
- x_end='Finish',
714
- y='Resource',
715
- range_x=[0, 48], # Full game length
716
- text='Task')
717
 
718
  fig.layout.xaxis.type = 'linear'
719
- fig.update_yaxes(categoryorder='category ascending')
720
-
721
- # Update traces to show proper time segments
722
- for i in range(len(fig.data)):
723
- fig.data[i].x = [
724
- (seg['Start'], seg['Start'] + seg['Total'])
725
- for seg in check_rotation['TimeSegment']
726
- ]
727
 
728
  # Create a color map for each unique player
729
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
 
700
  game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
701
  game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
702
 
703
+ fig = px.timeline(data_frame=check_rotation, x_start='Start', x_end='Finish', y='Resource', range_x=[0,check_rotation["Finish"].max()], text='Task')
 
 
 
 
 
 
 
 
 
 
 
 
 
704
 
705
  fig.layout.xaxis.type = 'linear'
706
+ fig.data[0].x_start = check_rotation.Start.tolist()
707
+ fig.data[0].x_end = check_rotation.Finish.tolist()
708
+ fig.data[0].y = check_rotation.Task.tolist()
709
+ fig.update_yaxes(autorange="reversed")
 
 
 
 
710
 
711
  # Create a color map for each unique player
712
  player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]