Skip to content

Commit

Permalink
Fix #525
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Nov 8, 2023
1 parent b5d30f2 commit 57c0884
Show file tree
Hide file tree
Showing 44 changed files with 80 additions and 86 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ggblanket 5.1.0900

* Updated colours: `"steelblue"` where no col aesthetic, `guardian` where discrete and less than 5 colours, scales:hue_pal otherwise, `viridis::mako` reversed for continuous, and `"grey"` for NA.
* Updated colours: `"steelblue4"` where no col aesthetic, `guardian` where discrete and 4 or less colours, scales:hue_pal for 5 or more colours, `viridis::mako` reversed for continuous, and `"grey"` for NA.
* Breaking: removed all `pal_*` functions.
* Removed some unnecessary messages.
* Fixed bug where `col_breaks` was not working for a numeric `col`.
Expand Down
2 changes: 1 addition & 1 deletion R/gg_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ gg_area <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_bar.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_bar <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_bin_2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ gg_bin_2d <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_blank.R
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ gg_blank <- function(
}

if (!col_scale) {
# if (rlang::is_null(pal)) pal <- "#4682b4"
# if (rlang::is_null(pal)) pal <- "#36648b"
# else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_boxplot <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_col.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ gg_col <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_contour.R
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ gg_contour <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_contour_filled.R
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ gg_contour_filled <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_crossbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ gg_crossbar <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ gg_density <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_density_2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ gg_density_2d <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_density_2d_filled.R
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ gg_density_2d_filled <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_errorbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ gg_errorbar <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_freqpoly.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_freqpoly <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_hex.R
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ gg_hex <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_histogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ gg_histogram <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_jitter.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_jitter <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
4 changes: 2 additions & 2 deletions R/gg_label.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
#' label = model,
#' size = 3.53,
#' y_include = c(min(.$mpg) * 0.95, max(.$mpg) * 1.05),
#' pal = c("firebrick", "white", "steelblue"),
#' pal = c(guardian()[2], "white", "#36648b"),
#' y_title = "Miles per gallon"
#' )
#'
Expand Down Expand Up @@ -430,7 +430,7 @@ gg_label <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_line.R
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ gg_line <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_linerange.R
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ gg_linerange <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_path <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_point.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_point <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_pointrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ gg_pointrange <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_polygon.R
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ gg_polygon <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_qq.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ gg_qq <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ gg_raster <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_rect.R
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ gg_rect <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
6 changes: 3 additions & 3 deletions R/gg_ribbon.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
#' x = year,
#' ymin = level_min,
#' ymax = level_max,
#' pal = scales::alpha("#1B9E77", 0),
#' pal = scales::alpha("steelblue4", 0),
#' y_title = "Level"
#' ) +
#' geom_line(aes(x = year, y = level), col = "#1B9E77")
#' geom_line(aes(x = year, y = level), col = "steelblue4")
#'
gg_ribbon <- function(
data = NULL,
Expand Down Expand Up @@ -496,7 +496,7 @@ gg_ribbon <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_segment.R
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ gg_segment <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ gg_sf <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ gg_smooth <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_step.R
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ gg_step <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
4 changes: 2 additions & 2 deletions R/gg_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#' label = model,
#' size = 3.53,
#' y_include = c(min(.$mpg) * 0.95, max(.$mpg) * 1.05),
#' pal = c("firebrick", "white", "steelblue"),
#' pal = c(guardian()[2], "white", "#36648b"),
#' y_title = "Miles per gallon"
#' )
#'
Expand Down Expand Up @@ -431,7 +431,7 @@ gg_text <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_tile.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_tile <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion R/gg_violin.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ gg_violin <- function(
}

if (!col_scale) {
if (rlang::is_null(pal)) pal <- "#4682b4"
if (rlang::is_null(pal)) pal <- "#36648b"
else pal <- as.vector(pal[1])

plot <- plot +
Expand Down
2 changes: 1 addition & 1 deletion man/gg_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/gg_ribbon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/gg_text.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 57c0884

Please sign in to comment.