Skip to content

Commit ef5db54

Browse files
committed
implement as.gtable methods
1 parent 30b1118 commit ef5db54

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Imports:
3535
cli,
3636
grDevices,
3737
grid,
38-
gtable (>= 0.1.1),
38+
gtable (>= 0.3.6),
3939
isoband,
4040
lifecycle (> 1.0.1),
4141
rlang (>= 1.1.0),

R/plot-build.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ ggplotGrob <- function(x) {
320320
ggplot_gtable(ggplot_build(x))
321321
}
322322

323+
S7::method(as.gtable, class_ggplot) <- ggplotGrob
324+
S7::method(as.gtable, class_ggplot_built) <- ggplotGrob
325+
323326
# Apply function to layer and matching data
324327
by_layer <- function(f, layers, data, step = NULL) {
325328
ordinal <- label_ordinal()

0 commit comments

Comments
 (0)