This layout algorithm arranges graphs in a hierarchical fashion.
Remarks
Layout Style
The nodes are distributed into layers so that most of the edges point to the main layout direction. The order of the nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge routing styles available. Edges can be orthogonal, polyline, octilinear, or curved (see RoutingStyleDescriptor for details).
Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the identification of dependencies and relationships among the nodes of the graph. Possible application domains are the following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways, and network management.
Concept
The layout algorithm runs in three main phases:
- Layering – The nodes are distributed into layers by means of fromScratchLayerAssigner or fixedElementsLayerAssigner, respectively. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the layers are ordered vertically top-to-bottom.
- Sequencing – The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To specify the sequencing algorithm, use fromScratchSequencer or fixedElementsSequencer.
- Drawing – The layout algorithm assigns the final coordinates to all nodes and routes the edges.
Features
This layout algorithm is able to create hierarchical layouts from scratch or add new elements to the existing sketch drawing incrementally. In order to add elements incrementally to the current sketch or let the algorithm optimize certain elements in the current sketch, set fromSketchMode to true
. Then associate the IncrementalNodeHints with the elements to be added incrementally via the layout data property incrementalNodes and/or define a collection of edges that should be sequenced incrementally via property incrementalEdges.
HierarchicalLayoutNodeDescriptor and HierarchicalLayoutEdgeDescriptor instances can be used for specifying individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound to the graph using properties nodeDescriptors or edgeDescriptors. If there is no descriptor assigned to some nodes/edges, a default descriptor will be used. To set default descriptors use defaultNodeDescriptor and defaultEdgeDescriptor.
HierarchicalLayout supports connecting edges to a node on a specific side or even an exact location by assigning LayoutPortCandidates to the edges or NodePortCandidatess to the nodes. If an edge with registered LayoutPortCandidates connects to nodes with NodePortCandidatess, the algorithm will try to match both collections to find an appropriate port. In case there is no matching port candidate, a LayoutPortCandidate specified for the edge is preferred. For the matching to work properly, the candidates in both collections need to be the same instances. Furthermore, LayoutPortCandidates with multiple sides (e.g. LEFT or] RIGHT) are not supported. To model that an edge should connect at one of several sides, define multiple candidates instead, where each candidate has a single side.
The edge grouping feature of this layout algorithm is restricted to normal, hierarchical edges. Edges with recursiveEdgePolicy DIRECTED or UNDIRECTED will not be grouped. They are also not grouped when enabling automaticEdgeGrouping.
The port grouping feature (see sourcePortGroupIds and targetPortGroupIds in ports) allows to specify edges that share the same port location at their source/target. However, unlike as for edge grouping, edges with port groups will be routed independently without sharing segments. Port grouping has similar restrictions as the edge grouping feature. In addition, port grouping is not considered for self-loops.
The port alignment feature (see sourcePortAlignmentIds and targetPortAlignmentIds) allow to specify edges that either share the same port location or be placed exactly opposite provided. The alignment is not considered when deciding on which node sides to place the ports. To ensure that the edges are aligned in the presence of EdgePortCandidates or NodePortCandidates, it is recommended to assign consistent candidates to all aligned edges. Alignment works both for edges in the layoutOrientation (for example edges with ports on the TOP or BOTTOM sides if the layout orientation is top-to-bottom) and edges that are orthogonal to it. However, the quality of the resulting layouts is typically higher when aligning edges in the layout orientation. Port alignment is not supported at group nodes, for self-loops, and for edges that are part of a grid component at the root of the grid component.
The HierarchicalLayout also supports nodeTypes as a subordinate criterion during the sequencing of nodes within their layer. More precisely, the sequencing algorithm prefers to place nodes of the same type next to each other if this does not induce additional crossings or conflicts with other constraints (like node groups, swimlanes, or sequenceConstraints ). The algorithm uses an additional local optimization heuristic to improve the placement with respect to node types and, thus, does not guarantee optimal results. Furthermore, this additional step may increase the required runtime. Note that node types do not affect the layer assignment.
HierarchicalLayout allows restricting the duration which may be a suitable option to reduce the runtime required for large graphs. Note that restricting the maximum duration can result in a lower layout quality. Furthermore, the actual runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.
Layout Stages
This class provides a configurable pipeline that contains various ILayoutStages. Each ILayoutStage can incorporate preprocessing or postprocessing steps into the layout calculation to streamline the input graph and enhance the resulting layout. Additionally, custom ILayoutStages can be added and executed either before or after the predefined ones.
The following default ILayoutStages are included:
- SubgraphLayoutStage: Filters the graph to include only specific nodes and edges from a subgraph while preserving the positions of excluded elements. Note: This stage is disabled by default.
- ComponentLayout: Arranges graph components with customizable styles. Note: This stage is disabled by default.
- GenericLabeling: Efficiently places node and edge labels. The property fillEmptyScope is set to
false
and stopDuration is set to ZERO. - OrientationStage: Changes the layout orientation in four possible directions, with or without mirroring on the x or y-axis. The property edgeLabelPlacement is set to IGNORE to allow for proper handling of edge labels in the hierarchical layout.
With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.
Performance
Specifying a stopDuration can reduce the time the HierarchicalLayout takes to produce a result. The acceleration is achieved by switching to faster heuristics for some features and skipping some optional optimization steps. This can impact the quality of the layout result and is usually most noticeable in the calculated edge routes. It should be noted that the stopDuration is not a guarantee for the maximum time spent, as the algorithm still has to produce a valid result.
The coordinateAssigner uses a comparably expensive SymmetryOptimizationStrategy by default, which improves the symmetry of the calculated layout result. This optimization can be disabled to speed up the layout calculation, or the faster WEAK strategy can be applied as a compromise between speed and quality.
Default Values of Properties
componentArrangementPolicy | TOPMOST
| Connected components are aligned with their first layer. |
edgeLabelPlacement | INTEGRATED
| Edge labels are placed by the layout algorithm. |
gridSpacing | 0 | There is no grid specified. |
groupAlignmentPolicy | CENTER
| Groups and normal nodes are center aligned. |
groupLayeringPolicy | RECURSIVE
| The content of groups is considered separately during the layering stage. |
nodeLabelPlacement | CONSIDER
| Node labels are considered. |
stopDuration | MAX_VALUE
| The layout algorithm runs unrestricted. |
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new HierarchicalLayout instance with the default settings.
Parameters
A map of options to pass to the method.
- groupAlignmentPolicy - GroupAlignmentPolicy
- The group layer alignment strategy used for recursive group layering. This option sets the groupAlignmentPolicy property on the created object.
- groupLayeringPolicy - GroupLayeringPolicy
- The policy that specifies how to compute the layering in grouped graphs. This option sets the groupLayeringPolicy property on the created object.
- componentArrangementPolicy - ComponentArrangementPolicy
- The policy that specifies how to arrange connected components. This option sets the componentArrangementPolicy property on the created object.
- stopDuration - TimeSpan
- The preferred time limit for the layout algorithm. This option sets the stopDuration property on the created object.
- gridSpacing - number
- The equidistant spacing between the horizontal and vertical grid lines. This option sets the gridSpacing property on the created object.
- layoutOrientation - LayoutOrientation
- The layoutOrientation of the OrientationStage. This option sets the layoutOrientation property on the created object.
- automaticEdgeGrouping - boolean
- Whether or not edges are grouped automatically. This option sets the automaticEdgeGrouping property on the created object.
- nodeLabelPlacement - NodeLabelPlacement
- How the layout handles the position of node labels. This option sets the nodeLabelPlacement property on the created object.
- edgeLabelPlacement - EdgeLabelPlacement
- How the layout handles the position of edge labels. This option sets the edgeLabelPlacement property on the created object.
- minimumLayerDistance - number
- The minimum distance between two adjacent layers. This option sets the minimumLayerDistance property on the created object.
- nodeDistance - number
- The minimum distance between two adjacent nodes in one layer. This option sets the nodeDistance property on the created object.
- nodeToEdgeDistance - number
- The minimum distance between an edge and an adjacent node in one layer. This option sets the nodeToEdgeDistance property on the created object.
- edgeDistance - number
- The minimum distance between two directly consecutive edges that pass through the same layer. This option sets the edgeDistance property on the created object.
- core - HierarchicalLayoutCore
- The HierarchicalLayoutCore instance holding advanced core algorithm properties. This option either sets the value directly or recursively sets properties to the instance of the core property on the created object.
- fromScratchLayeringStrategy - HierarchicalLayoutLayeringStrategy
- A predefined layering strategy for the HierarchicalLayout. This option sets the fromScratchLayeringStrategy property on the created object.
- fromSketchMode - boolean
- A value indicating whether the layout should be calculated based on the current sketch, allowing incremental insertion of elements. This option sets the fromSketchMode property on the created object.
- defaultEdgeDescriptor - HierarchicalLayoutEdgeDescriptor
- The HierarchicalLayoutEdgeDescriptor instance used for all those edges that do not have a specific descriptor assigned. This option either sets the value directly or recursively sets properties to the instance of the defaultEdgeDescriptor property on the created object.
- defaultNodeDescriptor - HierarchicalLayoutNodeDescriptor
- The HierarchicalLayoutNodeDescriptor instance used for all those nodes that do not have a specific descriptor assigned. This option either sets the value directly or recursively sets properties to the instance of the defaultNodeDescriptor property on the created object.
Properties
Gets or sets whether or not edges are grouped automatically.
Remarks
Default Value
false
.Edges are not grouped automatically.
Property Value
true
if the edge grouping should be applied, false
otherwiseSee Also
Sample Graphs
Gets or sets the policy that specifies how to arrange connected components.
Gets the ComponentLayout from the layoutStages of this instance.
Remarks
Throws
- Exception({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the
See Also
Gets the coordinateAssigner instance that will calculate the final node placement (coordinates) of the layout.
Default Value
coordinateAssigner.Property Value
Throws
- Exception({ name: 'InvalidOperationError' })
- if the
specified as property is not of type . To access the instance directly access the core property.
See Also
Gets or sets the HierarchicalLayoutCore instance holding advanced core algorithm properties.
Gets or sets the HierarchicalLayoutEdgeDescriptor instance used for all those edges that do not have a specific descriptor assigned.
Default Value
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the
is null
See Also
Gets or sets the HierarchicalLayoutNodeDescriptor instance used for all those nodes that do not have a specific descriptor assigned.
Default Value
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given
is null
See Also
Gets or sets the minimum distance between two directly consecutive edges that pass through the same layer.
Remarks
More precisely, the specified value is the minimum distance between the two vertical segments of these edges that traverse the layer. The algorithm does not consider this value if the layer contains other elements lying between the two edges (e.g., nodes or group node borders).
All values have to be greater than or equal to 0
.
Default Value
20
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the distance is negative
- Exception({ name: 'InvalidOperationError' })
- if the current
is not an instance of
See Also
Sample Graphs
Gets or sets how the layout handles the position of edge labels.
Default Value
Property Value
See Also
Sample Graphs
Gets or sets a predefined layering strategy for the HierarchicalLayout.
Remarks
The layout algorithm assigns the nodes to separate layers. For layout orientation top-to-bottom, nodes within the same layer will be placed on the same horizontal line (y-coordinate). The layers will be arranged vertically (below each other), with the first layer at the topmost.
Besides the various prebuilt layering strategies, the layering can also be customized by specifying so-called layering constraints or by implementing a custom ILayerAssigner.
This method wraps the internal implementations into a MultiComponentLayerAssigner instance so that it is possible to specify the behavior of the algorithm if the componentLayout is disabled (via property enabled).
Default Value
HIERARCHICAL_OPTIMAL.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if an unknown strategy is given
See Also
Gets or sets a value indicating whether the layout should be calculated based on the current sketch, allowing incremental insertion of elements.
Remarks
If set to true
, the layout will keep some nodes fixed and insert the remaining nodes incrementally. Nodes can be marked as incremental using incrementalNodes. Fixed elements will be handled by the fixedElementsSequencer and fixedElementsLayerAssigner. Incremental elements will be added during the layering or the sequencing phase. They are handled by fromScratchLayerAssigner and fromScratchSequencer, respectively.
If set to false
, the layout will be recalculated entirely from scratch. All elements will be handled by the same layerer and sequencer.
Default Value
false
.The layout will start from scratch by default.
See Also
Gets or sets the equidistant spacing between the horizontal and vertical grid lines.
Remarks
0
, no grid is considered, otherwise nodes and edges are placed on multiples of the grid spacing.Default Value
0
.There is no grid specified.
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when an attempt is made to set a negative grid spacing value.
See Also
Sample Graphs
Gets or sets the group layer alignment strategy used for recursive group layering.
Default Value
Property Value
See Also
Gets or sets the policy that specifies how to compute the layering in grouped graphs.
Default Value
RECURSIVE.The content of groups is considered separately during the layering stage.
Property Value
See Also
Gets or sets the layoutOrientation of the OrientationStage.
Gets the mutable stack of ILayoutStage that will be applied to this layout.
Gets or sets the minimum distance between two adjacent layers.
Remarks
Default Value
20
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the distance is negative
See Also
Sample Graphs
Gets or sets the minimum distance between two adjacent nodes in one layer.
Remarks
0
.Default Value
30
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the distance is negative
- Exception({ name: 'InvalidOperationError' })
- if the current
is not an instance of
See Also
Sample Graphs
Gets or sets how the layout handles the position of node labels.
Default Value
Property Value
See Also
Sample Graphs
Gets or sets the minimum distance between an edge and an adjacent node in one layer.
Remarks
0
.Default Value
15
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the distance is negative
- Exception({ name: 'InvalidOperationError' })
- if the current
is not an instance of
See Also
Sample Graphs
Gets or sets the preferred time limit for the layout algorithm.
Remarks
0
.Default Value
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the duration is negative
See Also
Methods
Calculates a hierarchical layout of the given graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Delegates the calculation of the hierarchical layout to a configured HierarchicalLayoutCore instance.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
createLayoutData
(graph: LayoutGraph) : HierarchicalLayoutData<LayoutNode,LayoutEdge,LayoutGraphItem,LayoutNodeLabel,LayoutEdgeLabel>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the HierarchicalLayout.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪HierarchicalLayoutData<LayoutNode,LayoutEdge,LayoutGraphItem,LayoutNodeLabel,LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given HierarchicalLayout.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the HierarchicalLayout.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪HierarchicalLayoutData<INode,IEdge,IModelItem,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given HierarchicalLayout.
See Also
LayoutExecutor
type is available at runtime.Constants
A data key for associating alternative paths for edges connecting to groups, group content or folder nodes.
Remarks
When running in fromSketchMode,, the alternative edge paths are considered during the routing of fixed (i.e., non-incremental) edges.
The alternative paths should be used in conjunction with alternative group bounds to achieve more stable layout results when collapsing/expanding a group node as follows:
- Collapsing: edges adjacent to the group itself and edges where one of the endpoints (source/target) lies inside the group should get the path before collapsing the group as alternative path. If both endpoints are either inside or outside the group, no alternative path is required.
- Expanding: edges adjacent to the expanded folder node (which is now a group) should get the path before expanding as alternative path.
Assign a collection of Points to an edge as the alternative path of this edge connecting to the content of the expanded/collapsed group or null
for all other edges.
See Also
A data key for associating an alternative bounds with the collapsed/expanded group.
Remarks
When running in fromSketchMode, the alternative bounds of the collapsed/expanded group will be used during the layering and sequencing phase of the algorithm.
Assign a Rect as the alternative bounds of a collapsed/expanded group or null
for all other nodes.
See Also
A data key for defining the priority of critical edges.
Remarks
Critical edges highlight different edge paths that are relevant for a user. The layout tries to vertically align each node pair that is connected by a critical edge. Conflicts between different critical edges are always resolved in favor of the higher priority.
Critical edges do not automatically affect the result of the crossing minimization phase. If crossings between critical edges should be avoided, one can assign individual crossing costs by using EDGE_CROSSING_COST_DATA_KEY. Critical edges need to get a larger crossing cost than other, non-critical edges. This is recommended if critical edges should not only highlight a relevant path but also crossings with them should be avoided. Note, however, that the crossing minimization is only a heuristic and there is no guarantee for an optimal solution in all cases.
Assign the positive priority value for a critical edge, or, to indicate a non-critical edge, use zero or any negative value.
See Also
Sample Graphs
A data key for specifying individual crossing costs of the edges.
Remarks
The crossing costs of the edges are considered during the crossing minimization phase. The total crossing costs are minimized using a heuristic where the cost of a crossing between two edges is defined as the product of the edges' crossing costs.
If no individual crossing costs are defined, each crossing has a cost of 1
. A crossing with an edge that has a cost of zero is cost-free and such a crossing will therefore not be avoided.
See Also
A data key for providing layout information for each edge.
Remarks
null
if the default HierarchicalLayoutEdgeDescriptor should be used.See Also
A data key for specifying the thickness of the edges.
Remarks
0
.See Also
Sample Graphs
A data key for marking folder nodes.
Remarks
When using recursive edges (recursiveEdgePolicy) in fromSketchMode, edges will also start at the bottom and end at the top of marked folder nodes. This will keep the edge routes more stable since the connection sides won't change.
Assign true
if the node is a folder node, or false
otherwise.
See Also
A data key for specifying the grid component to which an edge belongs.
Remarks
Assign a GridComponentDescriptor to an edge to mark the edge and its source and target nodes as part of the represented grid component or null
for edges that are not in such a component.
All edges with the same GridComponentDescriptor instance adjacent to a specific node (the root) and having the same direction are arranged in a compact, bus-like way. The edgeDirectedness is also considered here. The direction defines the placement of the grid component in the following way:
- Grid nodes connected by out-edges of the root are placed in layers starting with the layer immediately after the root's layer (e.g. below the root for top-to-bottom layout orientation).
- Grid nodes connected by in-edges of the root are placed in the layers ending with the layer immediately before the root's layer (e.g. above the root for top-to-bottom layout orientation).
The grid components are arranged using a style that yields more compact layout results. Edges to the child nodes, the so-called grid nodes, are routed using a shared segment that connects to the common root node. The grid nodes are arranged using several layers above or below the root node such that the whole substructure has a compact area. By default, each grid layer contains equally many grid nodes, grid nodes of adjacent layers are center-aligned and the shared bus segment is routed in the middle of the nodes. This produces compact, symmetric arrangements of the grid components.
The arrangement can be customized for each grid component individually, by using the settings offered by GridComponentDescriptor. It allows to configure the number of grid nodes before and after the common bus segment.
Some restrictions apply for grid components:
- Only nodes that are in the same LayoutGridCellDescriptor as the root node are included in the grid component.
- The grid nodes must all belong to the same group node. Also, a group node can not be part of a grid component; neither as grid element nor as the root.
- Grid structures can not be nested. That means that if a node is a grid node it can not be a root node of another grid component at the same time.
- For bus edges, the integrated edge labeling feature does not place port labels as close to the actual port as it does for other edges (see AT_SOURCE_PORT and AT_TARGET_PORT).
- Edge grouping constraints at the side of the grid root node are ignored for bus edges; the grouping induced by the grid component is considered to be stronger.
- If in incremental layout mode, the bus edges are always treated in an incremental way to ensure that the bus-style routing remains consistent (e.g. if a fixed bus edge contains bends that suggest another route, they are ignored). Furthermore, the location of the bus segment relative to the elements is not derived from the sketch but depends on the settings maximumNodesBeforeBus and maximumNodesAfterBus as well as the before/after constraints defined by nodesBeforeBus. This means that it can happen that a fixed grid node which was placed before the bus in the input drawing may be placed after the bus if the bus was enlarged due to the insertion of incremental grid nodes.
- It is not recommended to define grid components inside a group node which has an incremental group hint. Fixed grid nodes inside such a group are not necessarily kept fix but are treated like an incrementally inserted node.
See Also
Sample Graphs
A data key for specifying individual crossing costs for vertical borders of group nodes.
Remarks
Like edge crossing costs, these costs are considered during the crossing minimization phase. The total costs are minimized using a heuristic where the cost of a crossing between a group node border and an edge is defined as the product of the respective group border crossing cost and the edge crossing cost.
If no individual crossing costs are defined, the cost for crossing a group node border is 5
. This means that by default, a crossing between an edge and a group node border is more expensive than a crossing between two edges. Also note that a crossing with a group node border that has a cost of zero is cost-free and such a crossing will therefore not be avoided.
See Also
A data key for specifying incremental hints.
Remarks
See Also
A data key for specifying incremental hints.
Remarks
See Also
A data key for publishing the layer ID of each node.
Remarks
See Also
A data key for providing layout information for each node.
Remarks
null
if the default HierarchicalLayoutNodeDescriptor should be used.See Also
A data key for publishing the index inside their layer for each node.
Remarks
See Also
A data key for specifying custom subcomponents.
Remarks
Assign a HierarchicalLayoutSubcomponentDescriptor to a node to specify its subcomponent bor null
if the node should not be part of a specific subcomponent.
A subcomponent is arranged by another ILayoutAlgorithm and its layout is finally embedded into the global hierarchical layout. This feature allows, for example, to highlight special substructures by arranging them in a different fashion. The sub-layout algorithm must be specified in the component descriptor registered with this key. All nodes associated with the same HierarchicalLayoutSubcomponentDescriptor instance are members of the same subcomponent.
Carefully note that nodes of a subcomponent can be connected to nodes of another subcomponent as well as to nodes that are not part of any subcomponent. Edges that model these connections are so-called inter-edges. It is recommended to keep the number of inter-edges small for better overall integration of the components.
If all inter-edges of a subcomponent connect to the same external node, that single external so-called connector node is included in the calculation of the component layout when using placement policy AUTOMATIC or ALWAYS_INTEGRATED. In case the result is feasible, this results in a better and more compact integration of the component in the main layout. In that case the sub-layout is fully responsible for the routing of inter-edges (meaning the restrictions below may not apply anymore).
For inter-edges there apply some restrictions with respect to the supported features:
- Their general style can somewhat differ from other, normal hierarchical edges. They do not fully comply with all RoutingStyleDescriptor settings.
- The backLoopRouting style is not applied for the part of an inter-edge that connects to a subcomponent node.
- The minimumFirstSegmentLength and the minimumLastSegmentLength can not always be fulfilled for the side of an inter-edge that lies inside a subcomponent. It is still kept on the side outside of subcomponents.
- The node-to-edge distance can not always be kept between inter-edges and nodes inside a subcomponent. This will mostly appear if a subcomponent has a rather large number of inter-edges connecting to it.
- The INTEGRATED edge labeling does not guarantee full support for all EdgeLabelPreferredPlacement configurations for inter-edges. This affects the side of the inter-edge that lies inside a subcomponent and when the label should be placed near the component node, i.e., using settings AT_SOURCE, AT_SOURCE_PORT, AT_TARGET or AT_TARGET_PORT.
subcomponents can be defined on grouped graphs with the following restrictions:
- All subcomponent nodes must be on the same hierarchy level if the group node itself is not part of the subcomponent.
- If a group is assigned to a subcomponent, all its descendants (including other group nodes) must be in that component, too.
When running in fromSketchMode, it is still up to the sub-layout algorithm to decide whether to treat a subcomponent element as incremental or fixed. If the given layout of the subcomponent should be considered, then the from-sketch mode of the used layout algorithm needs to be enabled (if such a mode is supported).
Layering and sequencing constraints are supported for subcomponents in the following way: all constraints from the subcomponent nodes are transferred to the component itself. Constraints between nodes of the same component are ignored. In the same way, a given layering provided by GivenLayersAssigner is supported for subcomponents.
See Also
A data key for specifying orderings of child nodes of a tabular group node.
Remarks
See Also
A data key for marking tabular group nodes.
Remarks
Assign true
to a group node if its children should be arranged in a tabular fashion, or false
otherwise.
Children of marked groups are arranged in a compact tabular fashion as shown in the figure below. Groups contained in a tabular group behave like tabular groups as well.
Child nodes are placed next to each other within the same layer with a distance defined by tabularGroupChildDistance, which is zero by default.
There are some setups for which a tabular group may not be tight (i.e., maximally compact):
- If edges directly connect to a tabular group (not to its content), then it is not guaranteed that the group becomes maximally compact. Children may be placed a little further apart to fulfill the defined edgeDistance.
- The same is true if there are children with self-loops. Such self-loops are always drawn within the tabular group.
- In addition, labels of edges connecting two children of the same tabular group may intersect with other edge segments.
Besides, the tabular groups may not be tight if there are user specified constraints like node margins, node labels that exceed the size of the associated child node, and port constraints connecting to a side orthogonal to the layout orientation.
See Also
Sample Graphs
A data key for specifying whether or not the ports of edges incident to a specific group node should be uniformly distributed.
Remarks
Assign true
to a group node if its ports should be uniformly distributed, or false
otherwise.
This setting only affects the two sides of a group node that are in flow and against the flow of the layout orientation. For example, for orientation TOP_TO_BOTTOM only the edges incident to the top and bottom group node side are considered but not the edges at the left and right side.
If no IMapper<K,V> is registered with this key, then the ports at group nodes are not explicitly distributed in a uniform way.
The uniform group port assignment considers the edgeDistance such that two ports keep the specified distance to each other. Group nodes may in consequence be enlarged to satisfy that constraints, potentially generating less compact layouts. The distance from the group node border to the first/last port on each group side may be influenced by using group node padding.
Importantly, it is not guaranteed that the group node ports of a specific side can be uniformly distributed. In the following cases ports of a specific side are not uniformly distributed:
- There are edges that cross the group node border because they connect to a child node of the group.
- There is a self-loop at the group node which has its source and target port at the same group node side.
See Also
Sample Graphs
Static Methods
Returns the corresponding original edge instance for a given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- the edge for which the original input edge is retrieved
- layoutContext - HierarchicalLayoutContext
- the layout data provider holding layout information of the hierarchical layout
Returns
- ↪LayoutEdge
- the original input edge corresponding to the given edge