Animation is a property of the plot, not a separate verb chain: the same
geometry pipeline runs once per level of by, and the interactive target
plays the resulting frames with a scrubber and play/pause control.
Because frames are ordinary geometry buffers, positions are interpolated
by the player rather than recomputed.
animate(by, duration = 800, easing = "cubic-in-out", loop = TRUE)An Animation spec to add to a plot with +.
Animated plots render to the interactive target (like interact()).
render(p, target = "static") still produces a static SVG of the whole
data, so animation never blocks a static export.
d <- data.frame(
x = rep(1:5, 3), y = c(1:5, (1:5)^1.5, (1:5)^2),
step = rep(c(1, 2, 3), each = 5)
)
p <- ggnext(d, aes(x, y)) + geom_point(size = 5) + animate(step)
html <- render(p)