Get state transition open->proposal label

This commit is contained in:
Marcel Radzio 2022-10-30 01:07:25 +02:00
parent bbba4dbff7
commit 787fecc8af
2 changed files with 76 additions and 24 deletions

View File

@ -18,9 +18,10 @@ The following data is based purely on public knowledge. This means data is fetch
library(gh)
library(tidyverse)
library(hrbrthemes)
library(survminer)
import_roboto_condensed()
extrafont::loadfonts(device="win")
# import_roboto_condensed()
# extrafont::loadfonts(device = "win")
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
```
@ -242,7 +243,34 @@ if (!exists("element_employee") || !exists("famedly_employee") || !exists("beepe
# Get times for state transitions
```{r message=FALSE, warning=FALSE, tidy = "styler"}
opened_to_proposal <- issues_gql_all
# Opened to Proposal transition
opened_to_proposal <- issues_gql_all |>
filter(!is.na(labels) && is.element("proposal", labels$name)) |>
select(title, author, createdAt, labels)
for (i in 1:length(opened_to_proposal$labels)) {
opened_to_proposal$labels[[i]] <- opened_to_proposal$labels[[i]] |>
rowwise() |>
filter(is.element("proposal", name))
}
opened_to_proposal <- opened_to_proposal |>
mutate(proposalAt = labels$createdAt) |>
select(title, author, createdAt, proposalAt)
opened_to_proposal <- opened_to_proposal |>
mutate(Company = case_when(
!is.null(author) && is.element(author, element_employee) ~ "Element",
!is.null(author) && is.element(author, sct_employee) ~ "SCT",
!is.null(author) && is.element(author, famedly_employee) ~ "Famedly",
!is.null(author) && is.element(author, beeper_employee) ~ "Beeper",
TRUE ~ "Other"
)) |>
group_by(Company)
# Proposal to having impl
# FIXME this doesnt work at this time as we dont know when the labels got removed. We need timelineItems() in the graphql query for this
# proposal_to_impl <- issues_gql_all |>
# filter(!is.na(labels) && is.element("proposal", labels$name)) |>
# select(title, author, createdAt)
```
# MSCs by Company (all kind)
@ -275,20 +303,20 @@ mscs_beeper <- mscs |>
mscs_other <- nrow(mscs) - mscs_element - mscs_beeper - mscs_famedly - mscs_sct
# Display Data
data <- data.frame(Company = c("Beeper", "Element", "Famedly", "Other", "SCT"), Count=c(mscs_beeper,mscs_element,mscs_famedly,mscs_other,mscs_sct))
data <- map_df(data,rev)
data <- data.frame(Company = c("Beeper", "Element", "Famedly", "Other", "SCT"), Count = c(mscs_beeper, mscs_element, mscs_famedly, mscs_other, mscs_sct))
data <- map_df(data, rev)
data$Company <- factor(data$Company, levels = data$Company)
# Basic piechart
ggplot(data, aes(x = Company, y = Count)) +
geom_bar(stat = "identity", fill="#69b3a2") +
geom_bar(stat = "identity", fill = "#69b3a2") +
theme_ipsum() +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position="none"
) +
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position = "none"
) +
labs(
title = str_wrap("MSCs from companies", 40),
caption = "source: Github API",
@ -297,7 +325,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +
@ -334,20 +361,20 @@ merged_beeper <- merged_mscs |>
merged_other <- nrow(merged_mscs) - merged_element - merged_beeper - merged_famedly - merged_sct
# Display Data
data <- data.frame(Company = c("Beeper", "Element", "Famedly", "Other", "SCT"), Count=c(merged_beeper,merged_element,merged_famedly,merged_other,merged_sct))
data <- map_df(data,rev)
data <- data.frame(Company = c("Beeper", "Element", "Famedly", "Other", "SCT"), Count = c(merged_beeper, merged_element, merged_famedly, merged_other, merged_sct))
data <- map_df(data, rev)
data$Company <- factor(data$Company, levels = data$Company)
# Basic piechart
ggplot(data, aes(x = Company, y = Count)) +
geom_bar(stat = "identity", fill="#69b3a2") +
geom_bar(stat = "identity", fill = "#69b3a2") +
theme_ipsum() +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position="none"
) +
panel.grid.minor.y = element_blank(),
panel.grid.major.y = element_blank(),
legend.position = "none"
) +
labs(
title = str_wrap("Merged MSCs from companies", 40),
caption = "source: Github API",
@ -356,7 +383,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +

View File

@ -25,9 +25,10 @@ is fetched from github and gitlab as best as I was able to.
library(gh)
library(tidyverse)
library(hrbrthemes)
library(survminer)
import_roboto_condensed()
extrafont::loadfonts(device = "win")
# import_roboto_condensed()
# extrafont::loadfonts(device = "win")
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
```
@ -247,7 +248,34 @@ if (!exists("element_employee") || !exists("famedly_employee") || !exists("beepe
# Get times for state transitions
``` r
opened_to_proposal <- issues_gql_all
# Opened to Proposal transition
opened_to_proposal <- issues_gql_all |>
filter(!is.na(labels) && is.element("proposal", labels$name)) |>
select(title, author, createdAt, labels)
for (i in 1:length(opened_to_proposal$labels)) {
opened_to_proposal$labels[[i]] <- opened_to_proposal$labels[[i]] |>
rowwise() |>
filter(is.element("proposal", name))
}
opened_to_proposal <- opened_to_proposal |>
mutate(proposalAt = labels$createdAt) |>
select(title, author, createdAt, proposalAt)
opened_to_proposal <- opened_to_proposal |>
mutate(Company = case_when(
!is.null(author) && is.element(author, element_employee) ~ "Element",
!is.null(author) && is.element(author, sct_employee) ~ "SCT",
!is.null(author) && is.element(author, famedly_employee) ~ "Famedly",
!is.null(author) && is.element(author, beeper_employee) ~ "Beeper",
TRUE ~ "Other"
)) |>
group_by(Company)
# Proposal to having impl
# FIXME this doesnt work at this time as we dont know when the labels got removed. We need timelineItems() in the graphql query for this
# proposal_to_impl <- issues_gql_all |>
# filter(!is.na(labels) && is.element("proposal", labels$name)) |>
# select(title, author, createdAt)
```
# MSCs by Company (all kind)
@ -301,7 +329,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +
@ -361,7 +388,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +