Represents a node in the directed graph data structure LayoutGraph.
Remarks
A node in a directed graph provides access to its adjacent edges, which are instances of the LayoutEdge class. These edges can be categorized into two sets: incoming edges and outgoing edges.
This class offers IEnumerable<T>s for iterating over the edges associated with the node, providing a read-only view of each edge set. Utilize the methods edges, inEdges, and outEdges for edge iteration.
The total number of edges connected to this node is referred to as its degree (degree), which is the sum of incoming edges (inDegree) and outgoing edges (outDegree).
Important: Structural modifications to the graph must be managed through the LayoutGraph class. To create or delete a LayoutNode or an LayoutEdge, use the appropriate methods provided by the LayoutGraph instance.
This class cannot be instantiated
Type Details
- yFiles module
- algorithms
See Also
Properties
Gets the overall number of edges connected to this node, both incoming and outgoing.
Remarks
See Also
Provides access to all edges adjacent to this node.
Remarks
See Also
Gets the graph that this node belongs to.
Remarks
null
.Property Value
null
if the node has been removed from a graph.See Also
Gets the number of incoming edges connected to this node.
Property Value
See Also
Gets the index of this node within its graph.
Remarks
Node indices represent the order of nodes during standard node iteration over the corresponding graph g
. The index value is guaranteed to be greater than or equal to zero and less than g.Nodes.Count
.
Note that the index may change whenever the sequence of nodes in the graph is modified, such as when nodes are created, removed, re-inserted, or explicitly repositioned in the sequence.
See Also
Provides access to the incoming edges connected to this node.
Remarks
See Also
Gets a live view of the labels associated with this node.
Property Value
See Also
Gets the layout of the node, which includes its size and location.
Gets the number of outgoing edges connected to this node.
Property Value
See Also
Provides access to the outgoing edges connected to this node.
Remarks
See Also
Gets or sets the tag object associated with this item instance.
Remarks
See Also
Implements
Methods
Retrieves the data associated with this node from the registered IMapper<K,V> in the owning graph using the specified look-up key.
Type Parameters
- TData
- The type of the values registered with the specified look-up key.
Parameters
A map of options to pass to the method.
- dataKey - NodeDataKey<TData>
- The look-up key used to query the map for the node's data. This node must currently be part of a LayoutGraph; otherwise, an exception will be thrown. If the node has been temporarily removed from the graph, you can use getItemData to access its data.
Returns
- ↪TData?
- The data item for the node from the registered IMapper<K,V> using the specified look-up key, or the default value of
TData
if no map was registered.
Throws
Sorts the incoming edges at this node according to the specified comparison function.
Parameters
A map of options to pass to the method.
- comparator - function(LayoutEdge, LayoutEdge):number
- The comparison function to sort the incoming LayoutEdges.
Signature Details
function(x: LayoutEdge, y: LayoutEdge) : number
Encapsulates a method that compares two objects.Parameters
- x - LayoutEdge
- The first object to compare.
- y - LayoutEdge
- The second object to compare.
Returns
- number
- An integer value which is
<0
ifx
is less thany
,0
ifx
is equal toy
, or>0
ifx
is greater thany
See Also
Sorts the outgoing edges at this node according to the specified comparison function.
Parameters
A map of options to pass to the method.
- comparator - function(LayoutEdge, LayoutEdge):number
- The comparison function to sort the outgoing LayoutEdges.
Signature Details
function(x: LayoutEdge, y: LayoutEdge) : number
Encapsulates a method that compares two objects.Parameters
- x - LayoutEdge
- The first object to compare.
- y - LayoutEdge
- The second object to compare.
Returns
- number
- An integer value which is
<0
ifx
is less thany
,0
ifx
is equal toy
, or>0
ifx
is greater thany