deleteEdge()

in src/components/graph-view.js [532:555]


  deleteEdge(selectedEdge: IEdge) {
    const { source, target } = selectedEdge;

    if (source == null || target == null) {
      return;
    }

    this.setState({
      componentUpToDate: false,
    });

    // remove from UI
    if (selectedEdge.source != null && selectedEdge.target != null) {
      // remove extra custom containers just in case.
      GraphUtils.removeElementFromDom(
        `edge-${selectedEdge.source}-${selectedEdge.target}-custom-container`,
        this.viewWrapper.current
      );
      GraphUtils.removeElementFromDom(
        `edge-${selectedEdge.source}-${selectedEdge.target}-container`,
        this.viewWrapper.current
      );
    }
  }