James McCool commited on
Commit
15c8c2c
·
1 Parent(s): 1b67225

Improve player display in Simple and Advanced views by implementing LinkColumn for enhanced interactivity and clarity in ownership metrics

Browse files
Files changed (1) hide show
  1. app.py +102 -8
app.py CHANGED
@@ -468,19 +468,113 @@ with tab2:
468
  if view_var == "Simple":
469
  try:
470
  player_roo_disp = player_roo_disp[['Player', 'Position', 'Team', 'Salary', 'Median', 'Ceiling', 'Own%']]
471
- player_roo_disp = player_roo_disp.set_index('Player', drop=True)
472
- st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  except:
474
- player_roo_disp = player_roo_disp.set_index('Player', drop=True)
475
- st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
 
477
  elif view_var == "Advanced":
478
  try:
479
- player_roo_disp = player_roo_disp.set_index('Player', drop=True)
480
- st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  except:
482
- player_roo_disp = player_roo_disp.set_index('Player', drop=True)
483
- st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
 
485
  with tab3:
486
  st.header("Optimals")
 
468
  if view_var == "Simple":
469
  try:
470
  player_roo_disp = player_roo_disp[['Player', 'Position', 'Team', 'Salary', 'Median', 'Ceiling', 'Own%']]
471
+ st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2),
472
+ column_config={
473
+ "Player": st.column_config.LinkColumn(
474
+ "Player",
475
+ max_chars=25,
476
+ help="The Player being projected"
477
+ ),
478
+ "Team": st.column_config.LinkColumn(
479
+ "Team",
480
+ max_chars=25,
481
+ help="The Team of the Player"
482
+ ),
483
+ "Own%": st.column_config.LinkColumn(
484
+ "Own%",
485
+ max_chars=25,
486
+ help="The projected ownership of the Player being projected"
487
+ )
488
+ }, height=750, use_container_width = True, hide_index = True)
489
  except:
490
+ st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2),
491
+ column_config={
492
+ "Player": st.column_config.LinkColumn(
493
+ "Player",
494
+ max_chars=25,
495
+ help="The Player being projected"
496
+ ),
497
+ "Team": st.column_config.LinkColumn(
498
+ "Team",
499
+ max_chars=25,
500
+ help="The Team of the Player"
501
+ ),
502
+ "Own%": st.column_config.LinkColumn(
503
+ "Own%",
504
+ max_chars=25,
505
+ help="The projected ownership of the Player being projected"
506
+ )
507
+ }, height=750, use_container_width = True, hide_index = True)
508
 
509
  elif view_var == "Advanced":
510
  try:
511
+ st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2),
512
+ column_config={
513
+ "Player": st.column_config.LinkColumn(
514
+ "Player",
515
+ max_chars=25,
516
+ help="The Player being projected"
517
+ ),
518
+ "Team": st.column_config.LinkColumn(
519
+ "Team",
520
+ max_chars=25,
521
+ help="The Team of the Player"
522
+ ),
523
+ "Own%": st.column_config.LinkColumn(
524
+ "Own%",
525
+ max_chars=25,
526
+ help="The projected ownership of the Player being projected"
527
+ ),
528
+ "Small Field Own%": st.column_config.LinkColumn(
529
+ "Small Field Own%",
530
+ max_chars=25,
531
+ help="The projected ownership of the Player being projected in smaller/sharper fields"
532
+ ),
533
+ "Large Field Own%": st.column_config.LinkColumn(
534
+ "Large Field Own%",
535
+ max_chars=25,
536
+ help="The projected ownership of the Player being projected in larger/softer fields"
537
+ ),
538
+ "Cash Own%": st.column_config.LinkColumn(
539
+ "Cash Own%",
540
+ max_chars=25,
541
+ help="The projected ownership of the Player being projected for cash games"
542
+ )
543
+ }, height=750, use_container_width = True, hide_index = True)
544
  except:
545
+ st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2),
546
+ column_config={
547
+ "Player": st.column_config.LinkColumn(
548
+ "Player",
549
+ max_chars=25,
550
+ help="The Player being projected"
551
+ ),
552
+ "Team": st.column_config.LinkColumn(
553
+ "Team",
554
+ max_chars=25,
555
+ help="The Team of the Player"
556
+ ),
557
+ "Own%": st.column_config.LinkColumn(
558
+ "Own%",
559
+ max_chars=25,
560
+ help="The projected ownership of the Player being projected"
561
+ ),
562
+ "Small Field Own%": st.column_config.LinkColumn(
563
+ "Small Field Own%",
564
+ max_chars=25,
565
+ help="The projected ownership of the Player being projected in smaller/sharper fields"
566
+ ),
567
+ "Large Field Own%": st.column_config.LinkColumn(
568
+ "Large Field Own%",
569
+ max_chars=25,
570
+ help="The projected ownership of the Player being projected in larger/softer fields"
571
+ ),
572
+ "Cash Own%": st.column_config.LinkColumn(
573
+ "Cash Own%",
574
+ max_chars=25,
575
+ help="The projected ownership of the Player being projected for cash games"
576
+ )
577
+ }, height=750, use_container_width = True, hide_index = True)
578
 
579
  with tab3:
580
  st.header("Optimals")