Interface AbstractHierarchicalLayoutParameters<T>

Base parameters for layouts that extend AbstractHierarchicalLayout.

interface AbstractHierarchicalLayoutParameters<T> {
    absoluteBacked?: boolean;
    getChildVertices?: HierarchicalLayoutChildVerticesFunction<T>;
    getRootNode?: ((toolkit) => Vertex[]);
    height?: number;
    ignoreLoops?: boolean;
    ignorePorts?: boolean;
    locationFunction?: LocationFunction;
    multipleRoots?: boolean;
    padding?: PointXY;
    rootNode?: Vertex[];
    width?: number;

Type Parameters

  • T extends HasId

Hierarchy (view full)


absoluteBacked?: boolean

Defaults to false. If true, then the layout will use any position values found in the data for a given vertex.

Optional function used to determine the edges to traverse to find children from some node

Param: node

Param: toolkit

getRootNode?: ((toolkit) => Vertex[])

Optional. A function that is given the Toolkit instance as argument and is expected to return either a single node/group, or an array of nodes/groups, to use as the root(s) for the layout

Type declaration

    • (toolkit): Vertex[]
    • Parameters

      Returns Vertex[]

height?: number

Optional fixed height for the layout.

ignoreLoops?: boolean

Defaults to true. If a loop is found during the layout it is usually ignored, unless this is set to true.

ignorePorts?: boolean

Defaults to false, meaning that ports are taken into account when figuring the list of edges from some vertex. If you set this to true, ports will be ignored and the layout will only consider edges connected directly to each vertex.

locationFunction?: LocationFunction

Optional function that, given some vertex, can provide the x/y location of the vertex on the canvas

multipleRoots?: boolean

Optional, defaults to true. If false, multiple roots are not supported, and assuming you have not overridden getRootNode, the layout uses the first node found in the dataset (otherwise it still uses the result of your getRootNode function)

padding?: PointXY

Optional padding to put around the elements.

rootNode?: Vertex[]

Optional. Defines the node/group to use as the root of the tree. This may be provided either as a node/group id or as a node/group object. If this parameter is not specified and multipleRoots is not false then the layout uses the result(s) of the getRootNode function; otherwise it uses the first node/group found in the dataset.

width?: number

Optional fixed width for the layout.