@graphty/graphty-element / Edge / EdgeMap
Class: EdgeMap
Defined in: src/Edge.ts:1055
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: src/Edge.ts:1056
Accessors
size
Get Signature
get size():
number
Defined in: src/Edge.ts:1112
Gets the total number of edges stored in the map.
Returns
number
The total count of all edges
Methods
clear()
clear():
void
Defined in: src/Edge.ts:1146
Removes all edges from the map.
Returns
void
delete()
delete(
srcId,dstId):boolean
Defined in: src/Edge.ts:1127
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: src/Edge.ts:1099
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: src/Edge.ts:1064
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: src/Edge.ts:1079
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