force: Add forceAtlas2

Description Usage Arguments Details Value Functions See Also Examples

Description

Implementation of forceAtlas2.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

Arguments

sg

An object of class sigmajs as instantiated by sigmajs.

...

Any parameter, see official documentation.

delay

Milliseconds after which the layout algorithm should stop running.

proxy

An object of class sigmajsProxy as returned by sigmajsProxy.

refresh

Whether to refresh the graph after node is dropped, required to take effect.

data

data.frame holding delay column.

cumsum

Whether to compute the cumulative sum of the delay.

Details

The delay helps for build dynamic visualisations where nodes and edges do not appear all at the same time. How the delay works depends on the cumsum parameter. if TRUE the function computes the cumulative sum of the delay to effectively add each row one after the other: delay is thus applied at each row (number of seconds to wait before the row is added *since the previous row*). If FALSE this is the number of milliseconds to wait before the node or edge is added to the visualisation; delay is used as passed to the function.

Value

Their first arguments, either sg or proxy.

Functions

See Also

official documentation

Examples

1
2
3
4
5
6
7
8
nodes <- sg_make_nodes(50)
edges <- sg_make_edges(nodes, 100)

sigmajs() %>%
  sg_nodes(nodes, id, label, size) %>%
  sg_edges(edges, id, source, target) %>%
  sg_force() %>%
  sg_force_stop() # stop force after 5 seconds

JohnCoene/sigmajs documentation built on Feb. 1, 2021, 12:12 p.m.