Skip to content

Commit 518e943

Browse files
committed
Incorporate latest ggplot2 class renaming
in tidyverse/ggplot2#6546
1 parent aeb83ba commit 518e943

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export(geom_mean_lines)
1111
export(geom_median_lines)
1212
if (getRversion() < "4.3.0") importFrom("S7", "@")
1313
import(grid)
14-
importFrom(ggplot2,draw_element)
1514
importFrom(ggplot2,element)
15+
importFrom(ggplot2,element_grob)
1616
importFrom(ggplot2,element_text)
1717
importFrom(rlang,"%||%")
1818
importFrom(tools,R_user_dir)

R/ggpath-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"_PACKAGE"
33

44
## usethis namespace: start
5-
#' @importFrom ggplot2 element_text draw_element element
5+
#' @importFrom ggplot2 element_text element_grob element
66
#' @import grid
77
#' @importFrom rlang %||%
88
#' @importFrom tools R_user_dir

R/theme_element.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ element_raster <- S7::new_class(
183183
}
184184
)
185185

186-
S7::method(draw_element, element_path) <- function(
186+
S7::method(element_grob, element_path) <- function(
187187
element,
188188
label = "",
189189
x = NULL,
@@ -242,7 +242,7 @@ grobHeight.ggpath_element <- function(x, ...) x$size
242242
#' @export
243243
grobWidth.ggpath_element <- function(x, ...) x$size
244244

245-
S7::method(draw_element, element_raster) <- function(element, ...) {
245+
S7::method(element_grob, element_raster) <- function(element, ...) {
246246
img <- try(reader_function(element@image_path), silent = TRUE)
247247
# if the path is invalid we warn the user and insert a NULL grob
248248
if (inherits(img, "try-error")) {

tests/testthat/test-theme-elements.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ test_that("theme element works with 'b/w'", {
7171
# because the reference file is created on a mac and comparison breaks
7272
# on other operating systems because of slightly different grey tones.
7373
# for code coverage we build the plot without printing it
74-
out <- ggplot2::build_ggplot(p2) |>
75-
ggplot2::gtable_ggplot()
74+
out <- ggplot2::ggplot_build(p2) |>
75+
ggplot2::ggplot_gtable()
7676
skip_on_os(c("windows", "linux", "solaris"))
7777

7878
vdiffr::expect_doppelganger("p2", p2)

0 commit comments

Comments
 (0)