- I
Remarks
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| mergingPolicy | LayerMergingPolicy.ADD_RIGHT_TOP_ALIGNED | Nodes of the source HierarchicalLayoutContext layering are to the right of the target layering and all nodes are top-aligned. |
Members
Constructors
Creates a new instance of MultiComponentLayerAssigner.
Parameters
- singleComponentLayerAssigner: ILayerAssigner
- The layer assigner to be used for single components.
Throws
- Exception ({ name: 'ArgumentError' })
- if the given layer assigner is
null
Properties
Gets or sets the comparison function to sort the lists of nodes that form a component.
Property Value
null if no specific comparison existsGets or sets the merging policy that is obeyed by the default implementation of merge.
Property Value
Default Value
Gets or sets the delegate ILayerAssigner instance.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified ILayerAssigner is
null
Methods
Assigns all nodes of the graph to layers and adds them to the layers in the given layoutContext.
layoutContext.In order to create new layers, factory method insertLayer has to be used.
Information about the nodes is provided by a HierarchicalLayoutContext instance. However, positional information (see position and layer) is not available during this phase.
Parameters
- graph: LayoutGraph
- the input graph
- layoutContext: HierarchicalLayoutContext
- The HierarchicalLayoutContext instance providing access to context information for the graph elements, as well as the layers the nodes are assigned to.
Implements
ILayerAssigner.assignLayersMerges the two layer lists contained in the two given HierarchicalLayoutContext instances.
All nodes that belong to the source and target layers are part of the graph at the moment of invocation.
The state of the source HierarchicalLayoutContext instance is discarded after this call and does not need to be updated to reflect the changes. The target HierarchicalLayoutContext instance must be updated accordingly.
By default, this method takes into account the mergingPolicy to merge layers. It can be overridden to implement a custom merging strategy.
Parameters
- graph: LayoutGraph
- the graph containing the nodes of both contexts/layerings
- sourceLayersContext: HierarchicalLayoutContext
- the HierarchicalLayoutContext that holds the source layers that will be merged into the target layers
- targetLayersContext: HierarchicalLayoutContext
- the HierarchicalLayoutContext that holds the target layers that will be modified to contain the resulting (merged) layering
Sorts an array which consists of YList<T>s, where each list contains nodes that belong to the same component.
It is called during assignLayers.
By default, this method uses the componentComparator to sort the list and has no effect if the instance is null. This means it ignores the componentIndexProvider parameter.
The method may be overridden to implement a custom ordering of the components.
Parameters
- nodeLists: YList<LayoutNode>[]
- the array of YList<T> with LayoutNodes each of which containing nodes that belong to the same component
- componentIndexProvider: IMapper<LayoutNode, number>
- the IMapper<K, V> that returns an object representing the component index for each node (this value can be either integer or object)