layout_registry: Layout Registry

layout_registryR Documentation

Layout Registry

Description

Layout algorithms are stored in a registry and selected by name through the layout argument of splot, soplot and sn_layout. register_layout() adds a layout function, get_layout() returns the function of a registered layout, and list_layouts() returns the names of all registered layouts. Registering an existing name replaces that layout for the rest of the session.

Usage

register_layout(name, layout_fn)

get_layout(name)

list_layouts()

Arguments

name

Character. The name of the layout.

layout_fn

A function that computes node positions. It receives the network as the argument network, followed by any layout parameters, and returns a matrix or data frame with x and y columns.

Value

register_layout() returns NULL invisibly. get_layout() returns the layout function, or NULL if no layout has that name. list_layouts() returns a character vector of layout names.

See Also

layout_circle, layout_spring, layout_groups, layout_oval

Examples

list_layouts()
splot(regulation_net, layout = "circle")

cograph documentation built on Nov. 19, 2026, 5:07 p.m.