gganimate/ 0000755 0001762 0000144 00000000000 14306342331 012205 5 ustar ligges users gganimate/NAMESPACE 0000644 0001762 0000144 00000010622 14022633550 013426 0 ustar ligges users # Generated by roxygen2: do not edit by hand S3method(animate,default) S3method(animate,gganim) S3method(c,TransmuteFactory) S3method(ggplot_add,EaseAes) S3method(ggplot_add,EnterFactory) S3method(ggplot_add,ExitFactory) S3method(ggplot_add,Shadow) S3method(ggplot_add,Transition) S3method(ggplot_add,View) S3method(ggplot_build,gganim) S3method(group_column,default) S3method(layer_type,GeomPath) S3method(layer_type,GeomPolygon) S3method(layer_type,GeomRibbon) S3method(layer_type,GeomSf) S3method(layer_type,GeomSmooth) S3method(layer_type,Stat) S3method(layer_type,StatContour) S3method(layer_type,default) S3method(match_shapes,StatContour) S3method(match_shapes,default) S3method(plot,gganim) S3method(print,gganim) S3method(print,gif_image) S3method(print,sprite_image) S3method(print,video_file) S3method(save_animation,"magick-image") S3method(save_animation,default) S3method(save_animation,gif_image) S3method(save_animation,video_file) S3method(split,gif_image) S3method(split,sprite_image) S3method(split,video_file) S3method(tween_before_stat,default) export(Shadow) export(ShadowMark) export(ShadowNull) export(ShadowTrail) export(ShadowWake) export(Transition) export(TransitionComponents) export(TransitionEvents) export(TransitionFilter) export(TransitionLayers) export(TransitionManual) export(TransitionNull) export(TransitionReveal) export(TransitionStates) export(TransitionTime) export(View) export(ViewFollow) export(ViewStep) export(ViewStepManual) export(ViewZoom) export(ViewZoomManual) export(anim_save) export(animate) export(av_renderer) export(ease_aes) export(enter_appear) export(enter_drift) export(enter_fade) export(enter_fly) export(enter_grow) export(enter_manual) export(enter_recolor) export(enter_recolour) export(enter_reset) export(exit_disappear) export(exit_drift) export(exit_fade) export(exit_fly) export(exit_manual) export(exit_recolor) export(exit_recolour) export(exit_reset) export(exit_shrink) export(ffmpeg_renderer) export(file_renderer) export(frame_vars) export(gg_animate) export(gganimate) export(gif_file) export(gifski_renderer) export(group_column) export(knit_print.gganim) export(knit_print.gif_image) export(knit_print.sprite_image) export(knit_print.video_file) export(last_animation) export(layer_type) export(magick_renderer) export(match_shapes) export(save_animation) export(set_last_animation) export(shadow_mark) export(shadow_null) export(shadow_trail) export(shadow_wake) export(split_animation) export(sprite_file) export(sprite_renderer) export(transition_components) export(transition_events) export(transition_filter) export(transition_layers) export(transition_manual) export(transition_null) export(transition_reveal) export(transition_states) export(transition_time) export(tween_before_stat) export(video_file) export(view_follow) export(view_static) export(view_step) export(view_step_manual) export(view_zoom) export(view_zoom_manual) importFrom(ggplot2,CoordCartesian) importFrom(ggplot2,FacetNull) importFrom(ggplot2,Layout) importFrom(ggplot2,geom_blank) importFrom(ggplot2,ggplot_add) importFrom(ggplot2,ggplot_build) importFrom(ggplot2,ggplot_gtable) importFrom(ggplot2,ggproto) importFrom(ggplot2,is.ggplot) importFrom(ggplot2,scale_x_continuous) importFrom(ggplot2,scale_y_continuous) importFrom(ggplot2,waiver) importFrom(glue,glue) importFrom(glue,glue_data) importFrom(grDevices,bmp) importFrom(grDevices,col2rgb) importFrom(grDevices,dev.off) importFrom(grDevices,jpeg) importFrom(grDevices,png) importFrom(grDevices,svg) importFrom(grDevices,tiff) importFrom(grid,convertHeight) importFrom(grid,convertWidth) importFrom(grid,grid.draw) importFrom(grid,grid.newpage) importFrom(grid,pushViewport) importFrom(grid,seekViewport) importFrom(grid,upViewport) importFrom(progress,progress_bar) importFrom(rlang,"%||%") importFrom(rlang,as_function) importFrom(rlang,enquo) importFrom(rlang,eval_tidy) importFrom(rlang,quo) importFrom(rlang,quo_is_missing) importFrom(rlang,quo_is_null) importFrom(rlang,quo_name) importFrom(rlang,quos) importFrom(rlang,quos_auto_name) importFrom(scales,alpha) importFrom(stringi,stri_detect) importFrom(stringi,stri_match) importFrom(stringi,stri_replace) importFrom(tweenr,keep_state) importFrom(tweenr,tween_along) importFrom(tweenr,tween_at) importFrom(tweenr,tween_components) importFrom(tweenr,tween_constant) importFrom(tweenr,tween_events) importFrom(tweenr,tween_numeric) importFrom(tweenr,tween_state) importFrom(utils,modifyList) importFrom(utils,packageVersion) gganimate/LICENSE 0000644 0001762 0000144 00000000061 13405665100 013210 0 ustar ligges users YEAR: 2017 COPYRIGHT HOLDER: Thomas Lin Pedersen gganimate/man/ 0000755 0001762 0000144 00000000000 14276661410 012770 5 ustar ligges users gganimate/man/frame_vars.Rd 0000644 0001762 0000144 00000001271 13405665100 015376 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/post_process.R \name{frame_vars} \alias{frame_vars} \title{Access metadata about the frames in an animation} \usage{ frame_vars(animation = last_animation()) } \arguments{ \item{animation}{The animation to extract metadata from. Defaults to the last rendered animation} } \value{ A data.frame with a row per frame in the animation and metadata as columns } \description{ This function extracts the metadata generated about each frame during rendering. It corresponds to the information available to the labels for string literal interpretation and is thus dependent on the transition and view used for the animation. } gganimate/man/video_file.Rd 0000644 0001762 0000144 00000002353 13406166235 015366 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/renderers.R \name{video_file} \alias{video_file} \alias{print.video_file} \alias{knit_print.video_file} \title{Wrap a video file for easy handling} \usage{ video_file(file) \method{print}{video_file}(x, width = NULL, ...) knit_print.video_file(x, options, ...) } \arguments{ \item{file}{A video file} \item{x}{A \code{video_file} object} \item{width}{The width the output should be scaled to} \item{...}{Arguments passed on} } \value{ \code{video_file} returns a \code{video_file} object which is a shallow wrapper around the file path text string. } \description{ This function is equivalent to \code{\link[=gif_file]{gif_file()}} but works for arbitrary video file formats. There are some caveats involved though, most notably it doesn't currently supports splitting so you can't easily use this output together with \code{\link[=split_animation]{split_animation()}}. Graceful printing is contingent on the file format. Only \code{mp4}, \code{webm}, and \code{ogg} is supported by the HTML format and can thus be shown in the RStudio viewer and inside HTML documents created with knitr. Other formats will be opened in their default OS-specific viewer. } \keyword{internal} gganimate/man/transition_layers.Rd 0000644 0001762 0000144 00000010044 13611331661 017021 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transition-layers.R \name{transition_layers} \alias{transition_layers} \title{Build up a plot, layer by layer} \usage{ transition_layers( layer_length = 1, transition_length = 1, keep_layers = TRUE, from_blank = TRUE, layer_order = NULL, layer_names = NULL ) } \arguments{ \item{layer_length}{The proportional time to pause at each layer before a new one enters} \item{transition_length}{The proportional time to use for the entrance of a new layer} \item{keep_layers}{Either an integer indicating for how many following layers the layers should stay on screen or a logical. In the case of the later, \code{TRUE} will mean keep the layer for the remainder of the animation (equivalent to setting it to \code{Inf}) and \code{FALSE} will mean to transition the layer out as the next layer enters.} \item{from_blank}{Should the first layer transition in or be present on the onset of the animation} \item{layer_order}{An alternative order the layers should appear in (default to using the stacking order). All other arguments that references the layers index in some way refers to this order.} \item{layer_names}{A character vector of names for each layers, to be used when interpreting label literals} } \description{ This transition gradually adds layers to the plot in the order they have been defined. By default prior layers are kept for the remainder of the animation, but they can also be set to be removed as the next layer enters. } \section{Label variables}{ \code{transition_layers} makes the following variables available for string literal interpretation, in addition to the general ones provided by \code{\link[=animate]{animate()}}: \itemize{ \item \strong{transitioning} is a boolean indicating whether the frame is part of the transitioning phase \item \strong{previous_layer} The name of the last layer the animation was showing \item \strong{closest_layer} The name of the layer the animation is closest to showing \item \strong{next_layer} The name of the next layer the animation will show \item \strong{nlayers} The total number of layers } } \section{Object permanence}{ \code{transition_layer} does not link rows across data to the same graphic element, so elements will be defined uniquely by each row and the enter and exit of the layer it belongs to. } \examples{ # Default is to use layer order and keep layers for duration of animation anim <- ggplot(mtcars, aes(mpg, disp)) + geom_point() + geom_smooth(colour = 'grey', se = FALSE) + geom_smooth(aes(colour = factor(gear))) + transition_layers(layer_length = 1, transition_length = 2) + enter_fade() + enter_grow() # Start with the first layer already present anim1 <- ggplot(mtcars, aes(mpg, disp)) + geom_point() + geom_smooth(colour = 'grey', se = FALSE) + geom_smooth(aes(colour = factor(gear))) + transition_layers(layer_length = 1, transition_length = 2, from_blank = FALSE) + enter_fade() + enter_grow() # Change the order of the layers anim2 <- ggplot(mtcars, aes(mpg, disp)) + geom_point() + geom_smooth(colour = 'grey', se = FALSE) + geom_smooth(aes(colour = factor(gear))) + transition_layers(layer_length = 1, transition_length = 2, from_blank = FALSE, layer_order = c(3, 1, 2)) + enter_fade() + enter_grow() # Keep layer 1 for the whole animation, but remove the 2nd layer as the 3rd # enters anim3 <- ggplot(mtcars, aes(mpg, disp)) + geom_point() + geom_smooth(colour = 'grey', se = FALSE) + geom_smooth(aes(colour = factor(gear))) + transition_layers(layer_length = 1, transition_length = 2, from_blank = FALSE, keep_layers = c(Inf, 0, 0)) + enter_fade() + enter_grow() + exit_fade() + exit_shrink() } \seealso{ Other transitions: \code{\link{transition_components}()}, \code{\link{transition_events}()}, \code{\link{transition_filter}()}, \code{\link{transition_manual}()}, \code{\link{transition_null}()}, \code{\link{transition_reveal}()}, \code{\link{transition_states}()}, \code{\link{transition_time}()} } \concept{transitions} gganimate/man/view_step.Rd 0000644 0001762 0000144 00000010741 14276661117 015273 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/view-step.R, R/view-step-manual.R \name{view_step} \alias{view_step} \alias{view_step_manual} \title{Follow the data in steps} \usage{ view_step( pause_length = 1, step_length = 1, nsteps = NULL, look_ahead = pause_length, delay = 0, include = TRUE, ease = "cubic-in-out", wrap = TRUE, pause_first = FALSE, fixed_x = FALSE, fixed_y = FALSE, exclude_layer = NULL, aspect_ratio = 1 ) view_step_manual( pause_length = 1, step_length = 1, xmin, xmax, ymin, ymax, delay = 0, ease = "cubic-in-out", wrap = TRUE, pause_first = FALSE, fixed_x = FALSE, fixed_y = FALSE, exclude_layer = NULL, aspect_ratio = 1 ) } \arguments{ \item{pause_length}{The relative length the view will be kept static. Will be recycled to match the number of steps} \item{step_length}{The relative length the view will use to transition to the new position. Will be recycled to match the number of steps} \item{nsteps}{The number of steps. If \code{NULL} it will be set to the max length of \code{pause_length} or \code{step_length}} \item{look_ahead}{A relative length to look ahead in the animation to get the new zoom area. Allow the view to zoom to where the data will be} \item{delay}{A relative length to switch the view back and forth relative to the actual frames. E.g. if delay is calculated to 5 frames, frame 6 will get the view intended for frame 1.} \item{include}{Should the steps include both the start and end frame range} \item{ease}{The easing function used for the step} \item{wrap}{As in \code{\link[=transition_states]{transition_states()}}. Should the view wrap around and zoom back to the first state.} \item{pause_first}{Should the view start with a pause. The default is to start with a step so that it is aligned to the static period in \code{\link[=transition_states]{transition_states()}}} \item{fixed_x, fixed_y}{Either a logical indicating if the dimension should not be modified by the view, or a numeric vector giving the lower and upper bounds of the dimension. For the latter, an \code{NA} value will be substituted for whatever is calculated by the view (e.g. \code{fixed_x = c(0, NA)}) will fix the minimum x value to 0 and let the view calculate the upper bound.} \item{exclude_layer}{Integer vector of layer indices that should be ignored when calculating the view} \item{aspect_ratio}{If the coord is fixed, ensure that the view matches the given aspect ratio. Will override anything given in \code{fixed_x}/\code{fixed_y}} \item{xmin, xmax, ymin, ymax}{Vectors of even length defining the boundaries of the different views to go through} } \description{ This view is a bit like \code{\link[=view_follow]{view_follow()}} but will not match the data in each frame. Instead it will switch between being static and zoom to the range of the data. It is a great pairing with \code{\link[=transition_states]{transition_states()}} as it can move the view while the data is static and then be static while the data moves. The standard version will look at the data present in the calculated frames and set the ranges based on that, while the \verb{_manual} version will allow you to define your own ranges. } \examples{ anim <- ggplot(iris, aes(Petal.Length, Petal.Width)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + view_step(pause_length = 2, step_length = 1, nsteps = 3) # Default is to include the data from the two states you're stepping between # but this can be turned off anim <- ggplot(iris, aes(Petal.Length, Petal.Width)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + view_step(pause_length = 2, step_length = 1, nsteps = 3, include = FALSE) # Default is to work off-beat of transition_states so that view changes while # data is static. Setting pause_first=TRUE changes this anim <- ggplot(iris, aes(Petal.Length, Petal.Width)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + view_step(pause_length = 1, step_length = 2, nsteps = 3, pause_first = TRUE) # If the transition doesn't wrap, then the view shouldn't either anim <- ggplot(iris, aes(Petal.Length, Petal.Width)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1, wrap = FALSE) + view_step(pause_length = 2, step_length = 1, nsteps = 3, wrap = FALSE) } \seealso{ Other views: \code{\link{view_follow}()}, \code{\link{view_static}()}, \code{\link{view_zoom}()} } \concept{views} gganimate/man/layer_type.Rd 0000644 0001762 0000144 00000000664 13405665100 015433 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/group_column.R, R/layer_type.R, % R/match_shapes.R \name{group_column} \alias{group_column} \alias{layer_type} \alias{match_shapes} \title{Define what graphical type a layer is} \usage{ group_column(x) layer_type(x) match_shapes(x) } \arguments{ \item{x}{a Layer, Geom, or Stat} } \description{ Define what graphical type a layer is } \keyword{internal} gganimate/man/enter_exit.Rd 0000644 0001762 0000144 00000014551 13611331661 015425 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transmute-.R, R/transmute-enter.R, % R/transmute-exit.R \name{enter_exit} \alias{enter_exit} \alias{enter} \alias{exit} \alias{enter_manual} \alias{enter_appear} \alias{enter_fade} \alias{enter_grow} \alias{enter_recolour} \alias{enter_recolor} \alias{enter_fly} \alias{enter_drift} \alias{enter_reset} \alias{exit_manual} \alias{exit_disappear} \alias{exit_fade} \alias{exit_shrink} \alias{exit_recolour} \alias{exit_recolor} \alias{exit_fly} \alias{exit_drift} \alias{exit_reset} \title{Define how entering and exiting data behaves} \usage{ enter_manual(default = NULL, ..., name = "manual") enter_appear(early = FALSE, ...) enter_fade(..., alpha = 0) enter_grow(..., size = 0) enter_recolour(..., colour = "white", fill = colour) enter_recolor(..., color = "white", fill = color) enter_fly(..., x_loc = NA, y_loc = NA) enter_drift(..., x_mod = 0, y_mod = 0) enter_reset() exit_manual(default = NULL, ..., name = "manual") exit_disappear(early = FALSE, ...) exit_fade(..., alpha = 0) exit_shrink(..., size = 0) exit_recolour(..., colour = "white", fill = colour) exit_recolor(..., color = "white", fill = color) exit_fly(..., x_loc = NA, y_loc = NA) exit_drift(..., x_mod = 0, y_mod = 0) exit_reset() } \arguments{ \item{default}{A default transformation to use} \item{...}{Additional specific transformations either named by the geom (e.g. \code{bar}, or by its position in the layer stack, e.g. \code{"2"})} \item{name}{A name for the manual modification (only used when printing the object)} \item{early}{Should the data appear in the beginning of the transition or in the end} \item{alpha}{The start/end transparency.} \item{size}{The proportional start/end size. \code{0} means complete shrinking while \code{1} means no shrinking} \item{colour, color, fill}{The start/end colour and fill the elements should (dis)appear into} \item{x_loc, y_loc}{Start and end positions of the graphic elements} \item{x_mod, y_mod}{Modification to add to the entering or exiting data} } \description{ The purpose of \verb{enter_*()} and \verb{exit_*()} is to control what happens with data that does not persist during a tween. In general the non-persistent data is transformed to an \emph{invisible} version that can be tweened to, e.g. by setting the opacity to 0 or be moving the element off-screen. It is possible to define your own transformations, or rely on some of the build in \emph{effects}. } \section{User-defined transformations}{ All enter/exit functions allows the user to add additional transformation functions targeting specific layers. If the functions are named, then the name is understood to reference the class of geoms it applies to. If the functions are unnamed or numbered they will apply to the layer with a matching index in the stack. Named and indexed transformations cannot be mixed. All modifications except \code{enter_manual()}/\code{exit_manual()} sets a range of modifications already, but further can be added with the \code{...}. For the manual versions a \code{default} transformation can be set which will apply to all layers that does not match any of the other given transformations. Often a single default transformation is enough and no specific transformations are needed. Transformation can be given as any expression that can be converted with \code{\link[rlang:as_function]{rlang::as_function()}}. This means that \code{purrr} style lambda functions are allowed in addition to anonymous functions etc. Transformation functions must accept a data.frame and return a data.frame of the same dimensions. The function will be called with the entering/exiting layer data, except for the case of polygon- and path-like layers in which case the function recieves the entering/exiting polygon/path data one by one. A special option is to set a transformation as \code{NULL} instead of a function. In that case the entering and exiting data will simply appear/disappear when it is no longer part of a frame. } \section{Modification composition}{ Enter and exit modifications are composable so that multiple different ones can be added to an animation and will be applied in turn. You can also combine multiples and save them as a new enter or exit modification using \code{c()}. Due to the composable nature of enter and exit modifications it is not possible to overwrite a prior modification by adding a new. If it is needed to start from scratch then the sentinels \code{enter_reset()} and \code{exit_reset()} are provided which clears all prior modifications. } \section{Modification types}{ A range of modification types are provided by \code{gganimate} and using \code{enter_manual()}/\code{exit_manual()} or modification composition it is possible to create your own. \strong{appear}/\strong{disappear} will simply make elements appear/disappear at either the start or end of the transition. The default if nothing else is added. \strong{fade} will simply set the alpha value to zero making the elements fade in/out during the transition. \strong{grow}/\strong{shrink} will set the elements to zero size making them gradually grow into / shrink out of existence. Zero size depends on the type of layer, e.g. polygons/paths will have all their points set to the mean, while points will have size/stroke set to zero. \strong{recolour}/\strong{recolor} will change the colour and/or fill of the elements making them gradually change from the defined colour and into their try colour. Be aware that unless the colour and fill are set to the same as the background colour of the plot this modification needs to be combined with others to ensure that elements does not abruptly appear. \strong{fly} will set a specific x and y position where all elements will enter from/ exit to, irrespectible of their real position. \strong{drift} will modify the real position of the entering and exiting elements by a specified amount, e.g. setting \code{x_mod = -5} will let all elements enter from/exit to the left with a terminal position 5 points to the left of the real position. } \examples{ # Default is appear/disappear anim <- ggplot(mtcars, aes(factor(gear), mpg)) + geom_boxplot() + transition_states(gear, 2, 1) # Fade-in, fly-out anim1 <- anim + enter_fade() + exit_fly(x_loc = 7, y_loc = 40) # Enter and exit accumulates anim2 <- anim + enter_fade() + enter_grow() + exit_fly(x_loc = 7, y_loc = 40) + exit_recolour(fill = 'forestgreen') } gganimate/man/view_follow.Rd 0000644 0001762 0000144 00000003556 13611331661 015616 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/view-follow.R \name{view_follow} \alias{view_follow} \title{Let the view follow the data in each frame} \usage{ view_follow( fixed_x = FALSE, fixed_y = FALSE, exclude_layer = NULL, aspect_ratio = 1 ) } \arguments{ \item{fixed_x, fixed_y}{Either a logical indicating if the dimension should not be modified by the view, or a numeric vector giving the lower and upper bounds of the dimension. For the latter, an \code{NA} value will be substituted for whatever is calculated by the view (e.g. \code{fixed_x = c(0, NA)}) will fix the minimum x value to 0 and let the view calculate the upper bound.} \item{exclude_layer}{Integer vector of layer indices that should be ignored when calculating the view} \item{aspect_ratio}{If the coord is fixed, ensure that the view matches the given aspect ratio. Will override anything given in \code{fixed_x}/\code{fixed_y}} } \description{ This view will set the panels to include the data present in the frame. } \examples{ anim <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 4, state_length = 1) + view_follow() # Fixing a dimension can be done in general anim1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 4, state_length = 1) + view_follow(fixed_x = TRUE) # ...or just for one side of the range anim1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 4, state_length = 1) + view_follow(fixed_x = c(4, NA), fixed_y = c(2, NA)) } \seealso{ Other views: \code{\link{view_static}()}, \code{\link{view_step}()}, \code{\link{view_zoom}()} } \concept{views} gganimate/man/view_zoom.Rd 0000644 0001762 0000144 00000011353 14276661117 015304 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/view-zoom.R, R/view-zoom-manual.R \name{view_zoom} \alias{view_zoom} \alias{view_zoom_manual} \title{Pan and zoom smoothly between different states} \usage{ view_zoom( pause_length = 1, step_length = 1, nsteps = NULL, look_ahead = 0, delay = 0, include = FALSE, pan_zoom = 0, ease = "sine-in-out", wrap = TRUE, pause_first = TRUE, fixed_x = FALSE, fixed_y = FALSE, exclude_layer = NULL, aspect_ratio = 1 ) view_zoom_manual( pause_length = 1, step_length = 1, xmin, xmax, ymin, ymax, delay = 0, pan_zoom = 0, ease = "sine-in-out", wrap = TRUE, pause_first = TRUE, fixed_x = FALSE, fixed_y = FALSE, exclude_layer = NULL, aspect_ratio = 1 ) } \arguments{ \item{pause_length}{The relative length the view will be kept static. Will be recycled to match the number of steps} \item{step_length}{The relative length the view will use to transition to the new position. Will be recycled to match the number of steps} \item{nsteps}{The number of steps. If \code{NULL} it will be set to the max length of \code{pause_length} or \code{step_length}} \item{look_ahead}{A relative length to look ahead in the animation to get the new zoom area. Allow the view to zoom to where the data will be} \item{delay}{A relative length to switch the view back and forth relative to the actual frames. E.g. if delay is calculated to 5 frames, frame 6 will get the view intended for frame 1.} \item{include}{Should the steps include both the start and end frame range} \item{pan_zoom}{The tradeoff between pan- and zoom-induced movement. Negative values will value zoom over pan and positive values will value pan over zoom} \item{ease}{The easing function used for the step} \item{wrap}{As in \code{\link[=transition_states]{transition_states()}}. Should the view wrap around and zoom back to the first state.} \item{pause_first}{Should the view start with a pause. The default is to start with a step so that it is aligned to the static period in \code{\link[=transition_states]{transition_states()}}} \item{fixed_x, fixed_y}{Either a logical indicating if the dimension should not be modified by the view, or a numeric vector giving the lower and upper bounds of the dimension. For the latter, an \code{NA} value will be substituted for whatever is calculated by the view (e.g. \code{fixed_x = c(0, NA)}) will fix the minimum x value to 0 and let the view calculate the upper bound.} \item{exclude_layer}{Integer vector of layer indices that should be ignored when calculating the view} \item{aspect_ratio}{If the coord is fixed, ensure that the view matches the given aspect ratio. Will override anything given in \code{fixed_x}/\code{fixed_y}} \item{xmin, xmax, ymin, ymax}{Vectors of even length defining the boundaries of the different views to go through} } \description{ This view is in many ways equivalent to \code{\link[=view_step]{view_step()}} and \code{\link[=view_step_manual]{view_step_manual()}} but instead of simply tweening the bounding box of each view it implement the smooth zoom and pan technique developed by Reach & North (2018). It gradually zooms out and then in during the pan to allow a smooth transition of the view. As with \code{\link[=view_step]{view_step()}} the standard version will look at the data present in the calculated frames and set the ranges based on that, while the \verb{_manual} version will allow you to define your own ranges to zoom between. } \examples{ anim <- ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + shadow_mark(past = TRUE, future = TRUE, colour = 'grey') + view_zoom(pause_length = 1, step_length = 2, nsteps = 3) # Use pan_zoom to change the relationship between pan- and zoom movement # Mainly zooming anim1 <- ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + shadow_mark(past = TRUE, future = TRUE, colour = 'grey') + view_zoom(pause_length = 1, step_length = 2, nsteps = 3, pan_zoom = -3) # Mainly panning anim2 <- ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) + geom_point() + transition_states(Species, transition_length = 2, state_length = 1) + shadow_mark(past = TRUE, future = TRUE, colour = 'grey') + view_zoom(pause_length = 1, step_length = 2, nsteps = 3, pan_zoom = -3) } \references{ Reach, A., North, C. (2018) \emph{Smooth, Efficient, and Interruptible Zooming and Panning}. IEEE Transactions on Visualization and Computer Graphics DOI:10.1109/TVCG.2018.2800013 } \seealso{ Other views: \code{\link{view_follow}()}, \code{\link{view_static}()}, \code{\link{view_step}()} } \concept{views} gganimate/man/transition_components.Rd 0000644 0001762 0000144 00000006237 14276661410 017726 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transition-components.R \name{transition_components} \alias{transition_components} \title{Transition individual components through their own lifecycle} \usage{ transition_components( time, range = NULL, enter_length = NULL, exit_length = NULL, id ) } \arguments{ \item{time}{The unquoted name of the column holding the time for each state of the components} \item{range}{The range the animation should span. Defaults to the range of time plus enter and exit length} \item{enter_length, exit_length}{How long time should be spend on enter and exit transitions. Defaults to 0} \item{id}{\strong{Deprecated}} } \description{ This transition allows individual visual components to define their own "life-cycle". This means that the final animation will not have any common "state" and "transition" phase as any component can be moving or static at any point in time. } \section{Label variables}{ \code{transition_components} makes the following variables available for string literal interpretation, in addition to the general ones provided by \code{\link[=animate]{animate()}}: \itemize{ \item \strong{frame_time} gives the time that the current frame corresponds to } } \section{Object permanence}{ \code{transition_components} uses the group aesthetic of each layer to identify which rows in the input data correspond to the same graphic element and will therefore define stages in time that the element will animate through. The group aesthetic, if not set, will be calculated from the interaction of all discrete aesthetics in the layer (excluding \code{label}), so it is often better to set it explicitly when animating, to make sure your data is interpreted in the right way. If the group aesthetic is not set, and no discrete aesthetics exists then all rows will have the same group. } \section{Computed Variables}{ It is possible to use variables calculated by the statistic to define the transition. Simply inclose the variable in \code{stat()} in the same way as when using computed variables in aesthetics. } \examples{ data <- data.frame( x = runif(10), y = runif(10), size = sample(1:3, 10, TRUE), time = c(1, 4, 6, 7, 9, 6, 7, 8, 9, 10), id = rep(1:2, each = 5) ) anim <- ggplot(data, aes(x, y, group = id, size = size)) + geom_point() + transition_components(time) # By default the time range is set to the range of the time variable (plus # any enter and exit length), but this can be overwritten anim2 <- ggplot(data, aes(x, y, group = id, size = size)) + geom_point() + transition_components(time, range = c(4, 8)) # If you are using any enter/exit functions you need to give them some time anim3 <- ggplot(data, aes(x, y, group = id, size = size)) + geom_point() + transition_components(time, enter_length = 2, exit_length = 2) + enter_grow() + exit_fade() } \seealso{ Other transitions: \code{\link{transition_events}()}, \code{\link{transition_filter}()}, \code{\link{transition_layers}()}, \code{\link{transition_manual}()}, \code{\link{transition_null}()}, \code{\link{transition_reveal}()}, \code{\link{transition_states}()}, \code{\link{transition_time}()} } \concept{transitions} gganimate/man/shadow_null.Rd 0000644 0001762 0000144 00000000666 13611331661 015600 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/shadow-null.R \name{shadow_null} \alias{shadow_null} \title{A non-existent shadow} \usage{ shadow_null() } \description{ This is the default shadow that simply doesn't show anything other than the data for the current frame. } \seealso{ Other shadows: \code{\link{shadow_mark}()}, \code{\link{shadow_trail}()}, \code{\link{shadow_wake}()} } \concept{shadows} gganimate/man/gganimate-package.Rd 0000644 0001762 0000144 00000004046 14277415605 016614 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/gganimate-package.r \docType{package} \name{gganimate-package} \alias{gganimate-package} \alias{_PACKAGE} \title{gganimate: A Grammar of Animated Graphics} \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} The grammar of graphics as implemented in the 'ggplot2' package has been successful in providing a powerful API for creating static visualisation. In order to extend the API for animated graphics this package provides a completely new set of grammar, fully compatible with 'ggplot2' for specifying transitions and animations in a flexible and extensible way. } \section{Good starting points}{ The \code{\link[=animate]{animate()}} function documentation describes how to specify how the animation is rendered, whereas the documentation for the different transition functions, e.g. \code{\link[=transition_states]{transition_states()}}, describe how to declare the animation. Both \code{\link[=ease_aes]{ease_aes()}} and the different \link[=enter_exit]{enter and exit} functions are good to understand in order to modify tweening of the animation. Apart from the included documentation there is also a few web ressources worth mentioning: \itemize{ \item The \href{https://github.com/thomasp85/gganimate/wiki}{gganimate wiki} includes user supplied example walkthroughs \item The \href{https://github.com/ropensci-archive/learngganimate}{learngganimate} project by rOpenSci Labs includes a long range of detailed explorations of the different gganimate functions } } \seealso{ Useful links: \itemize{ \item \url{https://gganimate.com} \item \url{https://github.com/thomasp85/gganimate} \item Report bugs at \url{https://github.com/thomasp85/gganimate/issues} } } \author{ \strong{Maintainer}: Thomas Lin Pedersen \email{thomasp85@gmail.com} (\href{https://orcid.org/0000-0002-5147-4711}{ORCID}) Authors: \itemize{ \item David Robinson \email{admiral.david@gmail.com} } Other contributors: \itemize{ \item RStudio [copyright holder] } } gganimate/man/shadow_wake.Rd 0000644 0001762 0000144 00000005203 13611331661 015545 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/shadow-wake.R \name{shadow_wake} \alias{shadow_wake} \title{Show preceding frames with gradual falloff} \usage{ shadow_wake( wake_length, size = TRUE, alpha = TRUE, colour = NULL, fill = NULL, falloff = "cubic-in", wrap = TRUE, exclude_layer = NULL, exclude_phase = c("enter", "exit") ) } \arguments{ \item{wake_length}{A number between 0 and 1 giving the length of the wake, in relation to the total number of frames.} \item{size}{Numeric indicating the size the wake should end on. If \code{NULL} then size is not modified. Can also be a boolean with \code{TRUE} beeing equal \code{0} and \code{FALSE} beeing equal to \code{NULL}} \item{alpha}{as \code{size} but for alpha modification of the wake} \item{colour, fill}{colour or fill the wake should end on. If \code{NULL} they are not modified.} \item{falloff}{An easing function that control how size and/or alpha should change.} \item{wrap}{Should the shadow wrap around, so that the first frame will get shadows from the end of the animation.} \item{exclude_layer}{Indexes of layers that should be excluded.} \item{exclude_phase}{Element phases that should not get a shadow. Possible values are \code{'enter'}, \code{'exit'}, \code{'static'}, \code{'transition'}, and \code{'raw'}. If \code{NULL} all phases will be included. Defaults to \code{'enter'} and \code{'exit'}} } \description{ This shadow is meant to draw a small wake after data by showing the latest frames up to the current. You can choose to gradually diminish the size and/or opacity of the shadow. The length of the wake is not given in absolute frames as that would make the animation susceptible to changes in the framerate. Instead it is given as a proportion of the total length of the animation. } \examples{ anim <- ggplot(iris, aes(Petal.Length, Sepal.Length)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 4, state_length = 1) # `shadow_wake` can be combined with e.g. `transition_states` to show # motion of geoms as they are in transition with respect to the selected state. anim1 <- anim + shadow_wake(wake_length = 0.05) # Different qualities can be manipulated by setting a value for it that it # should taper off to anim2 <- anim + shadow_wake(0.1, size = 10, alpha = FALSE, colour = 'grey92') # Use `detail` in the `animate()` call to increase the number of calculated # frames and thus make the wake smoother \dontrun{ animate(anim2, detail = 5) } } \seealso{ Other shadows: \code{\link{shadow_mark}()}, \code{\link{shadow_null}()}, \code{\link{shadow_trail}()} } \concept{shadows} gganimate/man/shadow_trail.Rd 0000644 0001762 0000144 00000002755 13611331661 015742 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/shadow-trail.R \name{shadow_trail} \alias{shadow_trail} \title{A trail of evenly spaced old frames} \usage{ shadow_trail(distance = 0.05, max_frames = Inf, ..., exclude_layer = NULL) } \arguments{ \item{distance}{The temporal distance between the frames to show, as a fraction of the full animation length} \item{max_frames}{The maximum number of shadow frames to show} \item{...}{changes to the shadow data, e.g. \code{alpha = alpha/2} or \code{colour = 'grey'}} \item{exclude_layer}{Indexes of layers that should be excluded.} } \description{ This shadow will trace the movement in your animation by keeping every \emph{n}th frame and will thus produce a breadcrumb-like trail. Note that the shadow frames will not be equidistant in space but in time (that is, if a point moves slowly the \emph{crumbs} will be closer to each other). It is possible to modify the look of the shadow by changing the different graphic parameters in the data } \examples{ anim <- ggplot(airquality, aes(Day, Temp, colour = factor(Month))) + geom_point() + transition_time(Day) # Change distance between points anim1 <- anim + shadow_trail(0.02) # Style shadow differently anim2 <- anim + shadow_trail(alpha = 0.3, shape = 2) # Restrict the shadow to 10 frames anim3 <- anim + shadow_trail(max_frames = 10) } \seealso{ Other shadows: \code{\link{shadow_mark}()}, \code{\link{shadow_null}()}, \code{\link{shadow_wake}()} } \concept{shadows} gganimate/man/transition_null.Rd 0000644 0001762 0000144 00000001152 13611331661 016474 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transition-null.R \name{transition_null} \alias{transition_null} \title{Keep all data constant across the animation} \usage{ transition_null() } \description{ Keep all data constant across the animation } \seealso{ Other transitions: \code{\link{transition_components}()}, \code{\link{transition_events}()}, \code{\link{transition_filter}()}, \code{\link{transition_layers}()}, \code{\link{transition_manual}()}, \code{\link{transition_reveal}()}, \code{\link{transition_states}()}, \code{\link{transition_time}()} } \concept{transitions} gganimate/man/renderers.Rd 0000644 0001762 0000144 00000011244 13617340676 015260 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/renderers.R \name{renderers} \alias{renderers} \alias{gifski_renderer} \alias{file_renderer} \alias{av_renderer} \alias{ffmpeg_renderer} \alias{magick_renderer} \alias{sprite_renderer} \title{Renderers provided by gganimate} \usage{ gifski_renderer(file = NULL, loop = TRUE, width = NULL, height = NULL) file_renderer(dir = ".", prefix = "gganim_plot", overwrite = FALSE) av_renderer(file = NULL, vfilter = "null", codec = NULL, audio = NULL) ffmpeg_renderer( format = "auto", ffmpeg = NULL, options = list(pix_fmt = "yuv420p") ) magick_renderer(loop = TRUE) sprite_renderer() } \arguments{ \item{file}{The animation file} \item{loop}{Logical. Should the produced gif loop} \item{width, height}{Dimensions of the animation in pixels. If \code{NULL} will take the dimensions from the frame, otherwise it will rescale it.} \item{dir}{The directory to copy the frames to} \item{prefix}{The filename prefix to use for the image files} \item{overwrite}{Logical. If TRUE, existing files will be overwritten.} \item{vfilter}{A string defining an ffmpeg filter graph. This is the same parameter as the \code{-vf} argument in the \code{ffmpeg} command line utility.} \item{codec}{The name of the video codec. The default is \code{libx264} for most formats, which usually the best choice. See the \code{av} documentation for more information.} \item{audio}{An optional file with sounds to add to the video} \item{format}{The video format to encode the animation into} \item{ffmpeg}{The location of the \code{ffmpeg} executable. If \code{NULL} it will be assumed to be on the search path} \item{options}{Either a character vector of command line options for ffmpeg or a named list of option-value pairs that will be converted to command line options automatically} } \value{ The provided renderers are factory functions that returns a new function that take \code{frames} and \code{fps} as arguments, the former being a character vector with file paths to the images holding the separate frames, in the order they should appear, and the latter being the framerate to use for the animation in frames-per-second. The return type of the different returned renderers are: \itemize{ \item \strong{\code{gifski_renderer}}: Returns a \link{gif_image} object \item \strong{\code{magick_renderer}}: Returns a \code{magick-image} object \item \strong{\code{av_renderer}}: Returns a \link{video_file} object \item \strong{\code{ffmpeg_renderer}}: Returns a \link{video_file} object \item \strong{\code{file_renderer}}: Returns a vector of file paths } } \description{ The purpose of the renderer function is to take a list of image files and assemble them into an animation. \code{gganimate} provide a range of renderers but it is also possible to provide your own, if the supplied ones are lacking in any way. A renderer is given as argument to \code{\link[=animate]{animate()}}/print() and receives the paths to the individual frames once they have been created. } \details{ The \code{gifski_renderer()} is used unless otherwise specified in \code{\link[=animate]{animate()}} or in \code{options('gganimate.renderer')}. This renderer requires both the \code{gifski} and \code{png} packages to be installed. Other possible renderers are: \itemize{ \item \code{magick_renderer()} which requires the \code{magick} package and produce a \code{gif}. If \code{gifski} is not installed, the rendering will be much slower than using the \code{gifski_renderer()} and can potentially result in system problems when many frames need to be rendered (if \code{gifski} is installed \code{magick} will use it under the hood) \item \code{av_renderer()} which requies the \code{av} package and uses ffmpeg to encode the animation into a video file. \item \code{ffmpeg_renderer()} which requires that ffmpeg has been installed on your computer. As with \code{av_renderer()} it will use ffmpeg to encode the animation into a video \item \code{sprite_renderer()} which requires \code{magick} and will render the animation into a spritesheet \item \code{file_renderer()} which has no dependencies and simply returns the animation as a list of image files (one for each frame) } It is possible to create your own renderer function providing that it matches the required signature (\code{frames} and \code{fps} argument). The return value of your provided function will be the return value ultimately given by \code{\link[=animate]{animate()}} } \examples{ anim <- ggplot(mtcars, aes(mpg, disp)) + transition_states(gear, transition_length = 2, state_length = 1) + enter_fade() + exit_fade() \dontrun{ # Renderers are specified in the `animate()` function animate(anim, renderer = sprite_renderer()) } } gganimate/man/gif_file.Rd 0000644 0001762 0000144 00000002411 13701271006 015007 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/renderers.R \name{gif_file} \alias{gif_file} \alias{gif_image} \alias{print.gif_image} \alias{knit_print.gif_image} \alias{split.gif_image} \title{Wrap a gif file for easy handling} \usage{ gif_file(file) \method{print}{gif_image}(x, ...) knit_print.gif_image(x, options, ...) \method{split}{gif_image}(x, f, drop = FALSE, ...) } \arguments{ \item{file}{The gif file to be wrapped} \item{x}{A \code{gif_image} object} \item{...}{Arguments passed on} \item{f}{a ‘factor’ in the sense that \link[base:factor]{as.factor(f)} defines the grouping, or a list of such factors in which case their interaction is used for the grouping.} \item{drop}{logical indicating if levels that do not occur should be dropped (if \code{f} is a \code{factor} or a list).} } \value{ \code{gif_file} returns a \code{gif_image} object. \code{split} returns a list of \code{magick-image} objects and requires magick to work. } \description{ This is a simple class for gif files that takes care printing the file correctly in different environment (e.g. knitr, RStudio, etc.). If your renderer produces a gif file you can wrap the final output in \code{gif_file} to get all of these benefits for free. } \keyword{internal} gganimate/man/anim_save.Rd 0000644 0001762 0000144 00000002324 13701270201 015204 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/anim_save.R \name{anim_save} \alias{anim_save} \title{Save an animation to a file} \usage{ anim_save(filename, animation = last_animation(), path = NULL, ...) } \arguments{ \item{filename}{File name to create on disk.} \item{animation}{The animation object to save, as returned by \code{\link[=animate]{animate()}}. Defaults to the last rendered animation using \code{\link[=last_animation]{last_animation()}}} \item{path}{Path of the directory to save plot to: \code{path} and \code{filename} are combined to create the fully qualified file name. Defaults to the working directory.} \item{...}{arguments passed on to \code{\link[=animate]{animate()}} if \code{animation} is a \code{gganim} object} } \description{ This function is analogous to \code{\link[ggplot2:ggsave]{ggplot2::ggsave()}} in that it by default takes the last created animation and saves it to the specific location. As \code{gganimate} supports arbitrary renderers, and thus return types, the returned object must implement a \code{save_animation} method to be able to be used with \code{anim_save()}. This is provided natively for \code{gif_image} and \code{magick-image} objects. } gganimate/man/save_animation.Rd 0000644 0001762 0000144 00000000736 13405665100 016253 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/anim_save.R \name{save_animation} \alias{save_animation} \title{Infrastructure for animation saving} \usage{ save_animation(animation, file) } \arguments{ \item{animation}{The animation object to save} \item{file}{The file path to save it to} } \description{ Any returned animation object that wish to support \code{\link[=anim_save]{anim_save()}} need to implement this method } \keyword{internal} gganimate/man/ease_aes.Rd 0000644 0001762 0000144 00000004230 13406137600 015014 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ease-aes.R \name{ease_aes} \alias{ease_aes} \title{Control easing of aesthetics} \usage{ ease_aes(default = "linear", ...) } \arguments{ \item{default}{The default easing function to use (defaults to \code{'linear'})} \item{...}{Override easing for specific aesthetics} } \description{ Easing defines how a value change to another during tweening. Will it progress linearly, or maybe start slowly and then build up momentum. In \code{gganimate}, each aesthetic or computed variable can be tweened with individual easing functions using the \code{ease_aes()} function. All easing functions implemented in \code{tweenr} are available, see \link[tweenr:display_ease]{tweenr::display_ease} for an overview. Setting an ease for \code{x} and/or \code{y} will also affect the other related positional aesthetics (e.g. \code{xmin}, \code{yend}, etc). } \section{Easing functions}{ \itemize{ \item \strong{quadratic} Models a power-of-2 function \item \strong{cubic} Models a power-of-3 function \item \strong{quartic} Models a power-of-4 function \item \strong{quintic} Models a power-of-5 function \item \strong{sine} Models a sine function \item \strong{circular} Models a pi/2 circle arc \item \strong{exponential} Models an exponential function \item \strong{elastic} Models an elastic release of energy \item \strong{back} Models a pullback and relase \item \strong{bounce} Models the bouncing of a ball } \emph{Modifiers} \cr \itemize{ \item \strong{-in} The easing function is applied as-is \item \strong{-out} The easing function is applied in reverse \item \strong{-in-out} The first half of the transition it is applied as-is, while in the last half it is reversed } } \examples{ anim <- ggplot(mtcars, aes(mpg, disp)) + transition_states(gear, transition_length = 2, state_length = 1) + enter_fade() + exit_fade() \dontrun{ # Default uses linear easing animate(anim) } # Change all to 'cubic-in-out' for a smoother appearance anim1 <- anim + ease_aes('cubic-in-out') \dontrun{ animate(anim1) } # Only change easing of y variables anim2 <- anim + ease_aes(y = 'bounce-in') \dontrun{ animate(anim2) } } gganimate/man/last_animation.Rd 0000644 0001762 0000144 00000000523 14022633550 016252 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/animation_store.R \name{last_animation} \alias{last_animation} \alias{set_last_animation} \title{Retrieve the last rendered animation} \usage{ last_animation() set_last_animation(value) } \description{ Retrieve the last rendered animation } \keyword{internal} gganimate/man/shadow_mark.Rd 0000644 0001762 0000144 00000002775 13611331661 015563 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/shadow-mark.R \name{shadow_mark} \alias{shadow_mark} \title{Show original data as background marks} \usage{ shadow_mark(past = TRUE, future = FALSE, ..., exclude_layer = NULL) } \arguments{ \item{past}{Should raw data from earlier in the animation be shown} \item{future}{Should raw data from later in the animation be shown} \item{...}{changes to the shadow data, e.g. \code{alpha = alpha/2} or \code{colour = 'grey'}} \item{exclude_layer}{Indexes of layers that should be excluded.} } \description{ This shadow lets you show the raw data behind the current frame. Both past and/or future raw data can be shown and styled as you want. } \examples{ # Use any of the aesthetics to add a style to either the past or the future raw data. # Adding a grouping variable in a transition call prior to calling `shadow_mark()` will # allow transitioning through different states in time. p1 <- ggplot(airquality, aes(Day, Temp)) + geom_line(color = 'red', size = 1) + transition_time(Month) + shadow_mark(colour = 'black', size = 0.75) # animate(p1) # Add a future = TRUE argument to show data later in the animation. p2 <- ggplot(airquality, aes(Day, Temp)) + geom_line(color = 'red', size = 1) + transition_time(Month) + shadow_mark(color = 'black', size = 0.75, past = FALSE, future = TRUE) # animate(p2) } \seealso{ Other shadows: \code{\link{shadow_null}()}, \code{\link{shadow_trail}()}, \code{\link{shadow_wake}()} } \concept{shadows} gganimate/man/transition_time.Rd 0000644 0001762 0000144 00000006430 14276661410 016472 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transition-time.R \name{transition_time} \alias{transition_time} \title{Transition through distinct states in time} \usage{ transition_time(time, range = NULL) } \arguments{ \item{time}{An unquoted expression giving the time, and thus state membership, of each observation.} \item{range}{The time range to animate. If \code{NULL} it will be set to the range of \code{time}} } \description{ This is a variant of \code{\link[=transition_states]{transition_states()}} that is intended for data where the states are representing specific point in time. The transition length between the states will be set to correspond to the actual time difference between them. } \section{Label variables}{ \code{transition_time} makes the following variables available for string literal interpretation, in addition to the general ones provided by \code{\link[=animate]{animate()}}: \itemize{ \item \strong{frame_time} gives the time that the current frame corresponds to } } \section{Object permanence}{ \code{transition_time} uses the group aesthetic of each layer to identify which rows in the input data correspond to the same graphic element and will therefore define which elements will turn into each other between time points. The group aesthetic, if not set, will be calculated from the interaction of all discrete aesthetics in the layer (excluding \code{label}), so it is often better to set it explicitly when animating, to make sure your data is interpreted in the right way. If the group aesthetic is not set, and no discrete aesthetics exists then all rows will have the same group. If the group aesthetic is not unique in each state, then rows will be matched first by group and then by index. Unmatched rows will appear/disappear, potentially using an enter or exit function. } \section{Computed Variables}{ It is possible to use variables calculated by the statistic to define the transition. Simply inclose the variable in \code{stat()} in the same way as when using computed variables in aesthetics. } \examples{ anim <- ggplot(airquality, aes(Day, Temp)) + geom_point(aes(colour = factor(Month))) + transition_time(Day) # Removing a time point will prolong the tweening between neighbouring time # points so the time dimension stays linear airquality_missing <- airquality[airquality$Day <= 10 | airquality$Day >= 20, ] anim1 <- ggplot(airquality_missing, aes(Day, Temp)) + geom_point(aes(colour = factor(Month))) + transition_time(Day) # Range can be constrained if needed anim2 <- ggplot(airquality, aes(Day, Temp)) + geom_point(aes(colour = factor(Month))) + transition_time(Day, range = c(10L, 20L)) # The group aesthetic is used to connect elements # No grouping anim3 <- ggplot(airquality, aes(Day, Temp)) + geom_line() + transition_time(Month) # Group by month anim4 <- ggplot(airquality, aes(Day, Temp)) + geom_line(aes(group = Month)) + transition_time(Month) + enter_fade() + exit_fade() } \seealso{ Other transitions: \code{\link{transition_components}()}, \code{\link{transition_events}()}, \code{\link{transition_filter}()}, \code{\link{transition_layers}()}, \code{\link{transition_manual}()}, \code{\link{transition_null}()}, \code{\link{transition_reveal}()}, \code{\link{transition_states}()} } \concept{transitions} gganimate/man/transition_states.Rd 0000644 0001762 0000144 00000007521 14276661410 017041 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/transition-states.R \name{transition_states} \alias{transition_states} \title{Transition between several distinct stages of the data} \usage{ transition_states(states, transition_length = 1, state_length = 1, wrap = TRUE) } \arguments{ \item{states}{The unquoted name of the column holding the state levels in the data.} \item{transition_length}{The relative length of the transition. Will be recycled to match the number of states in the data} \item{state_length}{The relative length of the pause at the states. Will be recycled to match the number of states in the data} \item{wrap}{Should the animation \emph{wrap-around}? If \code{TRUE} the last state will be transitioned into the first.} } \description{ This transition splits your data into multiple states based on the levels in a given column, much like \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}} splits up the data in multiple panels. It then tweens between the defined states and pauses at each state. Layers with data without the specified column will be kept constant during the animation (again, mimicking \code{facet_wrap}). } \section{Label variables}{ \code{transition_states} makes the following variables available for string literal interpretation, in addition to the general ones provided by \code{\link[=animate]{animate()}}: \itemize{ \item \strong{transitioning} is a boolean indicating whether the frame is part of the transitioning phase \item \strong{previous_state} The name of the last state the animation was at \item \strong{closest_state} The name of the state closest to this frame \item \strong{next_state} The name of the next state the animation will be part of } } \section{Object permanence}{ \code{transition_states} uses the group aesthetic of each layer to identify which rows in the input data correspond to the same graphic element and will therefore define which elements will turn into each other between states. The group aesthetic, if not set, will be calculated from the interaction of all discrete aesthetics in the layer (excluding \code{label}), so it is often better to set it explicitly when animating, to make sure your data is interpreted in the right way. If the group aesthetic is not set, and no discrete aesthetics exists then all rows will have the same group. If the group aesthetic is not unique in each state, then rows will be matched first by group and then by index. Unmatched rows will appear/disappear, potentially using an enter or exit function. } \section{Computed Variables}{ It is possible to use variables calculated by the statistic to define the transition. Simply inclose the variable in \code{stat()} in the same way as when using computed variables in aesthetics. } \examples{ anim <- ggplot(iris, aes(Sepal.Width, Petal.Width)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 3, state_length = 1) # Use a unique group to avoid matching graphic elements iris$group <- seq_len(nrow(iris)) anim1 <- ggplot(iris, aes(Sepal.Width, Petal.Width, group = group)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 3, state_length = 1) + enter_fade() + exit_fade() # Set `wrap = FALSE` to avoid transitioning the last state to the first anim2 <- ggplot(iris, aes(Sepal.Width, Petal.Width)) + geom_point() + labs(title = "{closest_state}") + transition_states(Species, transition_length = 3, state_length = 1, wrap = FALSE) } \seealso{ Other transitions: \code{\link{transition_components}()}, \code{\link{transition_events}()}, \code{\link{transition_filter}()}, \code{\link{transition_layers}()}, \code{\link{transition_manual}()}, \code{\link{transition_null}()}, \code{\link{transition_reveal}()}, \code{\link{transition_time}()} } \concept{transitions} gganimate/man/view_static.Rd 0000644 0001762 0000144 00000000630 13611331661 015571 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/view-static.R \name{view_static} \alias{view_static} \title{Keep a fixed view that include all of the data} \usage{ view_static() } \description{ This view keeps positional scales fixed across all frames } \seealso{ Other views: \code{\link{view_follow}()}, \code{\link{view_step}()}, \code{\link{view_zoom}()} } \concept{views} gganimate/man/figures/ 0000755 0001762 0000144 00000000000 14147730155 014434 5 ustar ligges users gganimate/man/figures/README-unnamed-chunk-4-1.gif 0000644 0001762 0000144 00002357660 14277415503 021136 0 ustar ligges users GIF89a à€ !ÿNETSCAPE2.0 !ù , à‡ æææÿÿÿÐÐÐêêêóóó÷÷÷ñññöööëëëîîîçççûûûùùùïïïðððìììýýýòòòõõõèèèôôôßßßÕÕÕüüüøøøgEnþþþíííÙÙÙæåå¬EYyyyÞÝÝGGGÈÈÈmDuËËËLLLOOO½½½~~~ŽŽŽÔÔÓƒƒƒSSSuuu'''ááápppCCC¦¦¦<<<ÎÎÎ WWW888ûúúÄÄÆ333###äããõÌ–---eeeõÇu@‚ŠŠŠŒ[—’’’¨©¨ÖZX¹¹¹££¤¯’¼bbbŸŸ –––ÂÁÂåäâô·z___”j¡œiL¶¶¶¤„²ššš………ÀÀÀõÁ…>JL†-|K…¯-à—TÁ¦ËYYY·œÂ±±±‘cœŸ}¬_"j@@@£.Ê„OÃyDˆU“n8zѽ×öÒ£“HÄMZÁâœMŒÕÄÙå¤eiii^“A’Q(Y/cn˜Y¬¢¢¢Ägò©xí„hâ[ð‘m›v©S0]ƒQ³³³C_£¸_+`Îè±\\\ÙŽM˶ÒßÍᮯ¯áÜ∈ˆÄÍg.t¸EY¿¾ÁGRöÙ±¸N»»»kkkÏÏÏØ„8˜a@êzdª‹¸Šºbò¡qËq)o£Mµ´µö¾z]]]p?èáÛB|%©3JéÖÄ×LG”B˜p§a8immmÛe^åÚÔëßϦÐûÙ‡ð®jUabŒRÖÍØ¸·¸ÝÑÞÝÖÞ¥UÕ¹¯ãiWªpLÖ«ª¹:MÝúòŸN¶j5’Æa§c7áŒ<“Y8Ò{0›Ès…C¤M(\PyCâËÆ3f#ÚäÐñÝ¿ëβïuH‰>¾‘tèr\Sëéê¿Ó°ê¼¦²';êȨâðÎâ‹Ò<9çÖèÈ¡™ÍÛÂÓ‡Œß™–¿€Q Ît«€Ñmq´ÚùË{QQ𲯩wW}ØéÃ[[[€:ãèÛÄw…ùìßdx°üę̈ùóêòëóïíïûõöûüúÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`¹®rÁ`Ÿ!
\
e<¡º¹óçÐWˆC„ÀÇFb¸ÀË‚Á,Luÿ*-PŠ‚–$`¡ÂÁ 18¨°-Y{(ä…Áü&P>èÝ&¨àD…Ñ -ØÁ@7ÄÇÙäGhœµ€…@?p_@ÁA
0~ô @CaÁÁÀ$
lrÃn9ðÀ@àp‚Di¤‚¬%1Þ ÔAB˜±CW8( !Âf´àˆ8 [) ‚ŸB-RÁuM– —q(„l!ÁGæ©çžMZ&Í·Ä@vF!@
N$0ìöä=Ôb8Q€ "ø Ÿ Zp0‚ "¨à¥{qƒ|¦ªêªVEáiA'àÿ°Â¬+L†Ä@ðš^úCµ(Àà`d € ;äÇA‚C°jíµØE²$1„+®k0ÊÁ'¨Áz? ldmð#x˜rÁŒÝÀs™HÃÙ,ðÀ7mÛ-A±FJk+ !Ð Üî»ÚT²E‘É-ÁAvlÁÍlòÉ(ŸdpAó±uÝøõð¥@;ÁLQ‹‡Ü'ÐjÁñ˜2šøuÊoÊL7í4F+tÀW¸àÁB
”à €g2äìî@fذÉB-FƒQ°àrŸ[ƒHàð7-´àÂÞ{Cÿñô߀^PÔs©{®R”GFh8Ȳ léÜï‰hÃ+šr`ƒñ`s±0øõXgý øé¨§>Ô€