This class offers advanced core functionality of the HierarchicalLayout algorithm which allows configurations and customizations and can be accessed via property core.
Remarks
Properties fromScratchLayerAssigner, fromScratchSequencer, fixedElementsLayerAssigner and fixedElementsSequencer allow to modify the layering and sequencing algorithms for calculating the hierarchical layout.
It is possible to customize various classes that are responsible to solve sub-problems during the HierarchicalLayout process, e.g., portAssigner, drawingDistanceCalculator or portCandidateSelector.
Furthermore, there are callback methods which can be overridden to realize highly customized scenarios, see for example createSubgraphLayerSequencer.
Default Values of Properties
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new HierarchicalLayoutCore instance with the default settings.
Properties
Gets or sets the ICoordinateAssigner instance that will calculate the final node coordinates.
Default Value
coordinateAssigner.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the
is null
Gets or sets the IDrawingDistanceCalculator instance responsible for determining the minimum distances between elements that belong to the same layer.
Remarks
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified
is null
Gets or sets the ILayerAssigner instance that obtains the layering for fixed nodes during the from sketch layout.
Default Value
FromSketchLayerAssigner.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the
is null
See Also
Gets or sets the ISequencer instance that calculates the sequence of the fixed nodes during the from sketch layout run.
Default Value
FromSketchSequencer.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given
is null
See Also
Gets or sets the ILayerAssigner instance that obtains the layering for the nodes if the layout algorithm does not run in from sketch mode.
Remarks
Default Value
A
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the
is null
See Also
Gets or sets the ISequencer instance that calculates the node sequence if the layout algorithm does not run in from sketch mode.
Default Value
DefaultSequencer.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the
is null
See Also
Gets or sets the IHierarchicalLayoutPortAssigner instance responsible for assigning port coordinates to the adjacent edges of each node.
Remarks
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified
is null
Gets or sets the IPortCandidateSelector instance responsible for optimizing the assignment of selected port candidates to the adjacent edges of each node.
Property Value
Gets or sets whether or not to stop the layout algorithm after the layering step.
Remarks
By then, each node will be assigned to a layer. Since the sequencing and drawing phases are skipped, the order of the nodes within a layer matches the initial order of the nodes, edges won't be routed and the nodes won't get coordinates assigned.
The calculated layering information can be retrieved from layerIndicesResult.
Default Value
false
.The algorithm calculates the complete layout.
Property Value
true
if the layout algorithm should stop after the layering phase, false
if the complete layout should be calculatedSee Also
Gets or sets whether or not to stop the layout algorithm after the sequencing step.
Remarks
By then, each node will be assigned to a layer and will have a place in the sequence of nodes in this layer. Since the drawing phase is skipped, edges won't be routed and the nodes won't get coordinates assigned.
The calculated layering and sequencing information can be retrieved from layerIndicesResult and sequenceIndicesResult.
Default Value
false
.The algorithm calculates the complete layout.
Property Value
true
if the layout algorithm should stop after the sequencing phase, false
if the complete layout should be calculatedSee Also
Methods
Factory method called during applyLayoutCore and creates an appropriate ILayerAssigner implementation.
Remarks
Returns
- ↪ILayerAssigner
- an ILayerAssigner implementation
Callback method that is called during applyLayoutCore that creates the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances for nodes and edges and binds them to the items using ItemFactory.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The input graph
- layoutContext - HierarchicalLayoutContext
- The HierarchicalLayoutContext providing access to the ItemFactory instance
Factory method called during applyLayoutCore which creates a ISequencer that sequences the items that are incrementally inserted.
Remarks
By default, a suitable private implementation of ISequencer is returned. It may be overridden to return custom implementations of the ISequencer interface.
This sequencer instance is only relevant if the hierarchical layout runs in from sketch mode
Returns
- ↪ISequencer
- a ISequencer implementation
Disposes of this instance by undoing preparation steps done during prepare.
Remarks
This method is called by HierarchicalLayout after the actual layout is calculated. It may be overridden in order to revert a custom configuration made in prepare.
This implementation will remove the PortCandidateSelector that was created in case nodePortCandidates are defined and no portCandidateSelector was initially assigned.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- hierarchical - HierarchicalLayout
- the hierarchical layout algorithm that is run
Provides access to implementation-specific properties of the algorithms used.
Remarks
Parameters
A map of options to pass to the method.
- key - any
- the key to a property
Returns
- ↪any?
- the associated property value or
null
See Also
Prepares and configures this instance based on the settings of the given HierarchicalLayout.
Remarks
This method is called by HierarchicalLayout before the actual layout is calculated. It may be overridden in order to manually reconfigure.
This implementation will temporarily set a PortCandidateSelector if nodePortCandidates are defined and no portCandidateSelector is assigned yet.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- hierarchical - HierarchicalLayout
- the hierarchical layout instance that is run
Callback method that publishes the layering information.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutContext - HierarchicalLayoutContext
- The HierarchicalLayoutContext instance which contains the layers that provides the layering information
See Also
Callback method that publishes the sequencing information.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances, as well as the layers that provides the layering and sequencing information
See Also
Removes the bends which are obviously not necessary.
Remarks
By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on a line with its preceding and succeeding bend point.
It may be overridden for a custom implementation of bend removal. It is called twice during the layout procedure at a point where the hierarchical layout is almost finished.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Provides access to implementation-specific properties of the algorithms used.
Remarks
Parameters
A map of options to pass to the method.
- key - any
- the key to a property
- propertyValue - any
- the value to associate with the key