Provides less frequently used methods for analyzing and managing grouped graphs.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.GroupingSupport
See Also
Constructors
Methods
Calculates the minimum area to enclose by the given group node with respect to its IGroupBoundsCalculator.
Enlarges all group nodes in the graph so that the minimum enclosed area is respected.
Enlarges all group nodes in the graph in an interactive scenario, so that the minimum enclosed area is respected.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to use for the IReshapeHandlers.
See Also
Enlarges the given group node to ensure that the minimum enclosed area is inside of its bounds.
Remarks
Parameters
A map of options to pass to the method.
- groupNode - INode
- The group node to resize.
- ancestors - boolean
- if set to
true
all ancestor group nodes will be resized, too, if necessary
See Also
Enlarges the group nodes in an interactive scenario, using IReshapeHandler implementations of the group nodes to perform the actual resizing.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to use for the IReshapeHandlers.
- node - INode
- The node to enlarge appropriately.
- ancestors - boolean
- if set to
true
ancestors the ancestor group nodes will be adjusted, too, if necessary.
See Also
Returns all descendants of the provided node that are part of the grouped graph.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The root node to get the descendants from.
Returns
- ↪IEnumerable<INode>
- An enumeration of the children of the node at the time of this invocation in reverse DFS prefix order.
Examples
// GetDescendants is available on the graph's grouping support
const descendants = graph.groupingSupport.getDescendants(outerGroup)
// nodeInOuterGroup, innerGroup, group2, node2_1, group1, node1_2, node1_1
See Also
Returns all descendants of the provided node that are part of the grouped graph.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The root node to get the descendants from.
Returns
- ↪IEnumerable<INode>
- An enumeration of the children of the node at the time of this invocation in DFS postfix order.
Examples
const descendantsBottomUp =
graph.groupingSupport.getDescendantsBottomUp(outerGroup)
// node1_1, node1_2, group1, node2_1, group2, innerGroup, nodeInOuterGroup
See Also
Determines the nearest common ancestor of the provided nodes in the graph.
Parameters
A map of options to pass to the method.
- nodes - INode
- The nodes to find the nearest common ancestor of.
Examples
// get the grouping support for the graph
const groupingSupport = graph.groupingSupport
// get the nearest common ancestor for node1_1 and node1_2
groupingSupport.getNearestCommonAncestor(node1_1, node1_2) // group1
// get the nearest common ancestor for node1_1 and node2_1
groupingSupport.getNearestCommonAncestor(node1_1, node2_1) // innerGroup
See Also
Determines the nearest common ancestor of the provided nodes in the graph.
Parameters
A map of options to pass to the method.
- nodes - IEnumerable<INode>
- The nodes to find the nearest common ancestor of.
Examples
// get the grouping support for the graph
const groupingSupport = graph.groupingSupport
// get the nearest common ancestor for node1_1 and node1_2
groupingSupport.getNearestCommonAncestor(node1_1, node1_2) // group1
// get the nearest common ancestor for node1_1 and node2_1
groupingSupport.getNearestCommonAncestor(node1_1, node2_1) // innerGroup
See Also
Gets the path to root traversing all parents of the given item.
Parameters
A map of options to pass to the method.
- node - INode
- The node to start.
Returns
- ↪IList<INode>
- A list that includes the node but not the root, unless they are identical and all parents in between them.
Examples
const pathToRoot = graph.groupingSupport.getPathToRoot(node1_1)
// node1_1, group1, innerGroup, outerGroup
See Also
Determines whether ancestor
is an ancestor of node
in the grouped graph.
Parameters
A map of options to pass to the method.
Returns
- ↪boolean
- Whether
ancestor
is an ancestor ofnode
.
Examples
const graph = graphComponent.graph
// create a grouped graph:
// Root
// outerGroup
// innerGroup nodeInOuterGroup
// group1 group2
// node1_1 node1_2 node2_1
const outerGroup = graph.createGroupNode()
const innerGroup = graph.createGroupNode(outerGroup)
const nodeInOuterGroup = graph.createNode(outerGroup)
const group1 = graph.createGroupNode(innerGroup)
const group2 = graph.createGroupNode(innerGroup)
const node1_1 = graph.createNode(group1)
const node1_2 = graph.createNode(group1)
const node2_1 = graph.createNode(group2)
// get the graph's grouping support
const groupingSupport = graph.groupingSupport
// test whether a node is a descendant of a given group
const node1_1IsDescendantOfGroup1 = groupingSupport.isDescendant(
node1_1,
group1
) // true
const node1_1IsDescendantOfOuterGroup = groupingSupport.isDescendant(
node1_1,
outerGroup
) // true
const node1_1IsDescendantOfGroup2 = groupingSupport.isDescendant(
node1_1,
group2
) // false