Skip to content

Commit

Permalink
start 'history' page for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Mar 20, 2024
1 parent 4ce67c1 commit ffc8f66
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashboard
Title: What the Package Does (One Line, Title Case)
Version: 0.0.9
Version: 0.0.10
Authors@R:
person(given = "First",
family = "Last",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "dashboard: What the Package Does (One Line, Title Case)",
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
"license": "https://spdx.org/licenses/MIT",
"version": "0.0.9",
"version": "0.0.10",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
1 change: 1 addition & 0 deletions quarto/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ website:
- editors.qmd
- ed-reviews.qmd
- reviews.qmd
- history.qmd

format:
html:
Expand Down
61 changes: 61 additions & 0 deletions quarto/history.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "Software Review History"
format:
html:
fig-width: 8
fig-height: 4
code-fold: false
---

```{r load-pkg, echo = FALSE}
library (dashboard)
library (ggplot2)
```


```{r get-rev-history, echo = FALSE}
#| cache: true
dat <- review_history (quiet = TRUE)
```

This chart shows the total number of packages under review each month.


```{r history-months, echo = FALSE}
# Convert opened/closed dates to monthly sequence This is adapted from the editors
# timeline code in R/editors.R.
get_monthly_reviews <- function (dat) {
index <- which (!is.na (dat$closed_at))
month_seqs <- lapply (seq_along (index), function (i) {
s <- seq (dat$opened_at [index [i]], dat$closed_at [index [i]], by = "1 month")
format (s, "%Y-%m")
})
month_seq_table <- table (unlist (month_seqs))
data.frame (
month = lubridate::ymd (paste0 (names (month_seq_table), "-01")),
reviews = as.integer (month_seq_table)
)
}
monthly_reviews <- get_monthly_reviews (dat)
monthly_reviews$type <- "all"
monthly_reviews$lty <- 1L
monthly_reviews_gen <- get_monthly_reviews (dat [which (!dat$stats), ])
monthly_reviews_gen$type <- "general"
monthly_reviews_gen$lty <- 2L
monthly_reviews_stats <- get_monthly_reviews (dat [which (dat$stats), ])
monthly_reviews_stats$type <- "stats"
monthly_reviews_stats$lty <- 1L
reviews <- rbind (monthly_reviews, monthly_reviews_gen, monthly_reviews_stats)
```

```{r plot-review-history, echo = FALSE}
ggplot (reviews, aes (x = month, y = reviews, colour = type)) +
geom_line (linetype = reviews$lty) +
theme_minimal () +
theme (
legend.position = "inside",
legend.position.inside = c (0.9, 0.8)
)
```
2 changes: 2 additions & 0 deletions quarto/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ availability and past editorial workloads. The dashboard includes the following
system. This page is primarily intended to provide an overview of the current
state of software peer-review for the Editors-in-Charge, and in particular to
identify reviews in need of attention.
- The [*Software Review History* page](./history.qmd) which gives insights into
the historical developments of the software peer-review program.

0 comments on commit ffc8f66

Please sign in to comment.