C

LayoutEdge

Represents a directed edge, a connection between two nodes, in the LayoutGraph data structure.
ImplementsInheritance Hierarchy

Remarks

A directed edge has a distinct source node and target node. It represents a one-way relationship where data or flow originates from the source and ends at the target. In pair notation, this is written as (<source node>, <target node>).

The edge exposes both its source and target nodes, which can be accessed for various graph operations.

Self-loops, where the edge connects a node to itself, are supported. In such cases, both source and target refer to the same node, and the selfLoop property returns true.

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 a live view of the bends along this edge.
readonlyfinal

Property Value

A live view of the bends along this edge.

See Also

Developer's Guide
Gets the LayoutGraph that this edge belongs to.
Returns the graph containing this edge, or null if the edge has been removed from the graph.
readonlyfinal
Gets the zero-based index of this edge within the LayoutGraph.

Edge indices are used to define the order of edge traversal within a graph. Indices are subject to change if the graph structure is modified, for example, by adding or removing edges.

The index of the edge is a value greater than or equal to 0 and less than the number of edges in the graph.

readonlyfinal

See Also

API
remove, reinsert
Gets a live view of labels that belong to this edge.
Labels provide additional information and can be positioned along the edge.
readonlyfinal

Property Value

A live view of labels that belong to this edge.

See Also

Developer's Guide
Gets a live view of the path points along this edge.
The path points of an edge are, in order, the sourcePortLocation, the bends, and the targetPortLocation.
readonlyfinal

Property Value

A live view of the path points along this edge.

See Also

Developer's Guide
Gets a value indicating whether this edge is a self-loop.
A self-loop occurs when the source and target nodes of the edge are the same.
readonlyfinal

Property Value

true if the edge is a self-loop; otherwise, false.

See Also

Developer's Guide
Gets the source node of the edge.
readonlyfinal

Property Value

The LayoutNode from which this edge originates.

See Also

Developer's Guide
API
target
Gets or sets the absolute position of the edge's source port.
conversionfinal

Property Value

A Point representing the absolute position of the source port.

See Also

Developer's Guide
Gets or sets the offset of the edge's source port from the center of its source node.
The offset is calculated relative to the center of the source node's layout.
conversionfinal

Property Value

A Point representing the offset of the source port.

See Also

Developer's Guide
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
Gets the target node of the edge.
readonlyfinal

Property Value

The LayoutNode to which this edge points.

See Also

Developer's Guide
API
source
Gets or sets the absolute position of the edge's target port.
conversionfinal

Property Value

A Point representing the absolute position of the target port.

See Also

Developer's Guide
Gets or sets the offset of the edge's target port from the center of its target node.
The offset is calculated relative to the center of the target node's layout.
conversionfinal

Property Value

A Point representing the offset of the target port.

See Also

Developer's Guide

Methods

Returns the data stored for the edge in the IMapper<K, V> registered with the owning graph under the given look-up key.
final

Parameters

dataKey: EdgeDataKey<TData>

This edge must currently be in a LayoutGraph, otherwise, this method will throw an exception. Directly use getItemData if it is required to access that of edges that are temporarily removed from the graph.

The look-up key that is used to query the map from the graph, containing the data for the edge.

Return Value

TData
The data item associated with this edge in the IMapper<K, V> if found, otherwise the default value of TData.

Throws

Exception ({ name: 'ArgumentError' })
Thrown if this edge does not belong to a graph (i.e., the graph property is null).
Gets the node at the opposite end of the edge relative to the specified node.
For self-loops, the same node is returned, as the source and target nodes are identical.
final

Parameters

node: LayoutNode
The node at one end of the edge, either the source or target node.

Return Value

LayoutNode
The node at the opposite end of the edge from node.

See Also

Developer's Guide
Resets the path of this edge by clearing all bends and optionally resetting the source and target port offsets to the center of the corresponding nodes.
final

Parameters

resetPorts?: boolean
If true, the source and target port offsets will be reset to the node center. Otherwise, the offsets remain unchanged.
Returns a string representation of this edge.
final

Return Value

string
A string representation of this edge.