James McCool commited on
Commit
e87901e
·
1 Parent(s): 2f2fe43

Refactor lineup display in app.py to improve styling and readability

Browse files

Updated the DataFrame display properties to set a consistent font size, enhancing the visual presentation of the lineup table. This change aims to improve user experience by making the data more accessible and easier to read.

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1039,7 +1039,7 @@ with tab4:
1039
  if slot_counts.get(pos, 0) < position_limits.get(pos, 0):
1040
  slot_to_fill = pos
1041
  break
1042
-
1043
  if slot_to_fill is not None:
1044
  # Avoid duplicates
1045
  if not player_row['Player'].iloc[0] in st.session_state['handbuilder_lineup']['Player'].values:
@@ -1100,7 +1100,7 @@ with tab4:
1100
 
1101
  # Show the lineup table with single-row selection for removal
1102
  event_remove = st.dataframe(
1103
- lineup_display_df.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn', subset=['Median']).background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
1104
  on_select="rerun",
1105
  selection_mode=["single-row"],
1106
  key="lineup_remove",
 
1039
  if slot_counts.get(pos, 0) < position_limits.get(pos, 0):
1040
  slot_to_fill = pos
1041
  break
1042
+
1043
  if slot_to_fill is not None:
1044
  # Avoid duplicates
1045
  if not player_row['Player'].iloc[0] in st.session_state['handbuilder_lineup']['Player'].values:
 
1100
 
1101
  # Show the lineup table with single-row selection for removal
1102
  event_remove = st.dataframe(
1103
+ lineup_display_df.style.set_properties(**{'font-size': '8pt'}).background_gradient(axis=0).background_gradient(cmap='RdYlGn', subset=['Median']).background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
1104
  on_select="rerun",
1105
  selection_mode=["single-row"],
1106
  key="lineup_remove",