- I
- I
Remarks
The location and size of the remaining elements (called fixed elements) is not allowed to be changed.
Layout Style
This partial layout algorithm offers a kind of generic partial layout support for other existing layout algorithms. Hence, its layout style heavily depends on the selected coreLayout as well as the specified edgeRouter or edgeRoutingStyle.
The partial layout is suitable for applications where users may incrementally add new elements to an existing drawing. The added elements should be arranged so that they fit best possible into the given diagram without making any changes to the already existing layout. Hence, the so-called mental map of the existing drawing is preserved.
Features
Similar to the layout style, the supported feature set mainly depends on the features supported by the specified coreLayout as well as the specified edgeRouter or edgeRoutingStyle. The internal step that places the components can handle group nodes and is able to consider minimum distance constraints and node labels.
Furthermore, the algorithm tries to place a subgraph component within the associated cell of the LayoutGrid. For this feature to work properly it is required that the values of the properties position, position, width and height are correctly specified. Note that the algorithm does not guarantee that the calculated subgraph layout fits into the grid cell.
Concept
The layout algorithm tries to place the partial elements such that the resulting drawing (including the fixed elements) has a good quality with respect to common graph drawing aesthetics.
The layout algorithm handles each selected graph element as partial element. Selected graph elements can be defined using properties scope. Partial node elements can be assigned to the so-called subgraph components. During the layout process each subgraph induced by the nodes of a component is first laid out using the specified coreLayout. Then, the different components are placed one-by-one onto the drawing area such that the number of overlaps among graph elements is small. The user can specify different objectives for finding 'good' positions for subgraph components (see subgraphPlacement), e.g., BARYCENTER specifies that the component should be placed close to the barycenter of its graph neighbors and FROM_SKETCH specifies that the component should be placed close to its original position.
Method componentAssignmentStrategy allows to specify the strategy that assigns partial nodes to subgraph components. Possible values are CLUSTERING, CONNECTED, and SINGLE. Note that nodes of a component cannot be assigned to different group nodes.
Furthermore, the user can specify the edge routing style (see edgeRoutingStyle) that is used for routing partial edges and edges between different subgraph components (so-called inter-edges). Possible values are ORGANIC, ORTHOGONAL, STRAIGHT_LINE, OCTILINEAR and AUTOMATIC.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| allowMirroring | false | Mirroring is disabled. |
| allowMovingFixedElements | false | The algorithm doesn't move fixed elements. |
| componentAssignmentStrategy | ComponentAssignmentStrategy.SINGLE | Each partial node is assigned to a separate subgraph component. |
| componentCompaction | true | Subgraph component may be placed within another subgraph component. |
| considerNodeAlignment | false | Nodes are not aligned. |
| coreLayout | null | |
| edgeRouter | StraightLineEdgeRouter | |
| edgeRoutingStyle | PartialLayoutRoutingStyle.STRAIGHT_LINE | |
| layoutOrientation | PartialLayoutOrientation.NONE | The layout orientation is completely ignored. |
| minimumNodeDistance | 10 | |
| optimizeOrientation | true | This postprocessing step is enabled. |
| resizeFixedGroups | false | Fixed group nodes may not be resized. |
| routeInterEdgesImmediately | false | Edges are not routed immediately. |
| stopDuration | TimeSpan.MAX_VALUE | The time is not limited. |
| subgraphPlacement | SubgraphPlacement.BARYCENTER | Each subgraph component is placed close to the barycenter of its graph neighbors. |
See Also
Developer's Guide
Members
Constructors
Creates a new instance of PartialLayout which uses the specified ILayoutAlgorithm instance as the core layout algorithm.
Parameters
- coreLayout?: ILayoutAlgorithm
- the layout algorithm that is applied to the subgraph components
See Also
Properties
Property Value
true if subgraph components are mirrored, false otherwiseDefault Value
Sample Graphs
1 and 2 are fixed while the remaining nodes are partial. The partial layout is applied to this graph with partitionDescriptor. style set to CYCLE and the componentAssignmentStrategy set to CONNECTED.Property Value
true if the algorithm may move fixed elements, false otherwise.Default Value
Gets or sets the strategy that assigns partial nodes to subgraph components.
To define custom components instead of using the predefined strategies, use componentIds. In this case, the value of componentAssignmentStrategy will be ignored.
The specified coreLayout independently calculates the layout for each subgraph component.
- SINGLE: each partial node is a separate subgraph component. The specified core layout doesn't have any effect because it is applied to each single node separately.
- CONNECTED: components are defined by the connected components of the graph induced by the partial elements.
- CLUSTERING: components are defined by edge betweenness clustering.
Property Value
Default Value
Sample Graphs
1 and 2 are fixed while the remaining nodes are partial.See Also
Developer's Guide
API
- componentIds, coreLayout
Property Value
true if a subgraph component may be placed within another subgraph component, false otherwiseDefault Value
Property Value
true if nodes are aligned, false otherwiseDefault Value
Sample Graphs
false - partial node 3 is not aligned with the other nodes.See Also
Developer's Guide
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets or sets the custom edge router instance that is used for partial edges and edges between different subgraph components (so-called inter-edges).
Property Value
Default Value
See Also
Gets or sets the routing style that is used for partial edges and inter-edges.
- STRAIGHT_LINE produces straight-line edge routes.
- ORTHOGONAL produces orthogonal edge routes.
- OCTILINEAR produces octilinear edge routes.
- ORGANIC produces organic edge routes.
- AUTOMATIC automatically chooses a suitable style for the partial edges inter-edges, based on the existing routes of the fixed edges.
Property Value
Default Value
Sample Graphs
2 is a partial node.See Also
Developer's Guide
API
- edgeRouter
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 layout orientation that is considered during the placement of partial elements.
v is placed before v and each successor after v with respect to the layout orientation.- NONE: the layout orientation is completely ignored.
- AUTO_DETECT: the layout orientation is automatically detected. The algorithm analyzes the flow direction of fixed edges in the current drawing. If there is no common flow direction, the results are the same as for NONE. Otherwise, the layout orientation is one of the four main orientations.
- TOP_TO_BOTTOM: the algorithm tries to place partial nodes (subgraph components) such that each predecessor of a node
vis placed abovevand each successor belowv. - BOTTOM_TO_TOP: the algorithm tries to place partial nodes (subgraph components) such that each predecessor of a node
vis placed belowvand each successor abovev. - LEFT_TO_RIGHT: the algorithm tries to place partial nodes (subgraph components) such that each predecessor of a node
vis placed to the left ofvand each successor to the right ofv. - RIGHT_TO_LEFT: the algorithm tries to place partial nodes (subgraph components) such that each predecessor of a node
vis placed to the right ofvand each successor to the left ofv.
Property Value
Default Value
Sample Graphs
3 is placed without considering the layout orientation.See Also
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the distance is negative
Default Value
Sample Graphs
10 - the partial nodes (node 2 and 3) are placed such that the minimum distance between adjacent nodes is at least 10See Also
Developer's Guide
Property Value
true if this postprocessing step is applied, false otherwiseDefault Value
See Also
Property Value
true if fixed group nodes may be resized, false otherwiseDefault Value
Property Value
true if edges between different subgraph components are routed immediately, false otherwise.Default Value
See Also
Gets or sets the preferred time limit for the layout algorithm.
Throws
- Exception ({ name: 'ArgumentError' })
- if the given duration is negative
Default Value
See Also
Developer's Guide
Gets or sets the objective used for finding 'good' positions for subgraph components.
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.applyLayoutThis method calculates the partial layout.
- routeEdgesBetweenFixedElements
- applyLayout on the coreLayout for each subgraph component
- placeSubgraphs
- routeInterEdges
Parameters
- graph: LayoutGraph
- the input graph
Overrides
LayoutStageBase.applyLayoutImplcreateLayoutData
(graph: LayoutGraph): PartialLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PartialLayout.
createLayoutData
(graph: LayoutGraph): PartialLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- PartialLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given PartialLayout.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PartialLayout.
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- PartialLayoutData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given PartialLayout.