@graphty/graphty-element / Edge / EdgeMap
Class: EdgeMap ​
Defined in: graphty-element/src/Edge.ts:1101
A specialized map data structure for storing edges using source and destination node IDs. Provides efficient lookup and management of edges in the graph.
Constructors ​
Constructor ​
new EdgeMap():
EdgeMap
Returns ​
EdgeMap
Properties ​
map ​
map:
Map<NodeIdType,Map<NodeIdType,Edge>>
Defined in: graphty-element/src/Edge.ts:1102
Accessors ​
size ​
Get Signature ​
get size():
number
Defined in: graphty-element/src/Edge.ts:1158
Gets the total number of edges stored in the map.
Returns ​
number
The total count of all edges
Methods ​
clear() ​
clear():
void
Defined in: graphty-element/src/Edge.ts:1192
Removes all edges from the map.
Returns ​
void
delete() ​
delete(
srcId,dstId):boolean
Defined in: graphty-element/src/Edge.ts:1173
Removes an edge from the map.
Parameters ​
srcId ​
The source node ID
dstId ​
The destination node ID
Returns ​
boolean
True if the edge was removed, false if it didn't exist
get() ​
get(
srcId,dstId):Edge|undefined
Defined in: graphty-element/src/Edge.ts:1145
Retrieves an edge from the map.
Parameters ​
srcId ​
The source node ID
dstId ​
The destination node ID
Returns ​
Edge | undefined
The edge if found, undefined otherwise
has() ​
has(
srcId,dstId):boolean
Defined in: graphty-element/src/Edge.ts:1110
Checks if an edge exists between the specified source and destination nodes.
Parameters ​
srcId ​
The source node ID
dstId ​
The destination node ID
Returns ​
boolean
True if the edge exists, false otherwise
set() ​
set(
srcId,dstId,e):void
Defined in: graphty-element/src/Edge.ts:1125
Adds an edge to the map. Throws an error if the edge already exists.
Parameters ​
srcId ​
The source node ID
dstId ​
The destination node ID
e ​
The edge instance to store
Returns ​
void