Skip to content

Commit 98136d7

Browse files
committed
add format method
1 parent 6de07af commit 98136d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

R/plot-construction.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,12 @@ new_layer_names <- function(layer, existing) {
268268
names <- c(existing, new_name)
269269
vec_as_names(names, repair = "check_unique")
270270
}
271+
272+
local({
273+
S7::method(format, class_gg) <- function(x, ...) {
274+
x <- S7::S7_class(x)
275+
# Similar to S7:::S7_class_name
276+
x <- paste(c(x@package, x@name), collapse = "::")
277+
format(paste0("<", x, ">"), ...)
278+
}
279+
})

0 commit comments

Comments
 (0)