|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Animation Options Methods ----------------------------------------------- |
|
|
# Animation Options Methods ----------------------------------------------- |
|
|
|
|
|
|
|
|
print.anim_opts <- function(ao, full = FALSE) { |
|
|
|
|
|
if (!full) ao <- purrr::discard(ao, is.null) |
|
|
|
|
|
|
|
|
#' @export |
|
|
|
|
|
print.anim_opts <- function(x) { |
|
|
# Replace ggproto (enter/exit functions) with their names |
|
|
# Replace ggproto (enter/exit functions) with their names |
|
|
if ("enter" %in% names(ao)) ao$enter <- paste("ggproto:", names(ao$enter)) |
|
|
|
|
|
if ("exit" %in% names(ao)) ao$exit <- paste("ggproto:", names(ao$exit)) |
|
|
|
|
|
x <- capture.output(str(ao, no.list = TRUE)) |
|
|
|
|
|
|
|
|
if ("enter" %in% names(x)) x$enter <- paste("ggproto:", names(x$enter)) |
|
|
|
|
|
if ("exit" %in% names(x)) x$exit <- paste("ggproto:", names(x$exit)) |
|
|
|
|
|
anim_opts <- capture.output(str(x, no.list = TRUE)) |
|
|
cat( |
|
|
cat( |
|
|
paste0("<anim_options: ", length(ao), " options>"), |
|
|
|
|
|
x, sep = "\n" |
|
|
|
|
|
|
|
|
paste0("<anim_options: ", length(x), " options>"), |
|
|
|
|
|
anim_opts, sep = "\n" |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#' @export |
|
|
is.anim_opts <- function(ao) inherits(ao, "anim_opts") |
|
|
is.anim_opts <- function(ao) inherits(ao, "anim_opts") |
|
|
|
|
|
|
|
|
|
|
|
|