소스 검색

Update print method for anim_opts

pkg-add-anim-opts-fixed
Garrick Aden-Buie 7 년 전
부모
커밋
8a1e6f6004
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. +9
    -6
      R/animate_options.R

+ 9
- 6
R/animate_options.R 파일 보기

@@ -79,13 +79,16 @@ get_anim_opt <- function(anim_opt = NULL) {

# Animation Options Methods -----------------------------------------------

print.anim_opts <- function(ao) {
aop <- purrr::discard(ao, is.null)
print.anim_opts <- function(ao, full = FALSE) {
if (!full) ao <- purrr::discard(ao, is.null)
# Replace ggproto (enter/exit functions) with their names
if ("enter" %in% names(aop)) aop$enter <- paste("ggproto:", names(ao$enter))
if ("exit" %in% names(aop)) aop$exit <- paste("ggproto:", names(ao$exit))
str(aop)
invisible(ao)
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))
cat(
paste0("<anim_options: ", length(ao), " options>"),
x, sep = "\n"
)
}

is.anim_opts <- function(ao) inherits(ao, "anim_opts")

Loading…
취소
저장