James McCool commited on
Commit
7e14434
·
1 Parent(s): 0720ad1

Enhance DataFrame display in Handbuilder tab of app.py by applying background gradients to player selection and lineup tables. This improves visual clarity and user experience when reviewing player data.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -862,7 +862,7 @@ with tab4:
862
  with col2:
863
  st.subheader("Player Select")
864
  event = st.dataframe(
865
- player_select_df,
866
  on_select="rerun",
867
  selection_mode=["single-row"],
868
  key=f"handbuilder_select_{st.session_state['handbuilder_select_key']}",
@@ -935,7 +935,7 @@ with tab4:
935
 
936
  # Show the lineup table with single-row selection for removal
937
  event_remove = st.dataframe(
938
- lineup_display_df,
939
  on_select="rerun",
940
  selection_mode=["single-row"],
941
  key="lineup_remove",
 
862
  with col2:
863
  st.subheader("Player Select")
864
  event = st.dataframe(
865
+ player_select_df.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
866
  on_select="rerun",
867
  selection_mode=["single-row"],
868
  key=f"handbuilder_select_{st.session_state['handbuilder_select_key']}",
 
935
 
936
  # Show the lineup table with single-row selection for removal
937
  event_remove = st.dataframe(
938
+ lineup_display_df.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
939
  on_select="rerun",
940
  selection_mode=["single-row"],
941
  key="lineup_remove",