Skip to content

Commit

Permalink
Fix #912
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Jun 19, 2024
1 parent 2bd377f commit 4922a7d
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 1,644 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ggblanket
Title: Simplify 'ggplot2' Visualisation
Version: 9.1.1
Version: 9.1.1.9000
Authors@R:
person("David", "Hodge", , "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0002-3868-7501"))
Expand Down
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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()`.
Expand Down
74 changes: 0 additions & 74 deletions R/dark_mode.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
86 changes: 0 additions & 86 deletions R/flex_mode.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

75 changes: 0 additions & 75 deletions R/grey_mode.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
)
}
Loading

0 comments on commit 4922a7d

Please sign in to comment.