Skip to content

Commit

Permalink
Merge pull request #4 from pepijn-devries/work-in-progress
Browse files Browse the repository at this point in the history
More fixes to pass CRAN checks
  • Loading branch information
pepijn-devries authored Feb 29, 2024
2 parents 76cf0d9 + a577d09 commit ea53abe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggsankeyfier
Type: Package
Title: Create Sankey and Alluvial Diagrams Using 'ggplot2'
Version: 0.1.6
Version: 0.1.7
Date: 2024-02-29
Authors@R: c(person("Pepijn", "de Vries", role = c("aut", "cre", "dtc"),
email = "pepijn.devries@outlook.com",
Expand All @@ -28,7 +28,7 @@ Depends:
R (>= 4.1.0)
Imports:
dplyr,
ggplot2 (>= 3.5.0),
ggplot2 (>= 3.4.4),
grid (>= 4.1.0),
gridBezier,
methods,
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ggsankeyfier v0.1.6 (Release date: 2024-02-29)
ggsankeyfier v0.1.7 (Release date: 2024-02-29)
-------------

* Initial release
Expand Down
10 changes: 5 additions & 5 deletions R/scale_waist.r
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@
scale_waist_continuous <- function(..., range = c(0, 1)) {
rlang::warn(c("Legend is not really suitable for a continuous `waist` scale",
i = "Apply a binned scale instead"))
ggplot2::continuous_scale("waist", palette = scales::rescale_pal(range), ...)
ggplot2::continuous_scale("waist", NULL, palette = scales::rescale_pal(range), ...)
}

#' @name scale_waist_datetime
#' @rdname scale_waist
#' @export
scale_waist_datetime <- function(..., range = c(0, 1)) {
ggplot2::datetime_scale("waist", palette = scales::rescale_pal(range), ...)
ggplot2::datetime_scale("waist", NULL, palette = scales::rescale_pal(range), ...)
}

#' @name scale_waist_binned
#' @rdname scale_waist
#' @export
scale_waist_binned <- function(..., range = c(0, 1)) {
ggplot2::binned_scale("waist", palette = scales::rescale_pal(range), ...)
ggplot2::binned_scale("waist", NULL, palette = scales::rescale_pal(range), ...)
}

#' @name scale_waist_discrete
#' @rdname scale_waist
#' @export
scale_waist_discrete <- function(..., range = c(0, 1)) {
ggplot2::discrete_scale("waist", palette = function(value) {
ggplot2::discrete_scale("waist", NULL, palette = function(value) {
seq(range[[1]], range[[2]], length.out = value)
}, ...)
}
Expand Down Expand Up @@ -85,7 +85,7 @@ scale_waist_manual <- function (..., values = NULL, breaks = ggplot2::waiver())
}
values
}
ggplot2::discrete_scale("waist", palette = pal,
ggplot2::discrete_scale("waist", NULL, palette = pal,
breaks = breaks, ...)
}

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/_snaps/plots/ggsankeyfier-stack-ident.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ea53abe

Please sign in to comment.