- I
- I
Remarks
Layout Style
This stage prepares a non-tree graph such that it can be processed by a tree layout algorithm.
Concept
This ILayoutStage works in three steps:
- Remove some edges to get a tree or forest from the graph
- Invoke the coreLayout which supports tree graph handling
- Reinsert all previously removed edges
- Optionally route these edges using the non-tree edge router and place their labels using the non-tree edge labeling algorithm.
Features
The routing of the temporarily hidden non-tree edges can be customized by specifying an edge routing algorithm for those edges. Similarly, the placement of edge labels of non-tree edges can be delegated to a custom edge labeling algorithm. As default, both custom algorithms are not specified and, thus, non-tree edges are not routed and edge labels not placed.
This stage is also able to handle multi-parent structures, i.e., structures of multiple nodes that share the same predecessors as well as the same successors. More precisely, if the specified coreLayout supports multi-parent structures (see allowMultiParent) and option allowMultiParent is enabled, this stage does not hide such structures, i.e., the multi-parent structures are passed to the coreLayout.
Non-tree edges can also be bundled together such that their common parts are to some degree merged into a bundled part. The edge bundling can be specified by means of property edgeBundling.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| allowMultiParent | false | The reduced graph is a normal tree. |
| coreLayout | null | |
| nonTreeEdgeLabeling | null | Edge labels of non-tree edges are not placed. |
| nonTreeEdgeRouter | null | Non-tree edges are not routed. |
See Also
Developer's Guide
Members
Constructors
Creates a new TreeReductionStage instance with the given core layout algorithm and default settings.
Parameters
- coreLayout?: ILayoutAlgorithm
- the core layout algorithm
Properties
Property Value
true if multi-parent structures are allowed, false otherwiseDefault Value
Sample Graphs
false - the multi-parent structure was reduced to a tree, a non-tree edge is markedGets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets the EdgeBundling instance that defines the settings of the edge bundling feature.
The specified EdgeBundling defines global bundling properties. Settings for individual edges can be defined by assigning an EdgeBundleDescriptor to an edge with edgeBundleDescriptors. To enable bundling for all non-tree edges, set a defaultBundleDescriptor which has bundling enabled.
If the graph contains self-loops that belong to the set of non-tree edges, the stage will invoke the router defined for the non-tree edges in order to route them. In the case where this is not desired, the user has to hide them from the stage and route them afterwards as desired.
Property Value
See Also
Developer's Guide
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.
By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false.
Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.
Defined in
LayoutStageBase.enabledGets or sets the labeling algorithm that is applied to all edge labels that belong to non-tree edges.
Property Value
Default Value
See Also
Developer's Guide
Gets or sets the edge routing algorithm that is applied to all non-tree edges.
Property Value
Default Value
See Also
Developer's Guide
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.
Defined in
LayoutStageBase.applyLayoutDetermines a spanning tree of the graph and passes it to the coreLayout.
Parameters
- graph: LayoutGraph
- the input graph
Overrides
LayoutStageBase.applyLayoutImplcreateLayoutData
(graph: LayoutGraph): TreeReductionStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the TreeReductionStage.
createLayoutData
(graph: LayoutGraph): TreeReductionStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- TreeReductionStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TreeReductionStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the TreeReductionStage.
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- TreeReductionStageData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TreeReductionStage.
Routes all edges that do not belong to the chosen spanning tree.
null).Parameters
- graph: LayoutGraph
- the graph containing tree and non-tree edges
- nonTreeEdgeMap: IMapper<LayoutEdge, boolean>