Represents an edge, i.e., a directed connection between two nodes (represented by instances of class YNode) in the directed graph data type Graph.
Remarks
The directed stems from the fact that an edge has a distinct source node and a distinct target node. Using pair notation, an edge would be written as (<source node>, <target node>).
Most notably, an edge provides access to its source node (source) and its target node (target). Note that an edge can have the same node as its source and target. Such an edge is then called "self-loop" and method selfLoop yields true
.
Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that there is no way to create or delete a node or an edge without using an actual Graph instance.
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.Edge
See Also
Constructors
Edge
(g: Graph, v: YNode, e1: Edge, w: YNode, e2: Edge, d1: GraphElementInsertion, d2: GraphElementInsertion)Creates a new edge that belongs to the given graph.
Remarks
The new edge e
has source node v
and target node w
.
Edge e
is inserted in such a way that an iteration over the edges at node v
returns e
- after
e1
, ifd1 == AFTER
- before
e1
, ifd1 == BEFORE
,
and an iteration over the edges at w
returns e
- after
e2
, ifd2 == AFTER
- before
e2
, ifd2 == BEFORE
.
Preconditions
- Edge
e1
must have source nodev
and edgee2
must have target nodew
.
Parameters
A map of options to pass to the method.
- g - Graph
- v - YNode
- The source node of the edge.
- e1 - Edge
- An edge with source node
v
. - w - YNode
- The target node of the edge.
- e2 - Edge
- An edge with target node
w
. - d1 - GraphElementInsertion
- d2 - GraphElementInsertion
Properties
Gets the graph this edge belongs to.
Remarks
null
.Gets the index of this edge within its graph G.
Remarks
Edge indices represent the ordering of standard edge iteration on G. The value of an index is >= 0
and < G.edgeCount()
.
Note that indices are subject to change whenever the sequence of edges in a graph is modified by either removing, hiding, reinserting, or unhiding an edge, or by explicitly changing its position in the sequence.
Preconditions
- This edge must belong to some graph.
See Also
Gets the successor of this edge in the list of incoming edges at its target node.
Remarks
null
is returned.Preconditions
- This edge must belong to some graph.
See Also
Gets the successor of this edge in the list of outgoing edges at its source node.
Remarks
null
is returned.Preconditions
- This edge must belong to some graph.
See Also
Gets the predecessor of this edge in the list of incoming edges at its target node.
Remarks
null
is returned.Preconditions
- This edge must belong to some graph.
See Also
Gets the predecessor of this edge in the list of outgoing edges at its source node.
Remarks
null
is returned.Preconditions
- This edge must belong to some graph.
See Also
Gets true
if and only if this edge is a self-loop.
Remarks
See Also
Gets the source node connected to this edge.
See Also
Gets the target node connected to this edge.
See Also
Methods
Creates a copy of this edge that will be inserted into the given graph connecting the given source and target nodes.
Returns the node at the opposite edge end with respect to the given node.
Remarks
Preconditions
- The given node must be either the edge's source node or target node.