sg_layout {sigmajs} | R Documentation |
Layouts
Description
Layout your graph.
Usage
sg_layout(
sg,
directed = TRUE,
layout = igraph::layout_nicely,
save_igraph = TRUE,
...
)
sg_get_layout(
nodes,
edges,
directed = TRUE,
layout = igraph::layout_nicely,
save_igraph = TRUE,
...
)
Arguments
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. |
Details
The package uses igraph
internally for a lot of computations the save_igraph
allows saving the object to speed up subsequent computations.
Value
sg_get_layout
returns nodes with x
and y
coordinates.
Functions
sg_layout
layout your graph.sg_get_layout
helper to get graph'sx
andy
positions.
Examples
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)
[Package sigmajs version 0.1.5 Index]