| CographLayout | R Documentation |
Class for managing layout algorithms and computing node positions.
A CographLayout R6 object.
new()Create a new CographLayout object.
CographLayout$new(type = "circle", ...)
typeLayout type (e.g., "circle", "spring", "groups").
...Additional parameters for the layout algorithm.
A new CographLayout object.
compute()Compute layout coordinates for a network.
CographLayout$compute(network, ...)
networkA CographNetwork object.
...Additional parameters passed to the layout function.
Data frame with x, y coordinates.
normalize_coords()Normalize coordinates to 0-1 range with padding.
CographLayout$normalize_coords(coords, padding = 0.1)
coordsMatrix or data frame with x, y columns.
paddingNumeric. Padding around edges (default 0.1).
Normalized coordinates.
get_type()Get layout type.
CographLayout$get_type()
Character string.
get_params()Get layout parameters.
CographLayout$get_params()
List of parameters.
print()Print layout summary.
CographLayout$print()
clone()The objects of this class are cloneable with this method.
CographLayout$clone(deep = FALSE)
deepWhether to make a deep clone.
# Create a circular layout
layout <- CographLayout$new("circle")
# Apply to network
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- CographNetwork$new(adj)
coords <- layout$compute(net)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.