Specifies custom data for the PlaceNodesAtBarycenterStage.
Inheritance Hierarchy
Members
Show:
Constructors
Properties
Gets or sets the collection of nodes that should be affected by the PlaceNodesAtBarycenterStage.
Gets or sets the collection of nodes that should be affected by the PlaceNodesAtBarycenterStage.
These nodes are temporarily hidden, then the core layout algorithm (if any) is applied to the resulting graph, and, finally, the affected nodes are reinserted by placing them on the barycenter of their neighbors.
conversionfinal
Examples
Defining the subset of nodes that should be temporarily hidden can be done in various ways, mostly depending on which option is more convenient for a particular use case. You can use the ItemCollection<TItem>'s source property to use any .NET collection or IEnumerable<T>:
layoutData.affectedNodes = graphComponent.selection.nodesAlternatively, ItemCollection<TItem> also has an items property, which is a collection that already exists, in case the items may have to be added one by one. This can be more convenient than defining an own list and setting it to source:
for (const edge of graphComponent.selection.edges) {
layoutData.affectedNodes.items.add(edge.sourceNode)
layoutData.affectedNodes.items.add(edge.targetNode)
}A powerful option that doesn't use a collection is to use the predicate to set a custom delegate that returns for every node whether it is contained in the set or not:
// Temporarily hide nodes with labels
layoutData.affectedNodes = (node) => node.labels.size > 0See Also
Gets or sets the mapping from the affected nodes to their sizes.
Gets or sets the mapping from the affected nodes to their sizes.
The dimension of the affected nodes will be changed to the specified sizes after applying the core layout algorithm.
conversionfinal
See Also
Methods
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>Combines this instance with the given layout data.
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>Combines this instance with the given layout data.
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
final
Parameters
- data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
- The LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> to combine this instance with.
Return Value
- LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
- The combined layout data.
See Also
Developer's Guide
API
- CompositeLayoutData, GenericLayoutData