Skip to content

Commit

Permalink
2025-01-01 15:09:16.859958 - Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulan-c committed Jan 1, 2025
1 parent 9faaca3 commit 4284035
Show file tree
Hide file tree
Showing 25 changed files with 12,224 additions and 6,264 deletions.
7 changes: 5 additions & 2 deletions R/plot_match_story.R
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ PlotMatchStory <- function(season_num, # season number

for(u in seq(1:nrow(uf))){

cli::cli_alert_warning("Accounting for {uf$white[u]}-{uf$black[u]} {uf$result[u]}")
cli::cli_alert_warning("Accounting for {u}/{nrow(uf)} {uf$white[u]}-{uf$black[u]} {uf$result[u]}...")

# Find where the missing games should go

Expand Down Expand Up @@ -601,7 +601,10 @@ PlotMatchStory <- function(season_num, # season number
moves$black[moves$order == uf$order[u]][1]
)

# print(glue::glue("{u} {uf$pregamediff[u]} {uf$postgamescore_t1[u] - uf$postgamescore_t2[u]}"))
print(glue::glue("{u} {uf$pregamediff[u]} {uf$postgamescore_t1[u] - uf$postgamescore_t2[u]}"))

# bugfix 2024-12-08
print(glue::glue("{}"))

# Add match eval
moves$eval_scaled_match[moves$order == uf$order[u]] <- seq(
Expand Down
2 changes: 0 additions & 2 deletions R/publish_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (!require("pacman")) install.packages("pacman")
pacman::p_load(tidyverse, data.table, cli, fs, glue, here, distill)




# ---- FUNCTIONS --------------------------------------------------------------


Expand Down
22 changes: 9 additions & 13 deletions R/report_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -467,34 +467,30 @@ PodiumTeamPlayers <- function(positions, games, league, season){

SeasonRankTracker <- function(league = league, positions = positions, league_col_dark = league_col_dark) {
if(league == "team4545"){

top_places <- positions %>%
filter(round == 8) %>%
arrange(rank) %>%
filter(rank <= 5) %>%
dplyr::pull(team)

position_tracker <- positions %>%
mutate(round = as.factor(round)) %>%
ggplot(aes(x = round, y = rank, colour = team)) +
geom_line(aes(group = team), size = 2.5) +
# geom_point(aes(group = team), size = 2) +
geom_line(aes(group = team), linewidth = 2.5) +
theme_minimal() +
# scale_y_reverse(limits = c(20, 1), breaks = integer_breaks()) +
scale_y_reverse(limits = c(max(positions$rank), 1), breaks = floor(seq(max(positions$rank), 1, length.out = 4))) +
scale_x_discrete(expand = expansion(add = c(0.1, 0.1))) +
scale_color_manual(values = c("#ffd700", "#7b7b7b", "#cd7f32", "#a6c7ff", "#d9e7ff"),
breaks = c(top_places),
labels = c(top_places)) +
gghighlight::gghighlight(team %in% top_places, use_direct_label = F,
unhighlighted_params = list(colour = alpha("grey", 0.1)),
label_params = list(size = 4,
nudge_x = -1,
nudge_y = -15,
direction = "y",
fill = "white",
colour = "black")) +
gghighlight::gghighlight(
team %in% top_places,
use_direct_label = F,
unhighlighted_params = list(colour = alpha("grey", 0.1)
)) +
labs(x = "Round",
y = "Rank after each round") +
theme(legend.position = "top") +
theme(panel.grid.minor = element_blank()) +
theme(
legend.position = c(0.5, 0.3),
Expand Down Expand Up @@ -554,7 +550,7 @@ SeasonRankTracker <- function(league = league, positions = positions, league_col
scale_y_reverse(limits = c(20, 1), breaks = c(1, 10, 20, 30, 40, 50)) +
scale_x_discrete(expand = expansion(add = c(0.1, 0.1))) +
gghighlight::gghighlight(player %in% top_places, use_direct_label = F,
unhighlighted_params = list(colour = alpha("grey", 0.1)),
unhighlighted_params = list(colour = alpha("red", 0.1)),
label_params = list(size = 4, nudge_x = 2, nudge_y = 0, direction = "y")) +
labs(x = "Round",
y = "Rank before round") +
Expand Down
1,241 changes: 646 additions & 595 deletions docs/about.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/after_contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
Expand All @@ -32,7 +32,7 @@
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
Expand Down
Loading

0 comments on commit 4284035

Please sign in to comment.