powered by
Class for managing layout algorithms and computing node positions.
CographLayout$new()
CographLayout$compute()
CographLayout$normalize_coords()
CographLayout$get_type()
CographLayout$get_params()
CographLayout$print()
CographLayout$clone()
new()
Create a new CographLayout object.
CographLayout$new(type = "circle", ...)
type
Layout 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, ...)
network
A 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)
coords
Matrix or data frame with x, y columns.
padding
Numeric. Padding around edges (default 0.1).
Normalized coordinates.
get_type()
Get layout type.
Character string.
get_params()
Get layout parameters.
List of parameters.
print()
Print layout summary.
clone()
The objects of this class are cloneable with this method.
CographLayout$clone(deep = FALSE)
deep
Whether 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)
Run the code above in your browser using DataLab