Provides functionality to temporarily hide and unhide nodes and edges of a graph.
Remarks
Hiding and unhiding graph elements is often useful during algorithmic operations where specific elements should be ignored.
This class allows hiding and restoring nodes and edges in a LayoutGraph without permanently removing them. The hidden elements are tracked, so they can be selectively restored when required. This can be especially useful in graph algorithms that need to work on a subgraph.
Type Details
- yFiles module
- algorithms
Constructors
Initializes a new instance of the LayoutGraphHider class for the specified graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The LayoutGraph to operate on. All non-static hiding and unhiding methods will modify this graph.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown if the
graph
parameter isnull
.
Properties
Methods
Hides the specified node and all its adjacent edges.
Remarks
Parameters
A map of options to pass to the method.
- node - LayoutNode
- The LayoutNode to be hidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
node
parameter isnull
.
Hides the specified edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- The LayoutEdge to be hidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
edge
parameter isnull
.
Hides all nodes and edges in the graph.
Remarks
Hides the specified collection of edges.
Remarks
Parameters
A map of options to pass to the method.
- edges - IEnumerable<LayoutEdge>
- A collection of LayoutEdge objects to be hidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
edges
parameter isnull
.
Hides the specified collection of nodes and their adjacent edges.
Remarks
Parameters
A map of options to pass to the method.
- nodes - IEnumerable<LayoutNode>
- A collection of LayoutNode objects to be hidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
nodes
parameter isnull
.
Hides all graph elements except the specified nodes and optionally their adjacent edges.
Remarks
Parameters
A map of options to pass to the method.
- nodes - IEnumerable<LayoutNode>
- A collection of LayoutNode objects to remain visible.
- showAdjacentEdges - boolean
- If
true
, edges between the specified nodes will remain visible.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
nodes
parameter isnull
.
Unhides the specified edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- The LayoutEdge to be unhidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
edge
parameter isnull
.
Unhides the specified node and optionally its adjacent edges.
Remarks
Parameters
A map of options to pass to the method.
- node - LayoutNode
- The LayoutNode to be unhidden.
- unhideAdjacentEdges - boolean
- If
true
, adjacent edges will also be unhidden if the other endpoint is visible.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
node
parameter isnull
.
Unhides all previously hidden nodes and edges in the graph.
Remarks
Unhides the specified collection of edges.
Remarks
Parameters
A map of options to pass to the method.
- edges - IEnumerable<LayoutEdge>
- A collection of LayoutEdge objects to be unhidden.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
edges
parameter isnull
.
Unhides the specified collection of nodes and optionally their adjacent edges.
Remarks
Parameters
A map of options to pass to the method.
- nodes - IEnumerable<LayoutNode>
- A collection of LayoutNode objects to be unhidden.
- unhideAdjacentEdges - boolean
- If
true
, adjacent edges will also be unhidden if the other endpoint is visible.
Throws
- Exception({ name: 'ArgumentError' })
- Thrown when the
nodes
parameter isnull
.