Skip to content

Commit

Permalink
Merge pull request #122 from katilingban:dev
Browse files Browse the repository at this point in the history
edit vignettes
  • Loading branch information
ernestguevarra authored Jan 2, 2025
2 parents f6b73db + 800630a commit de27820
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 24 deletions.
6 changes: 3 additions & 3 deletions R/theme_acdc.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ set_acdc_font <- function(alt = paleta_fonts$paleta_noto) {
#' @param plot_title_family Font family to use for the plot title. Default is
#' `base_family`.
#' @param plot_title_colour Colour of the plot title text. Default
#' is `acdc_text`.
#' is [acdc_text].
#' @param subtitle_family Font family to use for the plot subtitle. Default is
#' `base_family`.
#' @param subtitle_colour Colour of the subtitle text. Default is [acdc_text].
#' @param caption_colour Colour of the caption text. Default is [acdc_text].
#' @param axis_title_colour Colour of the axis title text. Default is
#' `acdc_text`.
#' [acdc_text].
#' @param legend_title_colour Colour of the legend title text. Default is
#' `acdc_text`.
#' [acdc_text].
#' @param legend_text_colour Colour of the legend text. Default is [acdc_text].
#' @param plot_background_fill Fill colour for the plot background. Default is
#' NULL.
Expand Down
6 changes: 3 additions & 3 deletions R/theme_nhs.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ set_nhs_font <- function(alt = paleta_fonts$paleta_noto) {
#' @param plot_title_family Font family to use for the plot title. Default is
#' `base_family`.
#' @param plot_title_colour Colour of the plot title text. Default
#' is `nhs_blue`.
#' is [nhs_blue].
#' @param subtitle_family Font family to use for the plot subtitle. Default is
#' `base_family`.
#' `base_family``.
#' @param subtitle_colour Colour of the subtitle text. Default is [nhs_mid_grey].
#' @param caption_colour Colour of the caption text. Default is [nhs_mid_grey].
#' @param axis_title_colour Colour of the axis title text. Default is
#' `nhs_cyan`.
#' [nhs_mid_grey].
#' @param legend_title_colour Colour of the legend title text. Default is NULL.
#' @param legend_text_colour Colour of the legend text. Default is NULL.
#' @param grid_col Grid colour. Default to [nhs_pale_grey].
Expand Down
4 changes: 2 additions & 2 deletions R/theme_wb.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ set_wb_font <- function(alt = paleta_fonts$paleta_noto) {
#' @param plot_title_family Font family to use for the plot title. Default is
#' `base_family`.
#' @param plot_title_colour Colour of the plot title text. Default
#' is `wb_blue`.
#' is [wb_blue].
#' @param subtitle_family Font family to use for the plot subtitle. Default is
#' `base_family`.
#' @param subtitle_colour Colour of the subtitle text. Default is [wb_cyan].
#' @param caption_colour Colour of the caption text. Default is [wb_cyan].
#' @param axis_title_colour Colour of the axis title text. Default is
#' `wb_cyan`.
#' [wb_cyan].
#' @param legend_title_colour Colour of the legend title text. Default is NULL.
#' @param legend_text_colour Colour of the legend text. Default is NULL.
#' @param grid_col Grid colour. Default to [wb_cyan].
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ print.palette <- function(x, ...) {
ylab = "", xaxt = "n", yaxt = "n", bty = "n")

rect(0, 0.9, n + 1, 1.1, col = rgb(1, 1, 1, 0.8), border = NA)
text((n + 1) / 2, 1, labels = attr(x, "name"), cex = 1, family = "serif")
text((n + 1) / 2, 1, labels = attr(x, "name"), cex = 1, family = "sans")
}
)
}
Expand Down
6 changes: 3 additions & 3 deletions man/theme_acdc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/theme_nhs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/theme_wb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/africa-cdc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ structure(
### Africa CDC light theme

```{r mtcars-acdc-light-bar, echo = FALSE, fig.align = "center", fig.alt = "A bar plot showcasing the Africa CDC light theme", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_acdc_light
## bar plot using theme_acdc_light
ggplot(
data = mtcars,
mapping = aes(
Expand Down Expand Up @@ -363,7 +363,7 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) +
### Africa CDC dark theme

```{r mtcars-acdc-dark-bar, echo = FALSE, fig.align = "center", fig.alt = "A bar plot showcasing the Africa CDC dark theme", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_acdc_dark
## bar plot using theme_acdc_dark
ggplot(
data = mtcars,
mapping = aes(
Expand Down
74 changes: 72 additions & 2 deletions vignettes/gnc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,82 @@ Complementing **GNC Green** is a set of 10 secondary colours.
structure(gnc_palettes$gnc_secondary, class = "palette", name = "GNC Secondary")
```

## GNC palettes

In addition to the primary and secondary colours, a set of tinted palettes for each of the GNC primary and secondary colours is available.

### Tinted green palette

```{r gnc-tinted-green, echo = FALSE, fig.alt = "GNC tinted green palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_greens, class = "palette", name = "GNC tinted green palette")
```

### Tinted grey palette

```{r gnc-tinted-grey, echo = FALSE, fig.alt = "GNC tinted grey palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_greys, class = "palette", name = "GNC tinted grey palette")
```

### Tinted sage palette

```{r gnc-tinted-sage, echo = FALSE, fig.alt = "GNC tinted sage palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_sages, class = "palette", name = "GNC tinted sage palette")
```

### Tinted dark green palette

```{r gnc-tinted-dark-green, echo = FALSE, fig.alt = "GNC tinted dark green palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_dark_greens, class = "palette", name = "GNC tinted dark green palette")
```

### Tinted lime palette

```{r gnc-tinted-lime, echo = FALSE, fig.alt = "GNC tinted lime palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_limes, class = "palette", name = "GNC tinted lime palette")
```

### Tinted aqua green palette

```{r gnc-tinted-aqua-green, echo = FALSE, fig.alt = "GNC tinted aqua green palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_aqua_greens, class = "palette", name = "GNC tinted aqua green palette")
```

### Tinted cyan palette

```{r gnc-tinted-cyan, echo = FALSE, fig.alt = "GNC tinted cyan palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_cyans, class = "palette", name = "GNC tinted cyan palette")
```

### Tinted blue palette

```{r gnc-tinted-blue, echo = FALSE, fig.alt = "GNC tinted blue palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_blues, class = "palette", name = "GNC tinted blue palette")
```

### Tinted orange palette

```{r gnc-tinted-orange, echo = FALSE, fig.alt = "GNC tinted orange palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_oranges, class = "palette", name = "GNC tinted orange palette")
```

### Tinted moss green palette

```{r gnc-tinted-moss-green, echo = FALSE, fig.alt = "GNC tinted moss green palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_moss_greens, class = "palette", name = "GNC tinted moss green palette")
```

### Tinted gold palette

```{r gnc-tinted-gold, echo = FALSE, fig.alt = "GNC tinted gold palette", fig.align = "center", fig.height = 1}
structure(gnc_palettes$gnc_golds, class = "palette", name = "GNC tinted gold palette")
```

## GNC `ggplot2` theme

A GNC `ggplot2` theme function called `theme_gnc()` is included in the `paleta` package. Following are examples of how it can be used.

```{r gnc-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the GNC ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_gnc()
## bar plot using theme_gnc()
ggplot(
data = mtcars,
mapping = aes(
Expand Down Expand Up @@ -76,7 +146,7 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) +
title = "GNC Theme",
subtitle = "GNC secondary palette",
) +
theme_gnc(grid = "Y")
theme_gnc(grid = "XY")
```


2 changes: 1 addition & 1 deletion vignettes/nhs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ structure(
An NHS `ggplot2` theme function called `theme_nhs()` is included in the `paleta` package. Following are examples of how it can be used.

```{r nhs-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the NHS ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_nhs()
## bar plot using theme_nhs()
ggplot(
data = mtcars,
mapping = aes(
Expand Down
2 changes: 1 addition & 1 deletion vignettes/unicef.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ structure(unicef_palettes$unicef_neutrals, class = "palette", name = "UNICEF Neu
A UNICEF `ggplot2` theme function called `theme_unicef()` is included in the `paleta` package. Following are examples of how it can be used.

```{r unicef-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the UNICEF ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_unicef()
## bar plot using theme_unicef()
ggplot(
data = mtcars,
mapping = aes(
Expand Down
2 changes: 1 addition & 1 deletion vignettes/world-bank.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ structure(wb_palettes$wb_dark_greens, class = "palette", name = "World Bank Dark
A World Bank `ggplot2` theme function called `theme_wb()` is included in the `paleta` package. Following are examples of how it can be used.

```{r wb-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the World Bank ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1}
## barplot using theme_wb()
## bar plot using theme_wb()
ggplot(
data = mtcars,
mapping = aes(
Expand Down

0 comments on commit de27820

Please sign in to comment.