Animations can be created using the Animation
object or the new_animation
class. This object can be passed to fig_
functions.
library(g2r)
anim <- Animation$
new()$
appear(duration = 2500, delay = 1000)
iris %>%
g2(asp(Sepal.Length, Sepal.Width, color = Species)) %>%
fig_point(asp(shape = "circle"), anim)
The above only configures the animations of the plot appearing on the page, similar animations can be customised when the plot is updated or a figure removed though these will only be relevant shiny or rmarkdown where such events occur.