PlaceNodesAtBarycenterStage temporarily hides the affectedNodes, applies the specified core layout algorithm (if any) to the resulting graph and, finally, reinserts the hidden nodes by placing them on the barycenter of their neighbors using the specified node sizes.
Implements
- I
- I
Remarks
A possible application for this stage is animated incremental layouts, i.e., if there are new elements, you can first place them near the barycenter of their existing neighbors before starting the animation. Hence, the animation will produce smoother layouts since the new elements "start" from suitable initial positions. If the new elements should be placed on their original coordinates and/or get their original sizes after starting the animation and before calling the core layout, then you can use the GivenCoordinatesLayout.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| considerGrouping | true | The grouping structure is considered. |
| coreLayout | null | |
| removeBends | true | Bends should be removed. |
See Also
Members
Show:
Constructors
Creates a new PlaceNodesAtBarycenterStage instance using the given coreLayout.
Creates a new PlaceNodesAtBarycenterStage instance using the given coreLayout.
Parameters
- coreLayout?: ILayoutAlgorithm
- the core layout routine
Properties
If this option is enabled, the layout algorithm considers the hierarchical grouping structure as follows:
- The barycenter of an affected group depends on the coordinates of non-affected nodes outside the group that connect to nodes inside the group.
- The barycenter of affected nodes is automatically moved inside the bounds of the contained parent group.
If this option is disabled, there is no special treatment of group nodes.
final
Property Value
true if the grouping structure is considered, false otherwiseDefault Value
The default value is: true
The grouping structure is considered.
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final
Property Value
the core layout routine
Default Value
The default value is: null
Defined in
LayoutStageBase.coreLayoutGets or sets a value that determines whether this stage should do anything but execute the coreLayout.
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.
final
Defined in
LayoutStageBase.enabledGets or sets whether or not bends of edges incident to affectedNodes should be removed.
Gets or sets whether or not bends of edges incident to affectedNodes should be removed.
final
Property Value
true if bends are removed, false otherwiseDefault Value
The default value is: true
Bends should be removed.
See Also
API
- resetPorts
Gets or sets whether or not ports of edges incident to affectedNodes should be set to the center of the corresponding nodes.
Gets or sets whether or not ports of edges incident to affectedNodes should be set to the center of the corresponding nodes.
This property is only considered if removeBends is enabled.
final
Property Value
true if ports are set to the center of the corresponding node, false otherwiseDefault Value
The default value is: false
Ports are not set to the center.
See Also
API
- removeBends
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.
Defined in
LayoutStageBase.applyLayoutStarts the layout.
Starts the layout.
createLayoutData
(graph: LayoutGraph): PlaceNodesAtBarycenterStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PlaceNodesAtBarycenterStage.
createLayoutData
(graph: LayoutGraph): PlaceNodesAtBarycenterStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PlaceNodesAtBarycenterStage.
The generic type arguments of the created layout data are compatible with instances of LayoutGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- PlaceNodesAtBarycenterStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given PlaceNodesAtBarycenterStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PlaceNodesAtBarycenterStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the PlaceNodesAtBarycenterStage.
The generic type arguments of the created layout data are compatible with instances of IGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
This method is not available unless the module view-layout-bridge is loaded. Either load the module 'view-layout-bridge' explicitly or ensure that the
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- PlaceNodesAtBarycenterStageData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given PlaceNodesAtBarycenterStage.
Constants
All constants are filtered. Go to Filters.