Spaces:
Runtime error
Runtime error
James McCool
commited on
Commit
·
209a48f
1
Parent(s):
deb427b
Modify game rotation timeline plot to use Task as y-axis and delta as text label
Browse files
app.py
CHANGED
@@ -693,18 +693,16 @@ with tab5:
|
|
693 |
check_rotation = team_backlog.sort_values(by=['GAME_DATE', 'Finish'], ascending=[False, True])
|
694 |
check_rotation['Start'] = check_rotation['Start'].astype(float)
|
695 |
check_rotation['Finish'] = check_rotation['Finish'].astype(float)
|
696 |
-
check_rotation['Resource'] = check_rotation['Task']
|
697 |
-
check_rotation['Task'] = check_rotation['PLAYER_NAME'] + ' ' + check_rotation['delta'].astype(str)
|
698 |
|
699 |
st.write(check_rotation)
|
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='
|
704 |
|
705 |
fig.layout.xaxis.type = 'linear'
|
706 |
fig.data[0].x = check_rotation.delta.tolist()
|
707 |
-
|
708 |
fig.update_yaxes(autorange="reversed")
|
709 |
fig.update_layout(xaxis=dict(type='category'))
|
710 |
|
|
|
693 |
check_rotation = team_backlog.sort_values(by=['GAME_DATE', 'Finish'], ascending=[False, True])
|
694 |
check_rotation['Start'] = check_rotation['Start'].astype(float)
|
695 |
check_rotation['Finish'] = check_rotation['Finish'].astype(float)
|
|
|
|
|
696 |
|
697 |
st.write(check_rotation)
|
698 |
game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
|
699 |
game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
|
700 |
|
701 |
+
fig = px.timeline(data_frame=check_rotation, x_start='Start', x_end='Finish', y='Task', range_x=[0,check_rotation["Finish"].max()], text='delta')
|
702 |
|
703 |
fig.layout.xaxis.type = 'linear'
|
704 |
fig.data[0].x = check_rotation.delta.tolist()
|
705 |
+
|
706 |
fig.update_yaxes(autorange="reversed")
|
707 |
fig.update_layout(xaxis=dict(type='category'))
|
708 |
|