nesticot commited on
Commit
5104390
·
1 Parent(s): ea42c54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -312,6 +312,7 @@ app_ui = ui.page_fluid(
312
 
313
  ui.input_date_range("scorer_date_id", "Streamer Stats Date Range",start = max(datetime.today().date()- timedelta(days=21),pd.to_datetime('2023-10-10')), end = datetime.today().date()),
314
  ui.input_numeric('min_games','Min. Games (Streamers)',value=3),
 
315
  ui.output_table("result"),width=3),
316
 
317
 
@@ -776,8 +777,10 @@ def server(input, output, session):
776
 
777
  df_dated_score_group_table.columns = ['Player','Team' ,'Position', 'Roster%', 'GP', 'TOI/GP',
778
  'Goals/GP', 'ixG/GP','Assists/GP', 'Points/GP', 'Shots/GP', 'PPP/GP', 'PP%']
 
 
779
 
780
- return df_dated_score_group_table[df_dated_score_group_table.Position != 'D'].head(15).style.background_gradient(cmap=cmap_off, subset=['Points/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
781
  .set_table_styles([{
782
  'selector': 'caption',
783
  'props': [
@@ -911,7 +914,7 @@ def server(input, output, session):
911
  df_dated_score_group_table.columns = ['Player','Team' ,'Position', 'Roster%', 'GP', 'TOI/GP',
912
  'Goals/GP', 'ixG/GP','Assists/GP', 'Points/GP', 'Shots/GP', 'PPP/GP', 'PP%']
913
 
914
- return df_dated_score_group_table[df_dated_score_group_table.Position == 'D'].head(15).style.background_gradient(cmap=cmap_off, subset=['Points/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
915
  .set_table_styles([{
916
  'selector': 'caption',
917
  'props': [
@@ -1045,7 +1048,7 @@ def server(input, output, session):
1045
 
1046
  #df_dated_bangers_group_table.head(15)
1047
 
1048
- return df_dated_bangers_group_table[df_dated_bangers_group_table.Position != 'D'].head(15).style.background_gradient(cmap=cmap_off, subset=['S+H+B/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
1049
  .set_table_styles([{
1050
  'selector': 'caption',
1051
  'props': [
@@ -1179,7 +1182,7 @@ def server(input, output, session):
1179
 
1180
  #df_dated_bangers_group_table.head(15)
1181
 
1182
- return df_dated_bangers_group_table[df_dated_bangers_group_table.Position == 'D'].head(15).style.background_gradient(cmap=cmap_off, subset=['S+H+B/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
1183
  .set_table_styles([{
1184
  'selector': 'caption',
1185
  'props': [
 
312
 
313
  ui.input_date_range("scorer_date_id", "Streamer Stats Date Range",start = max(datetime.today().date()- timedelta(days=21),pd.to_datetime('2023-10-10')), end = datetime.today().date()),
314
  ui.input_numeric('min_games','Min. Games (Streamers)',value=3),
315
+ ui.input_numeric('max_head','Number of Rows (Streamers)',value=15),
316
  ui.output_table("result"),width=3),
317
 
318
 
 
777
 
778
  df_dated_score_group_table.columns = ['Player','Team' ,'Position', 'Roster%', 'GP', 'TOI/GP',
779
  'Goals/GP', 'ixG/GP','Assists/GP', 'Points/GP', 'Shots/GP', 'PPP/GP', 'PP%']
780
+
781
+
782
 
783
+ return df_dated_score_group_table[df_dated_score_group_table.Position != 'D'].head(input.max_head()).style.background_gradient(cmap=cmap_off, subset=['Points/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
784
  .set_table_styles([{
785
  'selector': 'caption',
786
  'props': [
 
914
  df_dated_score_group_table.columns = ['Player','Team' ,'Position', 'Roster%', 'GP', 'TOI/GP',
915
  'Goals/GP', 'ixG/GP','Assists/GP', 'Points/GP', 'Shots/GP', 'PPP/GP', 'PP%']
916
 
917
+ return df_dated_score_group_table[df_dated_score_group_table.Position == 'D'].head(input.max_head()).style.background_gradient(cmap=cmap_off, subset=['Points/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
918
  .set_table_styles([{
919
  'selector': 'caption',
920
  'props': [
 
1048
 
1049
  #df_dated_bangers_group_table.head(15)
1050
 
1051
+ return df_dated_bangers_group_table[df_dated_bangers_group_table.Position != 'D'].head(input.max_head()).style.background_gradient(cmap=cmap_off, subset=['S+H+B/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
1052
  .set_table_styles([{
1053
  'selector': 'caption',
1054
  'props': [
 
1182
 
1183
  #df_dated_bangers_group_table.head(15)
1184
 
1185
+ return df_dated_bangers_group_table[df_dated_bangers_group_table.Position == 'D'].head(input.max_head()).style.background_gradient(cmap=cmap_off, subset=['S+H+B/GP']).background_gradient(cmap=cmap_total, subset=['Roster%']).hide_index().set_properties(**{'Height': '12px'},**{'text-align': 'center'})\
1186
  .set_table_styles([{
1187
  'selector': 'caption',
1188
  'props': [