code: function normaliseEdge (G, e) {
    const edge = G.edge(e)
    const dummies = dummyNodes(G.node(e.v), G.node(e.w))
    if (dummies.length === 0) return
  
    G.removeEdge(e)
  
    let v = e.v
    dummies.forEach((dummy, i) => {
      const id = `__${e.v}_${e.w}_${i}`
      if (!G.hasNode(id)) {
        dummy.dummy = 'edge'
        G.setNode(id, dummy)
        if (i === 0) {
          G.graph().dummyChains.push(id)
        }
      }
      addDummyEdge(v, (v = id))
    })
    addDummyEdge(v, e.w)
  
    function addDummyEdge (v, w) {
      const label = { points: [], value: edge.value, origEdge: e, origLabel: edge }
      G.setEdge(v, w, label, e.name)
    }
  }
docs: based on https://github.com/cpettitt/dagre/blob/master/lib/normalize.js