Add start and stop animation buttons to image.

add_restart(
  input,
  location = c(0.05, 0.95),
  fill = "white",
  color = "black",
  radius = 20,
  start_label = "Start",
  stop_label = "Stop",
  font_family = "inherit",
  font_size = 14,
  openfile = TRUE,
  output = input
)

Arguments

input

File name of .svg file to input

location

a vector of coordinates for the start button

fill

button fill color

color

button text color

radius

button radius

start_label

start button text

stop_label

stop button text

font_family

button text font family

font_size

button text font size

openfile

Open file in default program for .svg format. Defaults to FALSE.

output

File name of .svg file to output. Default is to overwrite the input file.

Value

output name

Examples

.old_wd <- setwd(tempdir()) library(spiro) spiro(fixed_radius = 3, cycling_radius = 1, file = "image_spin.svg") %>% image_spin(rpm = 1) setwd(.old_wd)