| cgv_layout_fr | R Documentation |
Computes 3D (or 2D) node positions so that connected nodes settle at
approximately equal distance ideal_len, while non-adjacent nodes
repel each other. Implements the Fruchterman-Reingold algorithm with
linearly-cooling temperature, fully vectorized over nodes and edges.
cgv_layout_fr(
n_nodes,
edges,
n_iter = 300L,
ideal_len = NULL,
dim = 3L,
seed = NULL,
init = NULL,
cool = 0.98,
normalize = TRUE,
verbose = FALSE
)
n_nodes |
Integer. Number of nodes. |
edges |
Two-column integer matrix |
n_iter |
Integer. Number of iterations (default 300). |
ideal_len |
Numeric. Target edge length. If |
dim |
Integer, 2 or 3. Output dimensionality (default 3). |
seed |
Optional integer for reproducible initialization. |
init |
Optional |
cool |
Numeric in (0, 1]. Per-iteration temperature decay (default 0.98). |
normalize |
Logical. If |
verbose |
Logical. Print progress every 50 iterations. |
Numeric matrix n_nodes x dim of node coordinates.
edges <- cbind(c(1, 2, 3, 4), c(2, 3, 4, 1))
pos <- cgv_layout_fr(4, edges, n_iter = 200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.