From 4922a7d05898c3ab38e08c230263d77d6fd9d540 Mon Sep 17 00:00:00 2001 From: davidhodge931 Date: Thu, 20 Jun 2024 08:54:00 +1200 Subject: [PATCH] Fix #912 --- DESCRIPTION | 2 +- NAMESPACE | 3 - NEWS.md | 4 + R/dark_mode.R | 74 --- R/flex_mode.R | 86 --- R/grey_mode.R | 75 --- R/light_mode.R | 74 --- _pkgdown.yml | 3 - man/dark_mode_r.Rd | 35 -- man/flex_mode_n.Rd | 125 ---- man/grey_mode_r.Rd | 35 -- man/light_mode_r.Rd | 35 -- tests/testthat/_snaps/modes/light-mode-n.svg | 583 ------------------ .../_snaps/numeric-col/light-mode-n.svg | 439 ------------- .../testthat/_snaps/vignette-ggblanket/10.svg | 13 +- tests/testthat/test-modes.R | 19 - tests/testthat/test-numeric-col.R | 19 - tests/testthat/test-vignette-ggblanket.R | 22 +- vignettes/articles/1_go_further.Rmd | 4 +- vignettes/articles/2_extensions.Rmd | 24 +- vignettes/ggblanket.Rmd | 2 +- 21 files changed, 32 insertions(+), 1644 deletions(-) delete mode 100644 man/flex_mode_n.Rd delete mode 100644 tests/testthat/_snaps/modes/light-mode-n.svg delete mode 100644 tests/testthat/_snaps/numeric-col/light-mode-n.svg diff --git a/DESCRIPTION b/DESCRIPTION index 652f567e0..e12b7ba11 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ggblanket Title: Simplify 'ggplot2' Visualisation -Version: 9.1.1 +Version: 9.1.1.9000 Authors@R: person("David", "Hodge", , "davidhodge931@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-3868-7501")) diff --git a/NAMESPACE b/NAMESPACE index 122bc4f87..eb980d1bd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,7 +4,6 @@ export("%>%") export(aes_contrast) export(blue) export(dark_mode_b) -export(dark_mode_n) export(dark_mode_r) export(dark_mode_t) export(darkness) @@ -48,13 +47,11 @@ export(gg_tile) export(gg_violin) export(grey) export(grey_mode_b) -export(grey_mode_n) export(grey_mode_r) export(grey_mode_t) export(greyness) export(jumble) export(light_mode_b) -export(light_mode_n) export(light_mode_r) export(light_mode_t) export(lightness) diff --git a/NEWS.md b/NEWS.md index 9d0d30c14..c1a991d2c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# ggblanket 9.1.1.9000 + +* Remove `*_mode_n` variants. + # ggblanket 9.1.1 * Forced user argument naming for `set_blanket()`, `*_mode_*()` and `aes_contrast()`. diff --git a/R/dark_mode.R b/R/dark_mode.R index 61e9234c6..9f97607d2 100644 --- a/R/dark_mode.R +++ b/R/dark_mode.R @@ -5,7 +5,6 @@ #' * `dark_mode_r()` with legend on right #' * `dark_mode_t()` with legend on top #' * `dark_mode_b()` with legend on bottom -#' * `dark_mode_n()` with no legend #' #' @param ... Provided to force user argument naming etc. #' @param base_size The base size of the text theme element. Defaults to 11. @@ -63,14 +62,6 @@ #' mode = dark_mode_b() #' ) #' -#' penguins |> -#' gg_point( -#' x = flipper_length_mm, -#' y = body_mass_g, -#' col = species, -#' mode = dark_mode_n() -#' ) -#' dark_mode_r <- function ( ..., base_size = 11, @@ -263,68 +254,3 @@ dark_mode_b <- function ( legend_ticks_length = legend_ticks_length, orientation = orientation) } - -#' @rdname dark_mode_r -#' @export -dark_mode_n <- function ( - ..., - base_size = 11, - base_family = "", - base_colour = "#C8D7DFFF", - axis_line_colour = "#C8D7DFFF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size / 3, "pt"), - axis_ticks_length_y = grid::unit(base_size / 4, "pt"), - panel_grid_colour = "#00040AFF", - panel_grid_linewidth = 1.33, - panel_background_fill ="#050D1BFF", - plot_background_fill = "#00040AFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL) { - - flex_mode_n( - base_size = base_size, - base_family = base_family, - base_colour = base_colour, - base_face = "plain", - plot_title_size = ggplot2::rel(1.1), - plot_title_family = base_family, - plot_title_face = "bold", - plot_title_colour = base_colour, - plot_subtitle_size = ggplot2::rel(1), - plot_subtitle_family = base_family, - plot_subtitle_face = "plain", - plot_subtitle_colour = base_colour, - plot_caption_size = ggplot2::rel(0.85), - plot_caption_family = base_family, - plot_caption_face = "plain", - plot_caption_colour = colorspace::darken(base_colour, 0.1), - plot_caption_hjust = 0, - - axis_line_colour = axis_line_colour, - axis_line_linewidth = axis_line_linewidth, - axis_ticks_colour = axis_ticks_colour, - axis_ticks_linewidth = axis_ticks_linewidth, - axis_ticks_length_x = axis_ticks_length_x, - axis_ticks_length_y = axis_ticks_length_y, - panel_grid_colour = panel_grid_colour, - panel_grid_linewidth = panel_grid_linewidth, - panel_background_fill = panel_background_fill, - plot_background_fill = plot_background_fill, - legend_axis_line_colour = legend_axis_line_colour, - legend_axis_line_linewidth = legend_axis_line_linewidth, - legend_background_fill = legend_background_fill, - legend_key_fill = legend_key_fill, - legend_ticks_colour = legend_ticks_colour, - legend_ticks_linewidth = legend_ticks_linewidth, - legend_ticks_length = legend_ticks_length, - orientation = orientation) -} diff --git a/R/flex_mode.R b/R/flex_mode.R index 8769baac1..2aa258c7c 100644 --- a/R/flex_mode.R +++ b/R/flex_mode.R @@ -501,90 +501,4 @@ flex_mode_b <- function ( ) } -#' Flexible mode with no legend -#' -#' @description Flexible mode with no legend. -#' -#' @inheritParams flex_mode_r -#' -#' @return A ggplot theme. -#' @keywords internal -#' -flex_mode_n <- function ( - ..., - base_size = 11, - base_family = "", - base_face = "plain", - base_colour = "#121B24FF", - plot_title_size = ggplot2::rel(1.1), - plot_title_family = base_family, - plot_title_face = "bold", - plot_title_colour = base_colour, - plot_subtitle_size = ggplot2::rel(1), - plot_subtitle_family = base_family, - plot_subtitle_face = "plain", - plot_subtitle_colour = base_colour, - plot_caption_size = ggplot2::rel(0.85), - plot_caption_family = base_family, - plot_caption_face = "plain", - plot_caption_colour = colorspace::lighten(base_colour, 0.1), - plot_caption_hjust = 0, - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size / 3, "pt"), - axis_ticks_length_y = grid::unit(base_size / 4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill ="#FFFFFFFF", - plot_background_fill = "#FFFFFFFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL) { - - flex_mode_base( - base_size = base_size, - base_family = base_family, - base_face = "plain", - base_colour = base_colour, - plot_title_size = plot_title_size, - plot_title_family = plot_title_family, - plot_title_face = plot_title_face, - plot_title_colour = plot_title_colour, - plot_subtitle_size = plot_subtitle_size, - plot_subtitle_family = plot_subtitle_family, - plot_subtitle_face = plot_subtitle_face, - plot_subtitle_colour = plot_subtitle_colour, - plot_caption_size = plot_caption_size, - plot_caption_family = plot_caption_family, - plot_caption_face = plot_caption_face, - plot_caption_colour = plot_caption_colour, - plot_caption_hjust = plot_caption_hjust, - axis_line_colour = axis_line_colour, - axis_line_linewidth = axis_line_linewidth, - axis_ticks_colour = axis_ticks_colour, - axis_ticks_linewidth = axis_ticks_linewidth, - axis_ticks_length_x = axis_ticks_length_x, - axis_ticks_length_y = axis_ticks_length_y, - panel_grid_colour = panel_grid_colour, - panel_grid_linewidth = panel_grid_linewidth, - panel_background_fill = panel_background_fill, - plot_background_fill = plot_background_fill, - legend_axis_line_colour = legend_axis_line_colour, - legend_axis_line_linewidth = legend_axis_line_linewidth, - legend_background_fill = legend_background_fill, - legend_key_fill = legend_key_fill, - legend_ticks_colour = legend_ticks_colour, - legend_ticks_linewidth = legend_ticks_linewidth, - legend_ticks_length = legend_ticks_length, - orientation = orientation - ) + - ggplot2::theme(legend.position = "none") -} diff --git a/R/grey_mode.R b/R/grey_mode.R index 6e3619af8..b58781a90 100644 --- a/R/grey_mode.R +++ b/R/grey_mode.R @@ -5,7 +5,6 @@ #' * `grey_mode_r()` with legend on right #' * `grey_mode_t()` with legend on top #' * `grey_mode_b()` with legend on bottom -#' * `grey_mode_n()` with no legend #' #' @param ... Provided to force user argument naming etc. #' @param base_size The base size of the text theme element. Defaults to 11. @@ -63,14 +62,6 @@ #' mode = grey_mode_b() #' ) #' -#' penguins |> -#' gg_point( -#' x = flipper_length_mm, -#' y = body_mass_g, -#' col = species, -#' mode = grey_mode_n() -#' ) -#' grey_mode_r <- function ( ..., base_size = 11, @@ -263,69 +254,3 @@ grey_mode_b <- function ( legend_ticks_length = legend_ticks_length, orientation = orientation) } - -#' @rdname grey_mode_r -#' @export -grey_mode_n <- function ( - ..., - base_size = 11, - base_family = "", - base_colour = "#121B24FF", - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size / 3, "pt"), - axis_ticks_length_y = grid::unit(base_size / 4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill ="#FCFDFEFF", - plot_background_fill = "#F6F8FAFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL) { - - flex_mode_n( - base_size = base_size, - base_family = base_family, - base_colour = base_colour, - base_face = "plain", - plot_title_size = ggplot2::rel(1.1), - plot_title_family = base_family, - plot_title_face = "bold", - plot_title_colour = base_colour, - plot_subtitle_size = ggplot2::rel(1), - plot_subtitle_family = base_family, - plot_subtitle_face = "plain", - plot_subtitle_colour = base_colour, - plot_caption_size = ggplot2::rel(0.85), - plot_caption_family = base_family, - plot_caption_face = "plain", - plot_caption_colour = colorspace::lighten(base_colour, 0.1), - plot_caption_hjust = 0, - - axis_line_colour = axis_line_colour, - axis_line_linewidth = axis_line_linewidth, - axis_ticks_colour = axis_ticks_colour, - axis_ticks_linewidth = axis_ticks_linewidth, - axis_ticks_length_x = axis_ticks_length_x, - axis_ticks_length_y = axis_ticks_length_y, - panel_grid_colour = panel_grid_colour, - panel_grid_linewidth = panel_grid_linewidth, - panel_background_fill = panel_background_fill, - plot_background_fill = plot_background_fill, - legend_axis_line_colour = legend_axis_line_colour, - legend_axis_line_linewidth = legend_axis_line_linewidth, - legend_background_fill = legend_background_fill, - legend_key_fill = legend_key_fill, - legend_ticks_colour = legend_ticks_colour, - legend_ticks_linewidth = legend_ticks_linewidth, - legend_ticks_length = legend_ticks_length, - orientation = orientation - ) -} diff --git a/R/light_mode.R b/R/light_mode.R index 004d3d11d..0c17a4fbf 100644 --- a/R/light_mode.R +++ b/R/light_mode.R @@ -5,7 +5,6 @@ #' * `light_mode_r()` with legend on right #' * `light_mode_t()` with legend on top #' * `light_mode_b()` with legend on bottom -#' * `light_mode_n()` with no legend #' #' @param ... Provided to force user argument naming etc. #' @param base_size The base size of the text theme element. Defaults to 11. @@ -63,14 +62,6 @@ #' mode = light_mode_b() #' ) #' -#' penguins |> -#' gg_point( -#' x = flipper_length_mm, -#' y = body_mass_g, -#' col = species, -#' mode = light_mode_n() -#' ) -#' light_mode_r <- function ( ..., base_size = 11, @@ -266,68 +257,3 @@ light_mode_b <- function ( orientation = orientation) } -#' @rdname light_mode_r -#' @export -light_mode_n <- function ( - ..., - base_size = 11, - base_family = "", - base_colour = "#121B24FF", - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size / 3, "pt"), - axis_ticks_length_y = grid::unit(base_size / 4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill ="#FFFFFFFF", - plot_background_fill = "#FFFFFFFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL) { - - flex_mode_n( - base_size = base_size, - base_family = base_family, - base_colour = base_colour, - base_face = "plain", - plot_title_size = ggplot2::rel(1.1), - plot_title_family = base_family, - plot_title_face = "bold", - plot_title_colour = base_colour, - plot_subtitle_size = ggplot2::rel(1), - plot_subtitle_family = base_family, - plot_subtitle_face = "plain", - plot_subtitle_colour = base_colour, - plot_caption_size = ggplot2::rel(0.85), - plot_caption_family = base_family, - plot_caption_face = "plain", - plot_caption_colour = colorspace::lighten(base_colour, 0.1), - plot_caption_hjust = 0, - - axis_line_colour = axis_line_colour, - axis_line_linewidth = axis_line_linewidth, - axis_ticks_colour = axis_ticks_colour, - axis_ticks_linewidth = axis_ticks_linewidth, - axis_ticks_length_x = axis_ticks_length_x, - axis_ticks_length_y = axis_ticks_length_y, - panel_grid_colour = panel_grid_colour, - panel_grid_linewidth = panel_grid_linewidth, - panel_background_fill = panel_background_fill, - plot_background_fill = plot_background_fill, - legend_axis_line_colour = legend_axis_line_colour, - legend_axis_line_linewidth = legend_axis_line_linewidth, - legend_background_fill = legend_background_fill, - legend_key_fill = legend_key_fill, - legend_ticks_colour = legend_ticks_colour, - legend_ticks_linewidth = legend_ticks_linewidth, - legend_ticks_length = legend_ticks_length, - orientation = orientation - ) -} diff --git a/_pkgdown.yml b/_pkgdown.yml index 04a7e44de..9cc0c1fc1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -17,15 +17,12 @@ reference: - light_mode_r - light_mode_t - light_mode_b - - light_mode_n - grey_mode_r - grey_mode_t - grey_mode_b - - grey_mode_n - dark_mode_r - dark_mode_t - dark_mode_b - - dark_mode_n - title: Colour - contents: - blue diff --git a/man/dark_mode_r.Rd b/man/dark_mode_r.Rd index e393c3b7c..ff5d81b0e 100644 --- a/man/dark_mode_r.Rd +++ b/man/dark_mode_r.Rd @@ -4,7 +4,6 @@ \alias{dark_mode_r} \alias{dark_mode_t} \alias{dark_mode_b} -\alias{dark_mode_n} \title{Dark mode theme family} \usage{ dark_mode_r( @@ -81,31 +80,6 @@ dark_mode_b( legend_ticks_length = ggplot2::rel(c(0.175, 0)), orientation = NULL ) - -dark_mode_n( - ..., - base_size = 11, - base_family = "", - base_colour = "#C8D7DFFF", - axis_line_colour = "#C8D7DFFF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size/3, "pt"), - axis_ticks_length_y = grid::unit(base_size/4, "pt"), - panel_grid_colour = "#00040AFF", - panel_grid_linewidth = 1.33, - panel_background_fill = "#050D1BFF", - plot_background_fill = "#00040AFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL -) } \arguments{ \item{...}{Provided to force user argument naming etc.} @@ -161,7 +135,6 @@ A dark mode family of functions: \item \code{dark_mode_r()} with legend on right \item \code{dark_mode_t()} with legend on top \item \code{dark_mode_b()} with legend on bottom -\item \code{dark_mode_n()} with no legend } } \examples{ @@ -194,12 +167,4 @@ penguins |> mode = dark_mode_b() ) - penguins |> - gg_point( - x = flipper_length_mm, - y = body_mass_g, - col = species, - mode = dark_mode_n() - ) - } diff --git a/man/flex_mode_n.Rd b/man/flex_mode_n.Rd deleted file mode 100644 index a3caae8cc..000000000 --- a/man/flex_mode_n.Rd +++ /dev/null @@ -1,125 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/flex_mode.R -\name{flex_mode_n} -\alias{flex_mode_n} -\title{Flexible mode with no legend} -\usage{ -flex_mode_n( - ..., - base_size = 11, - base_family = "", - base_face = "plain", - base_colour = "#121B24FF", - plot_title_size = ggplot2::rel(1.1), - plot_title_family = base_family, - plot_title_face = "bold", - plot_title_colour = base_colour, - plot_subtitle_size = ggplot2::rel(1), - plot_subtitle_family = base_family, - plot_subtitle_face = "plain", - plot_subtitle_colour = base_colour, - plot_caption_size = ggplot2::rel(0.85), - plot_caption_family = base_family, - plot_caption_face = "plain", - plot_caption_colour = colorspace::lighten(base_colour, 0.1), - plot_caption_hjust = 0, - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size/3, "pt"), - axis_ticks_length_y = grid::unit(base_size/4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill = "#FFFFFFFF", - plot_background_fill = "#FFFFFFFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL -) -} -\arguments{ -\item{...}{Provided to force user argument naming etc.} - -\item{base_size}{The base size of the text theme element. Defaults to 11.} - -\item{base_family}{The base family of the text theme element. Defaults to "".} - -\item{base_face}{The base face of the text theme element. Defaults to "plain".} - -\item{base_colour}{The base colour of the text theme element.} - -\item{plot_title_size}{The size of the plot.title theme element.} - -\item{plot_title_family}{The family of the plot.title theme element.} - -\item{plot_title_face}{The face of the plot.title theme element.} - -\item{plot_title_colour}{The colour of the plot.title theme element.} - -\item{plot_subtitle_size}{The size of the plot.subtitle theme element.} - -\item{plot_subtitle_family}{The family of the plot.subtitle theme element.} - -\item{plot_subtitle_face}{The face of the plot.subtitle theme element.} - -\item{plot_subtitle_colour}{The colour of the plot.subtitle theme element.} - -\item{plot_caption_size}{The size of the plot.caption theme element.} - -\item{plot_caption_family}{The family of the plot.caption theme element.} - -\item{plot_caption_face}{The face of the plot.caption theme element.} - -\item{plot_caption_colour}{The colour of the plot.caption theme element.} - -\item{plot_caption_hjust}{The horizontal adjustment of the plot.caption theme element.} - -\item{axis_line_colour}{The colour of the axis.line theme element.} - -\item{axis_line_linewidth}{The linewidth of the axis.line theme element.} - -\item{axis_ticks_colour}{The colour of the axis.ticks theme element.} - -\item{axis_ticks_linewidth}{The linewidth of the axis.ticks theme element.} - -\item{axis_ticks_length_x}{The length of the axis.ticks.length.x theme element.} - -\item{axis_ticks_length_y}{The length of the axis.ticks.length.y theme element.} - -\item{panel_grid_colour}{The colour of the panel.grid theme element.} - -\item{panel_grid_linewidth}{The linewidth of the panel.grid theme element.} - -\item{panel_background_fill}{The fill (and colour) of the panel.background theme element.} - -\item{plot_background_fill}{The fill (and colour) of the plot.background theme element.} - -\item{legend_axis_line_colour}{The colour of the legend.axis.line theme element.} - -\item{legend_axis_line_linewidth}{The linewidth of the legend.axis.line theme element.} - -\item{legend_background_fill}{The fill (and colour) of the legend.background theme element.} - -\item{legend_key_fill}{The fill (and colour) of the legend.key theme element.} - -\item{legend_ticks_colour}{The colour of the legend.ticks theme element.} - -\item{legend_ticks_linewidth}{The linewidth of the legend.ticks theme element.} - -\item{legend_ticks_length}{The legend.ticks.length theme element.} - -\item{orientation}{The orientation of the plot. Either "x" or "y". Defaults to NULL. Not intended for use with the mode argument of gg_* functions.} -} -\value{ -A ggplot theme. -} -\description{ -Flexible mode with no legend. -} -\keyword{internal} diff --git a/man/grey_mode_r.Rd b/man/grey_mode_r.Rd index fae022336..1f30eeb7b 100644 --- a/man/grey_mode_r.Rd +++ b/man/grey_mode_r.Rd @@ -4,7 +4,6 @@ \alias{grey_mode_r} \alias{grey_mode_t} \alias{grey_mode_b} -\alias{grey_mode_n} \title{Grey mode theme family} \usage{ grey_mode_r( @@ -81,31 +80,6 @@ grey_mode_b( legend_ticks_length = ggplot2::rel(c(0.175, 0)), orientation = NULL ) - -grey_mode_n( - ..., - base_size = 11, - base_family = "", - base_colour = "#121B24FF", - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size/3, "pt"), - axis_ticks_length_y = grid::unit(base_size/4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill = "#FCFDFEFF", - plot_background_fill = "#F6F8FAFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL -) } \arguments{ \item{...}{Provided to force user argument naming etc.} @@ -161,7 +135,6 @@ A grey mode family of functions: \item \code{grey_mode_r()} with legend on right \item \code{grey_mode_t()} with legend on top \item \code{grey_mode_b()} with legend on bottom -\item \code{grey_mode_n()} with no legend } } \examples{ @@ -194,12 +167,4 @@ penguins |> mode = grey_mode_b() ) -penguins |> - gg_point( - x = flipper_length_mm, - y = body_mass_g, - col = species, - mode = grey_mode_n() - ) - } diff --git a/man/light_mode_r.Rd b/man/light_mode_r.Rd index ac93a9769..392b554c1 100644 --- a/man/light_mode_r.Rd +++ b/man/light_mode_r.Rd @@ -4,7 +4,6 @@ \alias{light_mode_r} \alias{light_mode_t} \alias{light_mode_b} -\alias{light_mode_n} \title{Light mode theme family} \usage{ light_mode_r( @@ -81,31 +80,6 @@ light_mode_b( legend_ticks_length = ggplot2::rel(c(0.175, 0)), orientation = NULL ) - -light_mode_n( - ..., - base_size = 11, - base_family = "", - base_colour = "#121B24FF", - axis_line_colour = "#121B24FF", - axis_line_linewidth = 0.33, - axis_ticks_colour = axis_line_colour, - axis_ticks_linewidth = axis_line_linewidth, - axis_ticks_length_x = grid::unit(base_size/3, "pt"), - axis_ticks_length_y = grid::unit(base_size/4, "pt"), - panel_grid_colour = "#F6F8FAFF", - panel_grid_linewidth = 1.33, - panel_background_fill = "#FFFFFFFF", - plot_background_fill = "#FFFFFFFF", - legend_axis_line_colour = plot_background_fill, - legend_axis_line_linewidth = 0.33, - legend_background_fill = plot_background_fill, - legend_key_fill = plot_background_fill, - legend_ticks_colour = legend_axis_line_colour, - legend_ticks_linewidth = legend_axis_line_linewidth, - legend_ticks_length = ggplot2::rel(c(0.175, 0)), - orientation = NULL -) } \arguments{ \item{...}{Provided to force user argument naming etc.} @@ -161,7 +135,6 @@ A dark mode family of functions: \item \code{light_mode_r()} with legend on right \item \code{light_mode_t()} with legend on top \item \code{light_mode_b()} with legend on bottom -\item \code{light_mode_n()} with no legend } } \examples{ @@ -194,12 +167,4 @@ penguins |> mode = light_mode_b() ) -penguins |> - gg_point( - x = flipper_length_mm, - y = body_mass_g, - col = species, - mode = light_mode_n() - ) - } diff --git a/tests/testthat/_snaps/modes/light-mode-n.svg b/tests/testthat/_snaps/modes/light-mode-n.svg deleted file mode 100644 index 477a49e1c..000000000 --- a/tests/testthat/_snaps/modes/light-mode-n.svg +++ /dev/null @@ -1,583 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -female - - - - - - - - - - - - - - -male - - - - - - - - - - - - - - -NA - - - - - - - - - - - - - - -Biscoe - - - - - - - - - - - - - - -Dream - - - - - - - - - - - - - - -Torgersen - - - - - - - - - -170 -190 -210 -230 - - - - - -170 -190 -210 -230 - - - - - -170 -190 -210 -230 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -2,500 -3,500 -4,500 -5,500 -6,500 -2,500 -3,500 -4,500 -5,500 -6,500 -2,500 -3,500 -4,500 -5,500 -6,500 -Flipper length mm -Body mass g - - diff --git a/tests/testthat/_snaps/numeric-col/light-mode-n.svg b/tests/testthat/_snaps/numeric-col/light-mode-n.svg deleted file mode 100644 index c1cde312e..000000000 --- a/tests/testthat/_snaps/numeric-col/light-mode-n.svg +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -female - -male - -NA -170 -180 -190 -200 -210 -220 -230 -240 -170 -180 -190 -200 -210 -220 -230 -240 -170 -180 -190 -200 -210 -220 -230 -240 - - - - - - - - - -Torgersen -Dream -Biscoe - - - -Flipper length mm -Island - - diff --git a/tests/testthat/_snaps/vignette-ggblanket/10.svg b/tests/testthat/_snaps/vignette-ggblanket/10.svg index 4d5cb1afa..70aae808f 100644 --- a/tests/testthat/_snaps/vignette-ggblanket/10.svg +++ b/tests/testthat/_snaps/vignette-ggblanket/10.svg @@ -71,7 +71,7 @@ Treatment Response -mode = light_mode_n(), +mode = light_mode_r(), @@ -89,8 +89,6 @@ - - @@ -103,19 +101,12 @@ - 0.5 1.5 2.5 3.5 4.5 5.5 - - - - - - @@ -124,7 +115,7 @@ Treatment Response -+ light_mode_n() ++ light_mode_r() 10 diff --git a/tests/testthat/test-modes.R b/tests/testthat/test-modes.R index 3695fa585..97aa1e501 100644 --- a/tests/testthat/test-modes.R +++ b/tests/testthat/test-modes.R @@ -63,25 +63,6 @@ test_that(test_name, { vdiffr::expect_doppelganger(test_name, p) }) -test_name <- "light_mode_n" - -test_that(test_name, { - - p <- penguins |> - gg_point( - x = flipper_length_mm, - y = body_mass_g, - col = species, - facet = sex, - facet2 = island, - mapping = aes(alpha = species, shape = species), - mode = light_mode_n() - ) + - scale_alpha_manual(values = c(1, 1, 0.33)) - - vdiffr::expect_doppelganger(test_name, p) -}) - ### test_name <- "grey_mode_r" diff --git a/tests/testthat/test-numeric-col.R b/tests/testthat/test-numeric-col.R index 891141273..b19c9f8dd 100644 --- a/tests/testthat/test-numeric-col.R +++ b/tests/testthat/test-numeric-col.R @@ -62,23 +62,4 @@ test_that(test_name, { vdiffr::expect_doppelganger(test_name, p) }) -test_name <- "light_mode_n" - -test_that(test_name, { - set.seed(123) - - p <- penguins |> - gg_point( - x = flipper_length_mm, - y = island, - col = bill_depth_mm, - facet = sex, - mapping = aes(alpha = species, shape = species), - mode = light_mode_n() - ) + - scale_alpha_manual(values = c(1, 1, 0.33)) - - vdiffr::expect_doppelganger(test_name, p) -}) - set_blanket() diff --git a/tests/testthat/test-vignette-ggblanket.R b/tests/testthat/test-vignette-ggblanket.R index e8dff625f..42eb95ad9 100644 --- a/tests/testthat/test-vignette-ggblanket.R +++ b/tests/testthat/test-vignette-ggblanket.R @@ -179,9 +179,9 @@ test_that(test_name, { width = 0.1, x_label = "Treatment", y_label = "Response", - mode = light_mode_n(), - subtitle = "\nmode = light_mode_n()," - ) + subtitle = "\nmode = light_mode_r()," + ) + + theme(legend.position = "none") p2 <- d |> gg_errorbar( @@ -192,9 +192,9 @@ test_that(test_name, { width = 0.1, x_label = "Treatment", y_label = "Response", - subtitle = "\n+ light_mode_n()" + subtitle = "\n+ light_mode_r()" ) + - light_mode_n() + theme(legend.position = "none") p <- p1 + p2 @@ -282,9 +282,9 @@ test_that(test_name, { width = 0.1, x_label = "Treatment", y_label = "Response", - mode = light_mode_n(), subtitle = "\nDefault y scale" - ) + ) + + theme(legend.position = "none") p2 <- d |> gg_errorbar( @@ -296,9 +296,9 @@ test_that(test_name, { x_label = "Treatment", y_label = "Response", y_limits = c(NA, NA), - mode = light_mode_n(), subtitle = "\ny_limits = c(NA, NA)," - ) + ) + + theme(legend.position = "none") p3 <- d |> gg_col( @@ -310,9 +310,9 @@ test_that(test_name, { x_label = "Treatment upper", y_label = "Response", y_limits = c(0, NA), - mode = light_mode_n(), subtitle = "\ny_limits = c(0, NA)," - ) + ) + + theme(legend.position = "none") p <- p1 + p2 + p3 diff --git a/vignettes/articles/1_go_further.Rmd b/vignettes/articles/1_go_further.Rmd index 3152acfc2..d5e3ea137 100644 --- a/vignettes/articles/1_go_further.Rmd +++ b/vignettes/articles/1_go_further.Rmd @@ -98,8 +98,8 @@ penguins2 |> x = sex, y = flipper_length_mm, col = sex, - mode = light_mode_n(), - ) + ) + + theme(legend.position = "none") ``` ### 3. Use `+ *_mode_*` where axis-lines and gridlines are not as wanted diff --git a/vignettes/articles/2_extensions.Rmd b/vignettes/articles/2_extensions.Rmd index 425a89b15..afb00f72d 100644 --- a/vignettes/articles/2_extensions.Rmd +++ b/vignettes/articles/2_extensions.Rmd @@ -99,8 +99,8 @@ penguins2 |> col = species, title = "**{.#0095a8ff Adelie}**, **{.#ffa600ff Chinstrap}**, *and* **{.#003f5cff Gentoo}** penguin species", - mode = light_mode_n() ) + + theme(legend.position = "none") + theme(plot.title = marquee::element_marquee()) ``` @@ -231,8 +231,8 @@ p1 <- penguins2 |> col = sex, x_labels = \(x) str_to_upper(str_sub(x, 1, 1)), subtitle = "\nBeeswarm", - mode = light_mode_n(), - ) + ) + + theme(legend.position = "none") p2 <- penguins2 |> gg_point( @@ -242,8 +242,8 @@ p2 <- penguins2 |> col = sex, x_labels = \(x) str_to_upper(str_sub(x, 1, 1)), subtitle = "\nQuasirandom", - mode = light_mode_n(), - ) + ) + + theme(legend.position = "none") p1 + p2 ``` @@ -303,11 +303,11 @@ data.frame( fill = blue, alpha = 0.6, y_expand = c(0.05, 0.05), - mode = light_mode_n(), # show_slab = FALSE, # show_interval = FALSE, # side = "both", - ) + ) + + theme(legend.position = "none") ``` ```{r} @@ -415,8 +415,8 @@ p1 <- penguins2 |> col = species, col_palette = paletteer_d("RColorBrewer::Dark2"), x_breaks = breaks_extended(n = 4), - mode = light_mode_n(), - ) + ) + + theme(legend.position = "none") p2 <- penguins2 |> gg_point( @@ -425,8 +425,8 @@ p2 <- penguins2 |> col = bill_depth_mm, col_palette = paletteer_c("viridis::rocket", 9), x_breaks = breaks_extended(n = 4), - mode = light_mode_n(), - ) + ) + + theme(legend.position = "none") p1 + p2 ``` @@ -442,7 +442,6 @@ p1 <- penguins2 |> x = flipper_length_mm, col = species, y_limits = c(0, NA), - mode = light_mode_n(), ) + facet_wrap(~"Normal") + ggeasy::easy_remove_x_axis() + @@ -454,7 +453,6 @@ p2 <- penguins2 |> x = flipper_length_mm, col = species, y_limits = c(0, NA), - mode = light_mode_n(), ) + facet_wrap(~"Blended") + geom_density(alpha = 0.6) |> ggblend::blend(blend = "multiply") + diff --git a/vignettes/ggblanket.Rmd b/vignettes/ggblanket.Rmd index e4a29de36..6e4ccac2d 100644 --- a/vignettes/ggblanket.Rmd +++ b/vignettes/ggblanket.Rmd @@ -234,7 +234,7 @@ penguins2 |> ### 10. Families of `*_mode_*` themes with legend variants -`light_mode_*`, `grey_mode_*` and `dark_mode_*` theme families are provided with variants that differ based on legend placement with suffix `r` (right), `b` (bottom), `t` (top) and `n` (none). +`light_mode_*`, `grey_mode_*` and `dark_mode_*` theme families are provided with variants that differ based on legend placement with suffix `r` (right), `b` (bottom), and `t` (top). These themes were built for use with the `mode` argument.