Skip to main content

Home > @jsplumbtoolkit/layout-hierarchy > HierarchyLayout

HierarchyLayout class

A new version of a hierarchy layout, which can better handle upstream links and multiple parents. This layout runs in 3 stages -

  1. placement of nodes into layers 2. reordering nodes in layers to minimise edge crossing 3. placement of nodes into final layout

In step (3) all nodes are currently centered around the midpoint of the chart, as opposed to being grouped below their parent; it is possible a future enhancement of this could offer the aligned on parent option but since multiple parents is one of the expected conditions for use for this layout it doesn't always make sense to align on the parent - the question being, which parent? update, 9/12/21 - i think it needs to be the midpoint of parents in the layer directly above.

Note also this layout currently ignores Ports. And probably Groups.

Signature:

export declare class HierarchyLayout extends AbsoluteBackedLayout<HierarchyLayoutParameters> 

Extends: AbsoluteBackedLayout<HierarchyLayoutParameters>

Constructors

ConstructorModifiersDescription
(constructor)(params)Constructs a new instance of the HierarchyLayout class

Properties

PropertyModifiersTypeDescription
axisnumber
defaultMagnetizedboolean
edgeNodeSizenumber
gatherUnattachedRootsboolean
invertboolean
maxIterationsnumber
maxIterationsWithoutImprovementnumber
modelHierarchyLayoutModel
oAxisnumber
placementStrategyPlacementStageStrategy
respectEdgeDirectionboolean
resultSetsArray<ResultSet>
rootNodeAbstractEdgeTerminus
typestring
typestaticstring
unattachedRootPaddingnumber

Methods

MethodModifiersDescription
begin(toolkit, parameters)
canMagnetize(id)
end(toolkit, parameters, wasMagnetized)
getDefaultParameters()
reset()
setRootNode(node)
step()