animation.Rd
Animate graph components.
sg_animate(sg, mapping, options = list(easing = "cubicInOut"), delay = 5000)
sg | An object of class |
---|---|
mapping | Variables to map animation to. |
options | Animations options. |
delay | Delay in milliseconds before animation is triggered. |
An object of class htmlwidget
which renders the visualisation on print.
You can animate, x
, y
, size
and color
.
#> Warning: Argument `n` is deprecated# add transition n <- nrow(nodes) nodes$to_x <- runif(n, 5, 10) nodes$to_y <- runif(n, 5, 10) nodes$to_size <- runif(n, 5, 10) sigmajs() %>% sg_nodes(nodes, id, label, size, color, to_x, to_y, to_size) %>% sg_edges(edges, id, source, target) %>% sg_animate(mapping = list(x = "to_x", y = "to_y", size = "to_size"))