From 140a0a69edf5a370dafdbaf765a21705acccf924 Mon Sep 17 00:00:00 2001 From: davidhodge931 Date: Mon, 9 Dec 2024 16:37:58 +1300 Subject: [PATCH] Update --- NEWS.md | 2 +- R/gg_boxplot.R | 1 + R/gg_crossbar.R | 25 ++++++++++--------- R/weave.R | 4 +-- man/gg_boxplot.Rd | 1 + man/gg_crossbar.Rd | 1 + .../_snaps/article-demo-light/gg-boxplot.svg | 18 ++++++------- .../_snaps/article-demo-light/gg-crossbar.svg | 12 ++++----- vignettes/articles/1_demo_light.Rmd | 2 ++ vignettes/articles/2_demo_dark.Rmd | 2 ++ 10 files changed, 38 insertions(+), 30 deletions(-) diff --git a/NEWS.md b/NEWS.md index 139d81af9..f6c3bbd3c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ * Added R 4.2.0 dependency. * Removed `aes_colour_darken`, `aes_colour_lighten`, `aes_fill_darken` and `aes_colour_lighten`. -* Removed `gg_ribbon` alpha default, and changed `gg_smooth` to NA. +* Removed `gg_ribbon`, `gg_boxplot`, `gg_crossbar` and `gg_smooth` alpha default to `NA`. * Added colour blending (e.g. `blend = "multiply`). * Added `gg_lineribbon`. * Updated `*_mode_*` themes to default to `axis_line_linewidth = 0.25`. diff --git a/R/gg_boxplot.R b/R/gg_boxplot.R index 83e41f3b8..3377dd2cd 100644 --- a/R/gg_boxplot.R +++ b/R/gg_boxplot.R @@ -19,6 +19,7 @@ #' x = flipper_length_mm, #' y = species, #' col = sex, +#' blend = "multiply", #' ) #' gg_boxplot <- function(data = NULL, diff --git a/R/gg_crossbar.R b/R/gg_crossbar.R index da43bc205..09b6dd652 100644 --- a/R/gg_crossbar.R +++ b/R/gg_crossbar.R @@ -29,6 +29,7 @@ #' width = 0.5, #' x_label = "Treatment", #' y_label = "Response", +#' blend = "multiply", #' ) #' gg_crossbar <- function(data = NULL, @@ -55,14 +56,14 @@ gg_crossbar <- function(data = NULL, text = NULL, sample = NULL, mapping = NULL, - x_breaks = NULL, x_breaks_n = NULL, + x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, - x_label = NULL, x_labels = NULL, - - - x_position = "bottom", - + x_label = NULL, x_labels = NULL, + + + x_position = "bottom", + x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, @@ -70,8 +71,8 @@ gg_crossbar <- function(data = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), - y_symmetric = NULL, - + y_symmetric = NULL, + y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, @@ -80,13 +81,13 @@ gg_crossbar <- function(data = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, - - + + col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, - + col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", @@ -152,7 +153,7 @@ gg_crossbar <- function(data = NULL, col_legend_nrow = col_legend_nrow, col_legend_rev = col_legend_rev, col_breaks_n = col_breaks_n, - + col_palette = col_palette, col_palette_na = col_palette_na, col_rescale = col_rescale, diff --git a/R/weave.R b/R/weave.R index e9f08f3b5..dfc2821fe 100644 --- a/R/weave.R +++ b/R/weave.R @@ -50,10 +50,10 @@ weave_geom_defaults <- function( #polygons ggplot2::update_geom_defaults("area", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) ggplot2::update_geom_defaults("bar", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) - ggplot2::update_geom_defaults("boxplot", ggplot2::aes(colour = !!colour, fill = !!fill, alpha = 0, linewidth = 0.66)) + ggplot2::update_geom_defaults("boxplot", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0.66)) ggplot2::update_geom_defaults("col", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) ggplot2::update_geom_defaults("contour_filled", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) - ggplot2::update_geom_defaults("crossbar", ggplot2::aes(colour = !!colour, fill = !!fill, alpha = 0, linewidth = 0.66)) + ggplot2::update_geom_defaults("crossbar", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0.66)) ggplot2::update_geom_defaults("density", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) ggplot2::update_geom_defaults("density_2d_filled", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) ggplot2::update_geom_defaults("polygon", ggplot2::aes(colour = !!colour, fill = !!fill, linewidth = 0)) diff --git a/man/gg_boxplot.Rd b/man/gg_boxplot.Rd index 4a5f1f403..84a5999f0 100644 --- a/man/gg_boxplot.Rd +++ b/man/gg_boxplot.Rd @@ -173,6 +173,7 @@ penguins |> x = flipper_length_mm, y = species, col = sex, + blend = "multiply", ) } diff --git a/man/gg_crossbar.Rd b/man/gg_crossbar.Rd index 817fe0ea9..6800fd3c2 100644 --- a/man/gg_crossbar.Rd +++ b/man/gg_crossbar.Rd @@ -183,6 +183,7 @@ data.frame( width = 0.5, x_label = "Treatment", y_label = "Response", + blend = "multiply", ) } diff --git a/tests/testthat/_snaps/article-demo-light/gg-boxplot.svg b/tests/testthat/_snaps/article-demo-light/gg-boxplot.svg index 90b0ec6b8..d8dc6d904 100644 --- a/tests/testthat/_snaps/article-demo-light/gg-boxplot.svg +++ b/tests/testthat/_snaps/article-demo-light/gg-boxplot.svg @@ -32,31 +32,31 @@ - + - + - + - + - + - + Male @@ -87,17 +87,17 @@ - + - + - + Adelie Chinstrap diff --git a/tests/testthat/_snaps/article-demo-light/gg-crossbar.svg b/tests/testthat/_snaps/article-demo-light/gg-crossbar.svg index 57c30c62c..702c9467c 100644 --- a/tests/testthat/_snaps/article-demo-light/gg-crossbar.svg +++ b/tests/testthat/_snaps/article-demo-light/gg-crossbar.svg @@ -28,10 +28,10 @@ - - - - + + + + @@ -59,10 +59,10 @@ Group - + - + 1 2 diff --git a/vignettes/articles/1_demo_light.Rmd b/vignettes/articles/1_demo_light.Rmd index b4de0de3d..2f366290a 100644 --- a/vignettes/articles/1_demo_light.Rmd +++ b/vignettes/articles/1_demo_light.Rmd @@ -92,6 +92,7 @@ penguins2 |> x = flipper_length_mm, y = sex, col = species, + blend = "multiply", ) ``` @@ -146,6 +147,7 @@ experiment |> col = group, width = 0.5, y_expand_limits = 0, + blend = "multiply", ) ``` diff --git a/vignettes/articles/2_demo_dark.Rmd b/vignettes/articles/2_demo_dark.Rmd index 74e1470c2..71d4963e5 100644 --- a/vignettes/articles/2_demo_dark.Rmd +++ b/vignettes/articles/2_demo_dark.Rmd @@ -99,6 +99,7 @@ penguins2 |> x = flipper_length_mm, y = sex, col = species, + blend = "multiply", ) ``` @@ -153,6 +154,7 @@ experiment |> col = group, width = 0.5, y_expand_limits = 0, + blend = "multiply", ) ```