Represents a directed edge, a connection between two nodes, in the LayoutGraph data structure.
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
Type Details
- yFiles module
- algorithms
Properties
Gets a live view of the bends along this edge.
Property Value
Gets the LayoutGraph that this edge belongs to.
Remarks
null
if the edge has been removed from the graph.Gets the zero-based index of this edge within the LayoutGraph.
Remarks
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.
See Also
Gets a live view of labels that belong to this edge.
Remarks
Property Value
Gets a live view of the path points along this edge.
Remarks
Property Value
Gets the source node of the edge.
Gets or sets the tag object associated with this item instance.
Remarks
Implements
Gets the target node of the edge.
Methods
Returns the data stored for the edge in the IMapper<K,V> registered with the owning graph under the given look-up key.
Type Parameters
- TData
- The type of the data to retrieve.
Parameters
A map of options to pass to the method.
- 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.
Returns
- ↪TData?
- The data item associated with this edge in the IMapper<K,V> if found, otherwise the default value of
TData
.
Throws
Gets the node at the opposite end of the edge relative to the specified node.
Remarks
Preconditions
- The
node
must be either theor the node.
Parameters
A map of options to pass to the method.
- node - LayoutNode
Returns
- ↪LayoutNode
- The node at the opposite end of the edge from
node
.
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.
Parameters
A map of options to pass to the method.
- resetPorts - boolean
- If
true
, the source and target port offsets will be reset to the node center. Otherwise, the offsets remain unchanged.