_cleanupTemporaryNodesAndEdges() {
    // _clean temporary edges
    for (let i = 0; i < this.temporaryIds.edges.length; i++) {
      this.body.edges[this.temporaryIds.edges[i]].disconnect();
      delete this.body.edges[this.temporaryIds.edges[i]];
      const indexTempEdge = this.body.edgeIndices.indexOf(
        this.temporaryIds.edges[i]
      );
      if (indexTempEdge !== -1) {
        this.body.edgeIndices.splice(indexTempEdge, 1);
      }
    }

    // _clean temporary nodes
    for (let i = 0; i < this.temporaryIds.nodes.length; i++) {
      delete this.body.nodes[this.temporaryIds.nodes[i]];
      const indexTempNode = this.body.nodeIndices.indexOf(
        this.temporaryIds.nodes[i]
      );
      if (indexTempNode !== -1) {
        this.body.nodeIndices.splice(indexTempNode, 1);
      }
    }

    this.temporaryIds = { nodes: [], edges: [] };
  }
Neatly clean up temporary edges and nodes
@private