Represents the analysis result computed by TreeAnalysis.
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.analysis.TreeAnalysisResult
See Also
Properties
Gets whether or not the analyzed structure is a directed, rooted tree.
Remarks
true
, the tree structure is directed and no edges were reversed (i.e. reversedEdges is empty). If false
, the analyzed graph is an undirected tree where it was necessary to reverse some edges in order to view it as a directed tree rooted at root.See Also
Gets all leaf nodes of the tree.
Gets the edges that would need to be reversed in order to make the graph a directed, rooted tree.
Remarks
See Also
Gets the root of the tree.
See Also
Methods
Gets the child nodes of the given node in the tree.
Complexity
O(|V|)
Parameters
A map of options to pass to the method.
- node - INode
- The parent node to get children from.
Returns
- ↪ResultItemCollection<INode>
- An IEnumerable<T> of
node
's children.
Throws
- Exception({ name: 'ArgumentError' })
- If the given node was not part of the graph at the time the analysis was invoked via run
See Also
node
is part of the reversedEdges, then the original edge direction is such that the child is actually a predecessor of node
.Gets the depth of the node, that is, the length of the path between the root and node
.
Remarks
Complexity
O(1)
Parameters
A map of options to pass to the method.
- node - INode
- The node to determine the depth for.
Returns
- ↪number
- The distance between the root node and
node
.
Throws
- Exception({ name: 'ArgumentError' })
- If the given node was not part of the graph at the time the analysis was invoked via run
See Also
Gets all nodes that are descendants of root
, including the edges that connect the descendants.
Remarks
Complexity
O(|V|)
Parameters
A map of options to pass to the method.
- root - INode
- The root node for which the descendants should be queried.
Returns
Throws
- Exception({ name: 'ArgumentError' })
- If the given node was not part of the graph at the time the analysis was invoked via run
See Also
Determines the nearest common ancestor for the given nodes.
Remarks
nodes
. Another way to look at this is to picture the result to be the root of the smallest sub-tree that contains all nodes
.Complexity
O(|V|)
Parameters
A map of options to pass to the method.
- nodes - INode
- The nodes for which to find the nearest common ancestor.
Returns
- ↪INode
- The nearest ancestor of all given nodes or
null
ifnodes
is empty.
Throws
Determines the nearest common ancestor for the given nodes.
Remarks
nodes
. Another way to look at this is to picture the result to be the root of the smallest sub-tree that contains all nodes
.Complexity
O(|V|)
Parameters
A map of options to pass to the method.
- nodes - IEnumerable<INode>
- The nodes for which to find the nearest common ancestor.
Returns
- ↪INode
- The nearest ancestor of all given nodes or
null
ifnodes
is empty.
Throws
- Exception({ name: 'ArgumentError' })
- If
nodes
containnull
or if one of the nodes was not part of the graph at the time the analysis was invoked via run.
See Also
Gets the parent node of the given tree node.
Complexity
O(1)
Parameters
A map of options to pass to the method.
- node - INode
- The child node to determine the parent of.
Returns
- ↪INode
- The parent node of
node
ornull
ifnode
is the root of the tree.
Throws
- Exception({ name: 'ArgumentError' })
- If the given node was not part of the graph at the time the analysis was invoked via run
See Also
Gets all nodes and edges of the sub-tree that has subtreeRoot
as root.
Remarks
Complexity
O(|V|)
Parameters
A map of options to pass to the method.
- subtreeRoot - INode
- The sub-tree root node.
Returns
Throws
- Exception({ name: 'ArgumentError' })
- If the given node was not part of the graph at the time the analysis was invoked via run