C

LayoutNode

Represents a node in the directed graph data structure LayoutGraph.
ImplementsInheritance Hierarchy

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

See Also

Developer's Guide

Members

Show:

Properties

Gets the overall number of edges connected to this node, both incoming and outgoing.
Self-loops are counted twice in the degree.
readonlyfinal

See Also

API
inDegree, outDegree, edges
Provides access to all edges adjacent to this node.
This property returns a dynamic IEnumerable<T> that allows iteration over both incoming and outgoing LayoutEdges connected to this node. It reflects the current state of the node's adjacency, meaning any changes to the graph structure during iteration may lead to undefined behavior. Self-loop edges are reported twice, once as incoming and once as outgoing.
readonlyfinal

See Also

API
degree, inEdges, outEdges
Gets the graph that this node belongs to.
If the node does not belong to a graph because it has been removed, this property will return null.
readonlyfinal

Property Value

The LayoutGraph this node belongs to, or null if the node has been removed from a graph.

See Also

Developer's Guide
Gets the number of incoming edges connected to this node.
readonlyfinal

Property Value

The number of incoming edges.

See Also

API
degree, outDegree, inEdges
Gets the index of this node within its graph.

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.

readonlyfinal

See Also

Developer's Guide
API
remove, reinsert
Provides access to the incoming edges connected to this node.
This property returns a dynamic IEnumerable<T> that allows iteration over the LayoutEdges that lead to this node. It reflects the current state of the node's adjacency, meaning any changes to the graph structure during iteration may lead to undefined behavior. Self-loop edges are included in the results.
readonlyfinal

See Also

API
inDegree, edges, outEdges
Gets a live view of the labels associated with this node.
readonlyfinal

Property Value

A dynamic enumerable that provides a live view of this node's labels. Changes to the labels will be reflected in real time.

See Also

Developer's Guide
Gets the layout of the node, which includes its size and location.
readonlyfinal

Property Value

The node's layout.
Gets the number of outgoing edges connected to this node.
readonlyfinal

Property Value

The number of outgoing edges.

See Also

API
degree, inDegree, outEdges
Provides access to the outgoing edges connected to this node.
This property returns a dynamic IEnumerable<T> that allows iteration over the LayoutEdges originating from this node. It reflects the current state of the node's adjacency, meaning any changes to the graph structure during iteration may lead to undefined behavior. Self-loop edges are included in the results.
readonlyfinal

See Also

API
outDegree, edges, inEdges
Gets or sets the tag object associated with this item instance.
The tag is an optional user-defined object which can be used to store arbitrary data related to this item. The item itself just provides the storage for the object.
final

Methods

Retrieves the data associated with this node from the registered IMapper<K, V> in the owning graph using the specified look-up key.
final

Parameters

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.

Return Value

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

Exception ({ name: 'ArgumentError' })
Thrown when this node is not part of a graph (i.e., when the graph property is null).
Sorts the incoming edges at this node according to the specified comparison function.
final

Parameters

comparator: function(LayoutEdge, LayoutEdge): number
The comparison function to sort the incoming LayoutEdges.

See Also

API
sortOutEdges
Sorts the outgoing edges at this node according to the specified comparison function.
final

Parameters

comparator: function(LayoutEdge, LayoutEdge): number
The comparison function to sort the outgoing LayoutEdges.

See Also

API
sortInEdges
Returns a string representation of this node.
final

Return Value

string
A string representation of this node.