Spaces:
Build error
Build error
James McCool
commited on
Commit
·
8e0a77c
1
Parent(s):
f83f601
added color mapping for player specific rotations
Browse files
app.py
CHANGED
|
@@ -699,6 +699,14 @@ with tab5:
|
|
| 699 |
|
| 700 |
fig.layout.xaxis.type = 'linear'
|
| 701 |
fig.data[0].x = check_rotation.delta.tolist()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 702 |
fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
|
| 703 |
fig.add_vline(x=24, line_width=3, line_dash="dash", line_color="green")
|
| 704 |
fig.add_vline(x=36, line_width=3, line_dash="dash", line_color="green")
|
|
|
|
| 699 |
|
| 700 |
fig.layout.xaxis.type = 'linear'
|
| 701 |
fig.data[0].x = check_rotation.delta.tolist()
|
| 702 |
+
# Create a color map for each unique player
|
| 703 |
+
player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
|
| 704 |
+
color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
|
| 705 |
+
|
| 706 |
+
# Update the figure to use the color map
|
| 707 |
+
fig.update_traces(marker=dict(color=[color_map[player] for player in check_rotation['PLAYER_NAME']]))
|
| 708 |
+
|
| 709 |
+
# Add vertical lines for quarter marks
|
| 710 |
fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
|
| 711 |
fig.add_vline(x=24, line_width=3, line_dash="dash", line_color="green")
|
| 712 |
fig.add_vline(x=36, line_width=3, line_dash="dash", line_color="green")
|