click_to_play function

Click an element to play a frame

Click an element to play a frame

Playback option for the functions rmd_animate

and insert_animate .

click_to_play(selector = "#SVG_1", start = 2)

Arguments

  • selector: The ID of the DOM element.
  • start: An integer; the number of frames to execute upon the beginning of the visualisation. This is useful when one wants to start with some set-up instead of an empty canvas.

Examples

input <- tempfile(fileext = ".Rmd") output <- tempfile(fileext = ".html") writeLines(' ```{r, echo = FALSE, message = FALSE} # Run / include the following in a code chunk of an R Markdown document library(animate) insert_animate(system.file("tests/basic_points.json", package = "animate"), options = click_to_play())

', input) knitr::knit(input, output)

browseURL(output)

  • Maintainer: Chun Fung Kwok
  • License: MIT + file LICENSE
  • Last published: 2023-02-03