wab_header <- glue::glue("<div style='display: flex; justify-content: space-between; align-items: center;'> <div> <img src='https://a.espncdn.com/combiner/i?img=/redesign/assets/img/icons/ESPN-icon-basketball.png' style='height: 40px; width: auto; vertical-align: middle;'> </div> <div style='flex-grow:1; margin-left: 30px; margin-right: 30px'> <span style='display: block; font-weight: bold; text-align: center; font-size: 24px;'>Top Wins by Location using WAB <br>so far during 2025-26 season</span> <span style='font-size: 14px; font-weight: normal; display: block; text-align: center;'>Shows games by location with highest wins-above-bubble value. <br>Only includes games played <em>before</em> January 6, 2026</span> </div> <div> <img src='https://a.espncdn.com/combiner/i?img=/redesign/assets/img/icons/ESPN-icon-basketball.png' style='height: 40px; width: auto; vertical-align: middle;'> </div> </div> <br>")wab_tbl <- wab_data |> dplyr::filter(game_type =="played", wab >0.60) |> cbbplotR::gt_cbb_teams(team, team, logo_height =20, include_name =FALSE) |> cbbplotR::gt_cbb_teams(opp, opp, logo_height =20, include_name =FALSE) |> dplyr::mutate(winner_score = stringr::str_split_i(score, "-", 1),loser_score = stringr::str_split_i(score, "-", 2),wab_range = dplyr::case_when( wab >=0.90~"0.90+ and up", wab >=0.85~"0.85 to 0.90", wab >=0.80~"0.80 to 0.85", wab >=0.75~"0.75 to 0.80", wab >=0.70~"0.70 to 0.75", wab >=0.65~"0.65 to 0.70", wab >=0.60~"0.60 to 0.65" ),wab_range =factor(wab_range, levels =c("0.90+ and up", "0.85 to 0.90", "0.80 to 0.85", "0.75 to 0.80", "0.70 to 0.75", "0.65 to 0.70", "0.60 to 0.65" )),location_full = dplyr::case_when( location =="A"~"Away", location =="H"~"Home", location =="N"~"Neutral" ),wab_display =sprintf("%.2f", wab) ) |> dplyr::arrange(-wab) |> dplyr::group_by(wab_range, location_full) |> dplyr::mutate(game_num = dplyr::row_number(),game_result =paste0("**+", wab_display, "**", " | ", team, " ", winner_score, "-", loser_score, " ", opp) ) |> dplyr::summarise(games =paste(game_result, collapse =" \n"),.groups ="drop" ) |> tidyr::pivot_wider(names_from = location_full, values_from = games, values_fill ="") |> dplyr::mutate(Away = dplyr::na_if(Away, ""),Home = dplyr::na_if(Home, ""),Neutral = dplyr::na_if(Neutral, "") ) |> dplyr::select(WAB = wab_range, Away, Home, Neutral) |> dplyr::ungroup() |> gt::gt() |> gtUtils::gt_theme_savant() |> gt::fmt_markdown(columns =c(Away, Home, Neutral)) |> gt::sub_missing(columns =c(Away, Home, Neutral), missing_text ="") |> gt::cols_align(align ="left", columns =c(Away, Home, Neutral)) |>gt_column_subheaders(WAB =list(heading ="WAB", subtitle ="Wins-Above-Bubble"),Away =list(heading ="Road Wins", subtitle ="35 total games"),Home =list(heading ="Home Wins", subtitle ="8 total games"),Neutral =list(heading ="Neutral Site Wins", subtitle ="28 total games") ) |> gt::tab_header(title = gt::html(wab_header)) |> gt::tab_source_note(source_note = gt::html("<hr>Data via barttorvik.com and WAB values calculated via Torvik ratings | theme via {gtUtils} <br> Winning games on the road is useful to building a resume!<br> Data only for games played before January 6, 2026<br> <hr><b>Table by Chris at Bless your chart</b>" ) ) |> gt::tab_style(style =list(gt::cell_borders(sides =c("left", "right", "top", "bottom"),color ="black",weight = gt::px(2) )),locations =list( gt::cells_body(), gt::cells_column_labels(), gt::cells_row_groups() ) ) |> gtUtils::gt_border_bars_bottom(c("#0d1e2d", "#c1d6e2","#f07e1d")) |> gt::tab_options(table.width = gt::px(625)) |> gt::tab_style(style =list( gt::cell_text(size = gt::px(16) ) ),locations = gt::cells_body(rows = gt::everything(),columns = gt::everything() ) ) |> gt::tab_style(style =list( gt::cell_text(weight ="bold" ) ),locations = gt::cells_body(rows = gt::everything(),columns ="WAB" ) ) |> gt::tab_style(style = gt::cell_text(size = gt::px(35)),locations = gt::cells_column_labels() ) |> gt::tab_style(locations = gt::cells_footnotes(),style = gt::cell_text(font = gt::google_font("News Cycle"),size = gt::px(10.5) ) ) |> gtExtras::gt_highlight_rows(columns =1,rows =1,fill ="#1a9641",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =2,fill ="#1da748",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =3,fill ="#20b74f",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =4,fill ="#23c857",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =5,fill ="#47df77",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =6,fill ="#69e590",alpha =0.4 ) |> gtExtras::gt_highlight_rows(columns =1,rows =7,fill ="#8aeba8",alpha =0.4 ) gt_save_crop( wab_tbl,file ="wabl_tbl.png",whitespace =40,bg ="white")wab_tbl
Top Wins by Location using WAB
so far during 2025-26 seasonShows games by location with highest wins-above-bubble value.
Only includes games played before January 6, 2026
Data via barttorvik.com and WAB values calculated via Torvik ratings | theme via {gtUtils}
Winning games on the road is useful to building a resume!
Data only for games played before January 6, 2026 Table by Chris at Bless your chart