diff --git a/R/theme_unicef.R b/R/theme_unicef.R index 19f0d57..2b43301 100644 --- a/R/theme_unicef.R +++ b/R/theme_unicef.R @@ -163,7 +163,7 @@ set_unicef_font <- function(alt = paleta_fonts$paleta_noto) { #' by what UNICEF font is available in the system via `set_unicef_font()`. #' If none of the UNICEF fonts are available, the default becomes #' *Noto Sans*. -#' @param base_size Base font size. Default is 11.5. +#' @param base_size Base font size. Default is 5. #' @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 @@ -214,7 +214,7 @@ set_unicef_font <- function(alt = paleta_fonts$paleta_noto) { #' @export #' theme_unicef <- function(base_family = set_unicef_font(), - base_size = 11.5, + base_size = 5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, diff --git a/man/theme_unicef.Rd b/man/theme_unicef.Rd index dfee9f8..9acc366 100644 --- a/man/theme_unicef.Rd +++ b/man/theme_unicef.Rd @@ -6,7 +6,7 @@ \usage{ theme_unicef( base_family = set_unicef_font(), - base_size = 11.5, + base_size = 5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, @@ -28,7 +28,7 @@ by what UNICEF font is available in the system via \code{set_unicef_font()}. If none of the UNICEF fonts are available, the default becomes \emph{Noto Sans}.} -\item{base_size}{Base font size. Default is 11.5.} +\item{base_size}{Base font size. Default is 5.} \item{plot_title_family}{Font family to use for the plot title. Default is \code{base_family}.} diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 17aff66..7652bd3 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -3,11 +3,18 @@ ## Test get colours function ---- testthat::expect_type(get_colours(pattern = "Blue"), "character") testthat::expect_type(get_colours(pattern = "Blue", named = TRUE), "character") -testthat::expect_type(tint_colour(acdc_green, p = 0.2), "character") ## Test tint colours function ---- +testthat::expect_type(tint_colour(acdc_green, p = 0.2), "character") testthat::expect_type(tint_colours(c(acdc_green, acdc_gold), p = 0.2), "list") +testthat::expect_type(tint_colours(c(acdc_green, acdc_gold), p = 0.2, label = TRUE), "list") +testthat::expect_equal( + tint_colours(c(acdc_green, acdc_gold), p = 0.2, label = TRUE) |> + names() |> + length(), + 2 +) testthat::expect_type(tint_colours(c(acdc_green, acdc_gold), p = c(0.2, 0.4)), "list") testthat::expect_equal( tint_colours( @@ -23,6 +30,13 @@ testthat::expect_equal( ## Test shade colours function ---- testthat::expect_type(shade_colours(c(acdc_green, acdc_gold), p = 0.2), "list") testthat::expect_type(shade_colours(c(acdc_green, acdc_gold), p = c(0.2, 0.4)), "list") +testthat::expect_type(shade_colours(c(acdc_green, acdc_gold), p = 0.2, label = TRUE), "list") +testthat::expect_equal( + shade_colours(c(acdc_green, acdc_gold), p = 0.2, label = TRUE) |> + names() |> + length(), + 2 +) testthat::expect_equal( shade_colours( c(acdc_green, acdc_gold), diff --git a/vignettes/unicef.Rmd b/vignettes/unicef.Rmd index 11d8cb4..a38ca34 100644 --- a/vignettes/unicef.Rmd +++ b/vignettes/unicef.Rmd @@ -67,7 +67,7 @@ ggplot( subtitle = "UNICEF brights palette", x = "Engine Shape", y = "Counts" ) + - theme_unicef(base_size = 10) + theme_unicef() ``` ```{r unicef-theme-scatter, echo = FALSE, fig.align = "center", fig.height = 6, fig.width = 5} @@ -82,6 +82,6 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) + title = "UNICEF Theme", subtitle = "UNICEF brights palette", ) + - theme_unicef(base_size = 10) + theme_unicef() ```