Skip to content

Commit 53a4788

Browse files
committed
write new methods
1 parent 1800a9a commit 53a4788

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ S3method(guide_geom,default)
8484
S3method(guide_merge,default)
8585
S3method(guide_train,default)
8686
S3method(guide_transform,default)
87+
S3method(heightDetails,ggplot)
88+
S3method(heightDetails,ggplot_built)
8789
S3method(heightDetails,titleGrob)
8890
S3method(heightDetails,zeroGrob)
8991
S3method(limits,Date)
@@ -146,6 +148,8 @@ S3method(vec_ptype2,mapped_discrete.double)
146148
S3method(vec_ptype2,mapped_discrete.factor)
147149
S3method(vec_ptype2,mapped_discrete.integer)
148150
S3method(vec_ptype2,mapped_discrete.mapped_discrete)
151+
S3method(widthDetails,ggplot)
152+
S3method(widthDetails,ggplot_built)
149153
S3method(widthDetails,titleGrob)
150154
S3method(widthDetails,zeroGrob)
151155
export("%+%")

R/utilities-grid.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,15 @@ height_cm <- function(x) {
6767
cli::cli_abort("Don't know how to get height of {.cls {class(x)}} object")
6868
}
6969
}
70+
71+
#' @export
72+
widthDetails.ggplot <- function(x) widthDetails(ggplotGrob(x))
73+
74+
#' @export
75+
widthDetails.ggplot_built <- widthDetails.ggplot
76+
77+
#' @export
78+
heightDetails.ggplot <- function(x) heightDetails(ggplotGrob(x))
79+
80+
#' @export
81+
heightDetails.ggplot_built <- heightDetails.ggplot

0 commit comments

Comments
 (0)