1
0
mw-lifecycle-analysis/121325_work/EDA_plots.R

121 lines
4.8 KiB
R

library(tidyverse)
core_csv <-"~/121325_work/aggregate_dfs/121325_core_weekly.csv"
core_counts <- read.csv(core_csv, header = TRUE)
config_csv <-"~/121325_work/aggregate_dfs/121325_config_weekly.csv"
config_counts <- read.csv(config_csv, header = TRUE)
puppet_csv <-"~/121325_work/aggregate_dfs/121325_puppet_weekly.csv"
puppet_counts <- read.csv(puppet_csv, header = TRUE)
#core
core_counts <- core_counts |>
filter(isAuthorWMF != "Gerrit") |>
filter(isAuthorWMF != "localization")
core_commits_created <- ggplot(
core_counts,
aes(
x=week_index,
y=count,
fill=isAuthorWMF
)
) +
facet_grid(source ~ .,
scales = "free_y",
labeller = labeller(source = c("c1" = "VisualEditor",
"c2" = "HTTPS-login",
"c3" = "HTTP-deprecation"))) +
geom_col(position = position_dodge(width = 0.9), width = 0.8) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -29),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -9),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -4),
linetype = "3313", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c2"),
aes(xintercept = -99),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c2"),
aes(xintercept = -4),
linetype = "3313", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c3"),
aes(xintercept = -97),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c3"),
aes(xintercept = -3),
linetype = "3313", color = "black", linewidth = 0.5) +
geom_vline(xintercept = 0, linetype = "dashed", color = "black", linewidth = 0.5) +
geom_text(
data = subset(core_counts, source == "c1" & week_index == 6),
aes(x=week_index, y=100, label='Opt-out deployment'),
size = 2.5) +
geom_text(
data = subset(core_counts, source == "c1" & week_index == -33),
aes(x=week_index, y=100, label='Opt-in Testing'),
size = 2.5) +
geom_text(
data = subset(core_counts, source == "c2" & week_index == -12),
aes(x=week_index, y=100, label='Deployment Announcement'),
size = 2.5) +
theme_minimal() +
scale_fill_viridis_d() +
labs(
x = "Weeks from Feature Deployment",
y = "Count of wmf-config commits Created",
fill = "Commit Author Affiliated with WMF?"
) +
theme(legend.position = "top")
core_commits_created
#VE
ve_csv <-"~/121325_work/aggregate_dfs/121325_ve_weekly.csv"
ve_counts <- read.csv(ve_csv, header = TRUE)
ve_counts <- ve_counts |>
filter(isAuthorWMF != "Gerrit")|>
filter(source == 'c1')
ve_commits_created <-
ggplot(
ve_counts,
aes(
x=week_index,
y=count,
fill=isAuthorWMF
)
) +
facet_grid(source ~ .,
scales = "free_y",
labeller = labeller(source = c("c1" = "VisualEditor",
"c2" = "HTTPS-login",
"c3" = "HTTP-deprecation"))) +
geom_col(position = position_dodge(width = 0.9), width = 0.8) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -29),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -9),
linetype = "dotted", color = "black", linewidth = 0.5) +
geom_vline(data = core_counts |> filter(source == "c1"),
aes(xintercept = -4),
linetype = "3313", color = "black", linewidth = 0.5) +
geom_vline(xintercept = 0, linetype = "dashed", color = "black", linewidth = 0.5) +
geom_text(
data = subset(core_counts, source == "c1" & week_index == 3),
aes(x=week_index, y=100, label='Opt-out deployment'),
size = 2.5) +
geom_text(
data = subset(core_counts, source == "c1" & week_index == -27),
aes(x=week_index, y=100, label='Opt-in Testing'),
size = 2.5) +
geom_text(
data = subset(core_counts, source == "c1" & week_index == -4),
aes(x=week_index, y=100, label='Deployment Announcement'),
size = 2.5) +
theme_minimal() +
scale_fill_viridis_d() +
labs(
x = "Weeks from Feature Deployment",
y = "Count of extensions/visualeditor commits Created",
fill = "Commit Author Affiliated with WMF?"
) +
theme(legend.position = "top")
ve_commits_created