|
9 | 9 | #' rendered. |
10 | 10 | #' |
11 | 11 | #' Extending facets can range from the simple modifications of current facets, |
12 | | -#' to very laborious rewrites with a lot of [gtable()] manipulation. |
13 | | -#' For some examples of both, please see the extension vignette. |
| 12 | +#' to very laborious rewrites with a lot of [`gtable()`][gtable::gtable()] |
| 13 | +#' manipulation. For some examples of both, please see the extension vignette. |
14 | 14 | #' |
15 | 15 | #' `Facet` subclasses, like other extendible ggproto classes, have a range |
16 | 16 | #' of methods that can be modified. Some of these are required for all new |
|
49 | 49 | #' |
50 | 50 | #' - `setup_panel_params`: modifies the x and y ranges for each panel. This is |
51 | 51 | #' used to allow the `Facet` to interact with the `panel_params`. |
52 | | -#' |
| 52 | +#' |
53 | 53 | #' - `init_scales`: Given a master scale for x and y, create panel |
54 | 54 | #' specific scales for each panel defined in the layout. The default is to |
55 | 55 | #' simply clone the master scale. |
@@ -318,10 +318,6 @@ Facet <- ggproto("Facet", NULL, |
318 | 318 | } |
319 | 319 | ) |
320 | 320 |
|
321 | | -#' @export |
322 | | -#' @rdname is_tests |
323 | | -is.facet <- function(x) inherits(x, "Facet") |
324 | | - |
325 | 321 | # Helpers ----------------------------------------------------------------- |
326 | 322 |
|
327 | 323 | #' Quote faceting variables |
@@ -383,6 +379,18 @@ vars <- function(...) { |
383 | 379 | quos(...) |
384 | 380 | } |
385 | 381 |
|
| 382 | +#' @export |
| 383 | +#' @rdname is_tests |
| 384 | +is_facet <- function(x) inherits(x, "Facet") |
| 385 | + |
| 386 | +#' @export |
| 387 | +#' @rdname is_tests |
| 388 | +#' @usage is.facet(x) # Deprecated |
| 389 | +is.facet <- function(x) { |
| 390 | + deprecate_soft0("3.5.2", "is.facet()", "is_facet()") |
| 391 | + is_facet(x) |
| 392 | +} |
| 393 | + |
386 | 394 | #' Accessing a plot's facet strip labels |
387 | 395 | #' |
388 | 396 | #' This functions retrieves labels from facet strips with the labeller applied. |
@@ -493,7 +501,7 @@ as_facets_list <- function(x) { |
493 | 501 | } |
494 | 502 |
|
495 | 503 | check_vars <- function(x) { |
496 | | - if (is.mapping(x)) { |
| 504 | + if (is_mapping(x)) { |
497 | 505 | cli::cli_abort("Please use {.fn vars} to supply facet variables.") |
498 | 506 | } |
499 | 507 | # Native pipe have higher precedence than + so any type of gg object can be |
|
0 commit comments