more in line with set_text_* functionspkg
| S3method(print,anim_opts) | S3method(print,anim_opts) | ||||
| export("%>%") | export("%>%") | ||||
| export(anim_options) | export(anim_options) | ||||
| export(anim_options_set) | |||||
| export(animate_anti_join) | export(animate_anti_join) | ||||
| export(animate_full_join) | export(animate_full_join) | ||||
| export(animate_gather) | export(animate_gather) | ||||
| export(animate_union_all) | export(animate_union_all) | ||||
| export(get_font_size) | export(get_font_size) | ||||
| export(is.anim_opts) | export(is.anim_opts) | ||||
| export(set_anim_options) | |||||
| export(set_font_size) | export(set_font_size) | ||||
| importFrom(dplyr,anti_join) | importFrom(dplyr,anti_join) | ||||
| importFrom(dplyr,arrange) | importFrom(dplyr,arrange) |
| #' @describeIn anim_options Set default animation options for the current session. | #' @describeIn anim_options Set default animation options for the current session. | ||||
| #' @param anim_opts An [anim_options()] options list. | #' @param anim_opts An [anim_options()] options list. | ||||
| #' @export | #' @export | ||||
| anim_options_set <- function(anim_opts = anim_options()) { | |||||
| set_anim_options <- function(anim_opts = anim_options()) { | |||||
| stopifnot(is.anim_opts(anim_opts)) | stopifnot(is.anim_opts(anim_opts)) | ||||
| ao_old <- plot_settings$anim_opts | ao_old <- plot_settings$anim_opts | ||||
| plot_settings$anim_opts <- merge(anim_opts, plot_settings$anim_opts) | plot_settings$anim_opts <- merge(anim_opts, plot_settings$anim_opts) | ||||
| set_text_size <- function(size) { | set_text_size <- function(size) { | ||||
| old <- plot_settings$text_size | old <- plot_settings$text_size | ||||
| anim_options_set(anim_options(text_size = size)) | |||||
| set_anim_options(anim_options(text_size = size)) | |||||
| invisible(old) | invisible(old) | ||||
| } | } | ||||
| set_title_size <- function(size) { | set_title_size <- function(size) { | ||||
| old <- plot_settings$title_size | old <- plot_settings$title_size | ||||
| anim_options_set(anim_options(title_size = size)) | |||||
| set_anim_options(anim_options(title_size = size)) | |||||
| invisible(old) | invisible(old) | ||||
| } | } | ||||
| % Please edit documentation in R/animate_options.R | % Please edit documentation in R/animate_options.R | ||||
| \name{anim_options} | \name{anim_options} | ||||
| \alias{anim_options} | \alias{anim_options} | ||||
| \alias{anim_options_set} | |||||
| \alias{set_anim_options} | |||||
| \title{Animation Options} | \title{Animation Options} | ||||
| \usage{ | \usage{ | ||||
| anim_options(transition_length = NULL, state_length = NULL, | anim_options(transition_length = NULL, state_length = NULL, | ||||
| color_other = NULL, color_missing = NULL, color_fun = NULL, | color_other = NULL, color_missing = NULL, color_fun = NULL, | ||||
| text_color = NULL, ...) | text_color = NULL, ...) | ||||
| anim_options_set(anim_opts = anim_options()) | |||||
| set_anim_options(anim_opts = anim_options()) | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{transition_length}{The relative length of the transition. Will be | \item{transition_length}{The relative length of the transition. Will be | ||||
| } | } | ||||
| \section{Functions}{ | \section{Functions}{ | ||||
| \itemize{ | \itemize{ | ||||
| \item \code{anim_options_set}: Set default animation options for the current session. | |||||
| \item \code{set_anim_options}: Set default animation options for the current session. | |||||
| }} | }} | ||||