Description Usage Arguments Details Value Functions Examples
Layout your graph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
sg |
An object of class |
directed |
Whether or not to create a directed graph, passed to |
layout |
An |
save_igraph |
Whether to save the |
... |
Any other parameter to pass to |
nodes, edges |
Nodes and edges as prepared for sigmajs. |
The package uses igraph
internally for a lot of computations the save_igraph
allows saving the object to speed up subsequent computations.
sg_get_layout
returns nodes with x
and y
coordinates.
sg_layout
layout your graph.
sg_get_layout
helper to get graph's x
and y
positions.
1 2 3 4 5 6 7 8 9 | nodes <- sg_make_nodes(250) # 250 nodes
edges <- sg_make_edges(nodes, n = 500)
sigmajs() %>%
sg_nodes(nodes, id, size, color) %>%
sg_edges(edges, id, source, target) %>%
sg_layout()
nodes_coords <- sg_get_layout(nodes, edges)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.