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.
Remarks
Default Values of Properties
considerGrouping | true | The grouping structure is considered. |
removeBends | true | Bends should be removed. |
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new PlaceNodesAtBarycenterStage instance using the given coreLayout.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- the core layout routine
- removeBends - boolean
- Whether or not bends of edges incident to affectedNodes should be removed. This option sets the removeBends property on the created object.
- resetPorts - boolean
- Whether or not ports of edges incident to affectedNodes should be set to the center of the corresponding nodes. This option sets the resetPorts property on the created object.
- considerGrouping - boolean
- Whether or not the grouping structure should be considered. This option sets the considerGrouping property on the created object.
- enabled - boolean
Properties
Gets or sets whether or not the grouping structure should be considered.
Remarks
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.
Default Value
true
.The grouping structure is considered.
Property Value
true
if the grouping structure is considered, false
otherwiseGets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.
Remarks
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.
Implements
Gets or sets whether or not bends of edges incident to affectedNodes should be removed.
Default Value
true
.Bends should be removed.
Property Value
true
if bends are removed, false
otherwiseSee Also
Gets or sets whether or not ports of edges incident to affectedNodes should be set to the center of the corresponding nodes.
Default Value
false
.Ports are not set to the center.
Property Value
true
if ports are set to the center of the corresponding node, false
otherwiseSee Also
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph to apply the layout to.
Implements
Starts the layout.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
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.
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
- ↪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.
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
- ↪PlaceNodesAtBarycenterStageData<INode,IEdge,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given PlaceNodesAtBarycenterStage.
LayoutExecutor
type is available at runtime.Constants
A data key for determining which nodes should be placed by this stage.
Remarks
true
to a node if the node should be placed by this stage, or false
otherwise.See Also
A data key for specifying the size of affected nodes.