Provides less frequently used methods for analyzing and managing grouped graphs.
Inheritance Hierarchy
Remarks
An instance of this class configured for a given IGraph instance can be obtained via groupingSupport.
See Also
Developer's Guide
Members
No filters for this type
Constructors
Methods
Calculates the minimum area to enclose by the given group node with respect to its IGroupBoundsCalculator.
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 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.
Enlarges all group nodes in the graph in an interactive scenario, so that the minimum enclosed area is respected.
This method should be used in an interactive editing scenario. It records an ICompoundEdit to support undoability and uses the IReshapeHandler for the resizing of the nodes. That way, e.g. orthogonally edited edges will be properly reshaped.
final
Parameters
- 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 its bounds.
Enlarges the given group node to ensure that the minimum enclosed area is inside its bounds.
This method can be used to resize a group node and all of its parent group nodes to fully contain its children, e.g. after a child node has changed its bounds. Note that this method will only enlarge the bounds of the group nodes, it will never reduce the size of a group node.
final
Parameters
- groupNode: INode
- The group node to resize.
- ancestors: boolean
- if set to
trueall 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.
Enlarges the group nodes in an interactive scenario, using IReshapeHandler implementations of the group nodes to perform the actual resizing.
This method should be used in an interactive editing scenario. It records an ICompoundEdit to support undoability and uses the IReshapeHandler for the resizing of the nodes. That way, e.g. orthogonally edited edges will be properly reshaped.
final
Parameters
- context: IInputModeContext
- The context to use for the IReshapeHandlers.
- node: INode
- The node to enlarge appropriately.
- ancestors: boolean
- if set to
trueancestors the ancestor group nodes will be adjusted, too, if necessary.
See Also
Gets the path to root traversing all parents of the given item.
Gets the path to root traversing all parents of the given item.
final
Parameters
- node: INode
- The node to start.
Return Value
- IListEnumerable<INode>
- A readonly list that includes the node but not the root, unless they are identical and all parents in between them.
Examples
const pathToRoot = graph.groupingSupport.getAncestors(node1_1)
// node1_1, group1, innerGroup, outerGroupSee Also
Developer's Guide
Returns all descendants of the provided node that are part of the grouped graph.
Returns all descendants of the provided node that are part of the grouped graph.
The enumeration will be top down, i.e. all of a node's ancestors will be enumerated before the respective node.
final
Parameters
- node: INode
- The root node to get the descendants from.
Return Value
- 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_1See Also
Developer's Guide
API
- getChildren, getDescendantsBottomUp
Returns all descendants of the provided node that are part of the grouped graph.
Returns all descendants of the provided node that are part of the grouped graph.
The enumeration will be bottom up, i.e. all of a node's children will be enumerated before the respective node.
final
Parameters
- node: INode
- The root node to get the descendants from.
Return Value
- 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, nodeInOuterGroupSee Also
Developer's Guide
API
- getChildren, getDescendants
final
Parameters
- nodes: INode
- The nodes to find the nearest common ancestor of.
Return Value
- INode
- The nearest common ancestor of the provided nodes.
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) // innerGroupSee Also
Developer's Guide
Determines the nearest common ancestor of the provided nodes in the graph.
Determines the nearest common ancestor of the provided nodes in the graph.
final
Parameters
- nodes: IEnumerable<INode>
- The nodes to find the nearest common ancestor of.
Return Value
- INode
- The nearest common ancestor of the provided nodes.
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) // innerGroupSee Also
Developer's Guide
final
Parameters
Return Value
- boolean
- Whether
ancestoris an ancestor ofnode.
Examples
// 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,
) // falseSee Also
Developer's Guide
API
- getDescendants, getDescendantsBottomUp