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.
See Also
Members
Constructors
Creates a new HierarchicalLayoutCore instance with the default settings.
Properties
Gets or sets the ICoordinateAssigner instance that will calculate the final node coordinates.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the ICoordinateAssigner is
null
Default Value
Gets or sets the IDrawingDistanceCalculator instance responsible for determining the minimum distances between elements that belong to the same layer.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified IDrawingDistanceCalculator is
null
Gets or sets the ILayerAssigner instance that obtains the layering for fixed nodes during the from sketch layout.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the ILayerAssigner is
null
Default Value
See Also
Gets or sets the ISequencer instance that calculates the sequence of the fixed nodes during the from sketch layout run.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the given ISequencer is
null
Default Value
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.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the ILayerAssigner is
null
Default Value
See Also
Gets or sets the ISequencer instance that calculates the node sequence if the layout algorithm does not run in from sketch mode.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the ISequencer is
null
Default Value
See Also
Gets or sets the IHierarchicalLayoutPortAssigner instance responsible for assigning port coordinates to the adjacent edges of each node.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified IHierarchicalLayoutPortAssigner is
null
Gets or sets the IPortCandidateSelector instance responsible for optimizing the assignment of selected port candidates to the adjacent edges of each node.
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.
Property Value
true if the layout algorithm should stop after the layering phase, false if the complete layout should be calculatedDefault Value
See Also
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.
Property Value
true if the layout algorithm should stop after the sequencing phase, false if the complete layout should be calculatedDefault Value
See Also
Methods
Factory method called during applyLayoutCore and creates an appropriate ILayerAssigner implementation.
Return Value
- 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
- 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.
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
Return Value
- ISequencer
- a ISequencer implementation
Disposes of this instance by undoing preparation steps done during prepare.
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
- graph: LayoutGraph
- the input graph
- hierarchical: HierarchicalLayout
- the hierarchical layout algorithm that is run
Prepares and configures this instance based on the settings of the given HierarchicalLayout.
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
- graph: LayoutGraph
- the input graph
- hierarchical: HierarchicalLayout
- the hierarchical layout instance that is run
Callback method that publishes the layering information.
Parameters
- 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.
Parameters
- 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.
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
- graph: LayoutGraph
- the input graph