diff --git a/R/a-geom-rect.R b/R/a-geom-rect.R index b3bd71c..c08fb3f 100644 --- a/R/a-geom-rect.R +++ b/R/a-geom-rect.R @@ -1,4 +1,4 @@ -geom_rrect <- function(mapping = NULL, data = NULL, +geom_rrect <- function(mapping = NULL, data = NULL, # nocov start stat = "identity", position = "identity", radius = grid::unit(6, "pt"), ..., @@ -63,4 +63,4 @@ GeomRrect <- ggplot2::ggproto( draw_key = ggplot2::draw_key_polygon -) \ No newline at end of file +) # nocov end \ No newline at end of file diff --git a/R/geom-chicklet.R b/R/geom-chicklet.R index fcaa344..da6c3ba 100644 --- a/R/geom-chicklet.R +++ b/R/geom-chicklet.R @@ -68,7 +68,7 @@ geom_chicklet <- function(mapping = NULL, data = NULL, ) } -draw_key_rrect <- function(data, params, size) { +draw_key_rrect <- function(data, params, size) { # nocov start grid::roundrectGrob( r = params$radius, default.units = "native", @@ -80,13 +80,13 @@ draw_key_rrect <- function(data, params, size) { lty = data$linetype %||% 1 ) ) -} +} # nocov end #' ggchicklet-ggplot2-ggproto #' @format NULL #' @usage NULL #' @export -GeomChicklet <- ggproto( +GeomChicklet <- ggproto( # nocov start "GeomChicklet", GeomRrect, required_aes = c("x", "y"), @@ -112,4 +112,4 @@ GeomChicklet <- ggproto( draw_key = draw_key_rrect -) +) # nocov end diff --git a/R/utils-infix-helpers.R b/R/utils-infix-helpers.R index 11e792d..36822fa 100644 --- a/R/utils-infix-helpers.R +++ b/R/utils-infix-helpers.R @@ -1,4 +1,2 @@ `%l0%` <- function(x, y) if (length(x) == 0) y else x `%||%` <- function(x, y) if (is.null(x)) y else x -`%@%` <- function(x, name) attr(x, name, exact = TRUE) -`%nin%` <- function(x, table) match(x, table, nomatch = 0) == 0 diff --git a/tests/testthat/test-ggchicklet.R b/tests/testthat/test-ggchicklet.R index dc7eb1d..b9c3939 100644 --- a/tests/testthat/test-ggchicklet.R +++ b/tests/testthat/test-ggchicklet.R @@ -13,6 +13,8 @@ test_that("chicklet geoms are created properly", { ggplot(debates2019) + geom_chicklet(aes(speaker, elapsed, group = timestamp, fill = topic)) -> gg + print(gg) + ggplot_build(gg) -> gb ggplot_gtable(gb) -> gt