Skip to content

Commit

Permalink
Fix #930
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Jul 1, 2024
1 parent d10699d commit 9f55f3f
Show file tree
Hide file tree
Showing 80 changed files with 411 additions and 411 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Breaking: removed `*_mode_n` and `grey_mode_*` functions.
* Breaking: removed `*_orientation` arguments.
* Breaking: removed `greyness` helper.
* Added `*_n_breaks` and `*_sec_axis` arguments.
* Added `*_breaks_n` and `*_sec_axis` arguments.
* Added `*_symmetric` arguments.

# ggblanket 9.1.1
Expand Down
12 changes: 6 additions & 6 deletions R/gg_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ gg_area <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -57,7 +57,7 @@ gg_area <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -69,7 +69,7 @@ gg_area <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -119,7 +119,7 @@ gg_area <- function(data = NULL,
x_expand = x_expand,
x_expand_limits = x_expand_limits,
x_labels = x_labels,
x_n_breaks = x_n_breaks,
x_breaks_n = x_breaks_n,
x_sec_axis = x_sec_axis,
x_symmetric = x_symmetric, x_position = x_position,
x_label = x_label,
Expand All @@ -128,7 +128,7 @@ gg_area <- function(data = NULL,
y_expand = y_expand,
y_expand_limits = y_expand_limits,
y_labels = y_labels,
y_n_breaks = y_n_breaks,
y_breaks_n = y_breaks_n,
y_sec_axis = y_sec_axis,
y_symmetric = y_symmetric, y_position = y_position,
y_label = y_label,
Expand All @@ -140,7 +140,7 @@ gg_area <- function(data = NULL,
col_legend_ncol = col_legend_ncol,
col_legend_nrow = col_legend_nrow,
col_legend_rev = col_legend_rev,
col_n_breaks = col_n_breaks,
col_breaks_n = col_breaks_n,

col_palette = col_palette,
col_palette_na = col_palette_na,
Expand Down
12 changes: 6 additions & 6 deletions R/gg_bar.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ gg_bar <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -61,7 +61,7 @@ gg_bar <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -73,7 +73,7 @@ gg_bar <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -123,7 +123,7 @@ gg_bar <- function(data = NULL,
x_expand = x_expand,
x_expand_limits = x_expand_limits,
x_labels = x_labels,
x_n_breaks = x_n_breaks,
x_breaks_n = x_breaks_n,
x_sec_axis = x_sec_axis,
x_symmetric = x_symmetric, x_position = x_position,
x_label = x_label,
Expand All @@ -132,7 +132,7 @@ gg_bar <- function(data = NULL,
y_expand = y_expand,
y_expand_limits = y_expand_limits,
y_labels = y_labels,
y_n_breaks = y_n_breaks,
y_breaks_n = y_breaks_n,
y_sec_axis = y_sec_axis,
y_symmetric = y_symmetric, y_position = y_position,
y_label = y_label,
Expand All @@ -144,7 +144,7 @@ gg_bar <- function(data = NULL,
col_legend_ncol = col_legend_ncol,
col_legend_nrow = col_legend_nrow,
col_legend_rev = col_legend_rev,
col_n_breaks = col_n_breaks,
col_breaks_n = col_breaks_n,

col_palette = col_palette,
col_palette_na = col_palette_na,
Expand Down
12 changes: 6 additions & 6 deletions R/gg_bin_2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ gg_bin_2d <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -56,7 +56,7 @@ gg_bin_2d <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -68,7 +68,7 @@ gg_bin_2d <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -118,7 +118,7 @@ gg_bin_2d <- function(data = NULL,
x_expand = x_expand,
x_expand_limits = x_expand_limits,
x_labels = x_labels,
x_n_breaks = x_n_breaks,
x_breaks_n = x_breaks_n,
x_sec_axis = x_sec_axis,
x_symmetric = x_symmetric, x_position = x_position,
x_label = x_label,
Expand All @@ -127,7 +127,7 @@ gg_bin_2d <- function(data = NULL,
y_expand = y_expand,
y_expand_limits = y_expand_limits,
y_labels = y_labels,
y_n_breaks = y_n_breaks,
y_breaks_n = y_breaks_n,
y_sec_axis = y_sec_axis,
y_symmetric = y_symmetric, y_position = y_position,
y_label = y_label,
Expand All @@ -139,7 +139,7 @@ gg_bin_2d <- function(data = NULL,
col_legend_ncol = col_legend_ncol,
col_legend_nrow = col_legend_nrow,
col_legend_rev = col_legend_rev,
col_n_breaks = col_n_breaks,
col_breaks_n = col_breaks_n,

col_palette = col_palette,
col_palette_na = col_palette_na,
Expand Down
40 changes: 20 additions & 20 deletions R/gg_blanket.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @param x,xmin,xmax,xend,y,ymin,ymax,yend,z,col,facet,facet2,group,subgroup,label,text,sample An unquoted aesthetic variable.
#' @param mapping A set of additional aesthetic mappings in [ggplot2::aes()]. Intended primarily for non-supported aesthetics (e.g. `shape`, `linetype`, `linewidth`, or `size`), but can also be used for delayed evaluation etc.
#' @param x_breaks,y_breaks,col_breaks A `scales::breaks_*` function (e.g. `scales::breaks_*()`), or a vector of breaks.
#' @param x_n_breaks,y_n_breaks,col_n_breaks A number of desired breaks for when `*_breaks = NULL`.
#' @param x_breaks_n,y_breaks_n,col_breaks_n A number of desired breaks for when `*_breaks = NULL`.
#' @param x_expand,y_expand Padding to the limits with the [ggplot2::expansion()] function, or a vector of length 2 (e.g. `c(0, 0)`).
#' @param x_expand_limits,y_expand_limits,col_expand_limits For a continuous variable, any values that the limits should encompass (e.g. `0`). For a discrete scale, manipulate the data instead with `forcats::fct_expand`.
#' @param x_label,y_label,col_label Label for the axis or legend title. Use `+ ggplot2::labs(... = NULL)` for no title.
Expand Down Expand Up @@ -90,7 +90,7 @@ gg_blanket <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -99,7 +99,7 @@ gg_blanket <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -111,7 +111,7 @@ gg_blanket <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -670,10 +670,10 @@ gg_blanket <- function(data = NULL,

if (rlang::is_null(col_breaks)) {
if (any(col_transform %in% c("hms", "time", "datetime", "date"))) {
col_breaks <- scales::breaks_pretty(n = col_n_breaks)
col_breaks <- scales::breaks_pretty(n = col_breaks_n)
}
else {
col_breaks <- scales::breaks_extended(n = col_n_breaks, only.loose = FALSE)
col_breaks <- scales::breaks_extended(n = col_breaks_n, only.loose = FALSE)
}
}

Expand Down Expand Up @@ -1053,11 +1053,11 @@ gg_blanket <- function(data = NULL,
if (rlang::is_null(x_labels)) x_labels <- ggplot2::waiver()
}

if (rlang::is_null(x_n_breaks)) {
if (facet_ncols == 1) x_n_breaks <- 6
else if (facet_ncols == 2) x_n_breaks <- 5
else if (facet_ncols == 3) x_n_breaks <- 4
else x_n_breaks <- 3
if (rlang::is_null(x_breaks_n)) {
if (facet_ncols == 1) x_breaks_n <- 6
else if (facet_ncols == 2) x_breaks_n <- 5
else if (facet_ncols == 3) x_breaks_n <- 4
else x_breaks_n <- 3
}

if (x_symmetric) {
Expand All @@ -1072,7 +1072,7 @@ gg_blanket <- function(data = NULL,
x = x,
symmetric = TRUE,
breaks = x_breaks,
n_breaks = x_n_breaks,
breaks_n = x_breaks_n,
expand = x_expand,
expand_limits = x_expand_limits,
labels = x_labels,
Expand All @@ -1086,7 +1086,7 @@ gg_blanket <- function(data = NULL,
scale_x_symmetric(
symmetric = FALSE,
breaks = x_breaks,
n_breaks = x_n_breaks,
breaks_n = x_breaks_n,
expand = x_expand,
expand_limits = x_expand_limits,
labels = x_labels,
Expand Down Expand Up @@ -1118,11 +1118,11 @@ gg_blanket <- function(data = NULL,
if (rlang::is_null(y_labels)) y_labels <- ggplot2::waiver()
}

if (rlang::is_null(y_n_breaks)) {
if (facet_nrows == 1) y_n_breaks <- 6
else if (facet_nrows == 2) y_n_breaks <- 5
else if (facet_nrows == 3) y_n_breaks <- 4
else y_n_breaks <- 3
if (rlang::is_null(y_breaks_n)) {
if (facet_nrows == 1) y_breaks_n <- 6
else if (facet_nrows == 2) y_breaks_n <- 5
else if (facet_nrows == 3) y_breaks_n <- 4
else y_breaks_n <- 3
}

if (y_symmetric) {
Expand All @@ -1137,7 +1137,7 @@ gg_blanket <- function(data = NULL,
y = y,
symmetric = TRUE,
breaks = y_breaks,
n_breaks = y_n_breaks,
breaks_n = y_breaks_n,
expand = y_expand,
expand_limits = y_expand_limits,
labels = y_labels,
Expand All @@ -1151,7 +1151,7 @@ gg_blanket <- function(data = NULL,
scale_y_symmetric(
symmetric = FALSE,
breaks = y_breaks,
n_breaks = y_n_breaks,
breaks_n = y_breaks_n,
expand = y_expand,
expand_limits = y_expand_limits,
labels = y_labels,
Expand Down
12 changes: 6 additions & 6 deletions R/gg_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ gg_boxplot <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -61,7 +61,7 @@ gg_boxplot <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -73,7 +73,7 @@ gg_boxplot <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -123,7 +123,7 @@ gg_boxplot <- function(data = NULL,
x_expand = x_expand,
x_expand_limits = x_expand_limits,
x_labels = x_labels,
x_n_breaks = x_n_breaks,
x_breaks_n = x_breaks_n,
x_sec_axis = x_sec_axis,
x_symmetric = x_symmetric, x_position = x_position,
x_label = x_label,
Expand All @@ -132,7 +132,7 @@ gg_boxplot <- function(data = NULL,
y_expand = y_expand,
y_expand_limits = y_expand_limits,
y_labels = y_labels,
y_n_breaks = y_n_breaks,
y_breaks_n = y_breaks_n,
y_sec_axis = y_sec_axis,
y_symmetric = y_symmetric, y_position = y_position,
y_label = y_label,
Expand All @@ -144,7 +144,7 @@ gg_boxplot <- function(data = NULL,
col_legend_ncol = col_legend_ncol,
col_legend_nrow = col_legend_nrow,
col_legend_rev = col_legend_rev,
col_n_breaks = col_n_breaks,
col_breaks_n = col_breaks_n,

col_palette = col_palette,
col_palette_na = col_palette_na,
Expand Down
12 changes: 6 additions & 6 deletions R/gg_col.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ gg_col <- function(data = NULL,
x_expand = NULL,
x_expand_limits = NULL,
x_labels = NULL,
x_n_breaks = NULL,
x_breaks_n = NULL,
x_sec_axis = ggplot2::waiver(),
x_symmetric = NULL, x_position = "bottom",
x_label = NULL,
Expand All @@ -64,7 +64,7 @@ gg_col <- function(data = NULL,
y_expand = NULL,
y_expand_limits = NULL,
y_labels = NULL,
y_n_breaks = NULL,
y_breaks_n = NULL,
y_sec_axis = ggplot2::waiver(),
y_symmetric = NULL, y_position = "left",
y_label = NULL,
Expand All @@ -76,7 +76,7 @@ gg_col <- function(data = NULL,
col_legend_ncol = NULL,
col_legend_nrow = NULL,
col_legend_rev = FALSE,
col_n_breaks = 5,
col_breaks_n = 5,

col_palette = NULL,
col_palette_na = NULL,
Expand Down Expand Up @@ -126,7 +126,7 @@ gg_col <- function(data = NULL,
x_expand = x_expand,
x_expand_limits = x_expand_limits,
x_labels = x_labels,
x_n_breaks = x_n_breaks,
x_breaks_n = x_breaks_n,
x_sec_axis = x_sec_axis,
x_symmetric = x_symmetric, x_position = x_position,
x_label = x_label,
Expand All @@ -135,7 +135,7 @@ gg_col <- function(data = NULL,
y_expand = y_expand,
y_expand_limits = y_expand_limits,
y_labels = y_labels,
y_n_breaks = y_n_breaks,
y_breaks_n = y_breaks_n,
y_sec_axis = y_sec_axis,
y_symmetric = y_symmetric, y_position = y_position,
y_label = y_label,
Expand All @@ -147,7 +147,7 @@ gg_col <- function(data = NULL,
col_legend_ncol = col_legend_ncol,
col_legend_nrow = col_legend_nrow,
col_legend_rev = col_legend_rev,
col_n_breaks = col_n_breaks,
col_breaks_n = col_breaks_n,

col_palette = col_palette,
col_palette_na = col_palette_na,
Expand Down
Loading

0 comments on commit 9f55f3f

Please sign in to comment.