Skip to content

Function: registerGraphLayout() ​

ts
function registerGraphLayout<Options>(name, layout): () => void;

Register a layout for arrangement: 'custom' with custom: { name, options }: the layout is called with the graph and custom.options, in calc. Registering a name again replaces it. Returns a function that removes the layout (only if it is still the one registered).

A layout must be deterministic and return a finite position for every node (see GraphLayout). Positions are layout units: the trace fits them to the plot area.

Type Parameters ​

Type ParameterDefault type
Optionsunknown

Parameters ​

ParameterType
namestring
layoutGraphLayout<Options>

Returns ​

() => void

Released under the MIT License.