addEdge(edge) {
    const sourceNode = this.findNode(edge.getSourceNodeId());
    const targetNode = this.findNode(edge.getTargetNodeId());

    if (!sourceNode || !targetNode) {
      log.warn(
        `Unable to add edge ${edge.id},  source or target node is missing.`
      )();
      return;
    }

    this._edgeMap[edge.getId()] = edge;
    sourceNode.addConnectedEdges(edge);
    targetNode.addConnectedEdges(edge);
    this._touchLastUpdate();
  }
/**
   * Add a new edge to the graph.
   * @param {Edge} edge - expect a Edge object to be added to the graph.
   */
Add a new edge to the graph.
@param {Edge} edge - expect a Edge object to be added to the graph.
Add a new edge to the graph . @param { Edge } edge - expect a Edge object to be added to the graph .
addEdge(edge) {
    const sourceNode = this.findNode(edge.getSourceNodeId());
    const targetNode = this.findNode(edge.getTargetNodeId());
    if (!sourceNode || !targetNode) {
      log.warn(
        `Unable to add edge ${edge.id},  source or target node is missing.`
      )();
      return;
    }
    this._edgeMap[edge.getId()] = edge;
    sourceNode.addConnectedEdges(edge);
    targetNode.addConnectedEdges(edge);
    this._touchLastUpdate();
  }
addEdge ( edge ) { const sourceNode = this . findNode ( edge . getSourceNodeId ( ) ) ; const targetNode = this . findNode ( edge . getTargetNodeId ( ) ) ; if ( ! sourceNode || ! targetNode ) { log . warn ( ` ${ edge . id } ` ) ( ) ; return ; } this . _edgeMap [ edge . getId ( ) ] = edge ; sourceNode . addConnectedEdges ( edge ) ; targetNode . addConnectedEdges ( edge ) ; this . _touchLastUpdate ( ) ; }
Add a new edge to the graph.
Add a new edge to the graph .