dgraph.js
function raiseLevel(edge) {
  var s = edge.s
  var t = edge.t

  //Update position in edge lists
  removeEdge(s, edge)
  removeEdge(t, edge)
  edge.level += 1
  elist.insert(s.adjacent, edge)
  elist.insert(t.adjacent, edge)
  
  //Update flags for s
  if(s.euler.length <= edge.level) {
    s.euler.push(createEulerVertex(s))
  }
  var es = s.euler[edge.level]
  es.setFlag(true)

  //Update flags for t
  if(t.euler.length <= edge.level) {
    t.euler.push(createEulerVertex(t))
  }
  var et = t.euler[edge.level]
  et.setFlag(true)

  //Relink if necessary
  if(edge.euler) {
    edge.euler.push(es.link(et, edge))
  }
}
function raiseLevel(edge) {
  var s = edge.s
  var t = edge.t

  //Update position in edge lists
  removeEdge(s, edge)
  removeEdge(t, edge)
  edge.level += 1
  elist.insert(s.adjacent, edge)
  elist.insert(t.adjacent, edge)
  
  //Update flags for s
  if(s.euler.length <= edge.level) {
    s.euler.push(createEulerVertex(s))
  }
  var es = s.euler[edge.level]
  es.setFlag(true)

  //Update flags for t
  if(t.euler.length <= edge.level) {
    t.euler.push(createEulerVertex(t))
  }
  var et = t.euler[edge.level]
  et.setFlag(true)

  //Relink if necessary
  if(edge.euler) {
    edge.euler.push(es.link(et, edge))
  }
}
function raiseLevel ( edge ) { var s = edge . s var t = edge . t //Update position in edge lists removeEdge ( s , edge ) removeEdge ( t , edge ) edge . level += 1 elist . insert ( s . adjacent , edge ) elist . insert ( t . adjacent , edge ) //Update flags for s if ( s . euler . length <= edge . level ) { s . euler . push ( createEulerVertex ( s ) ) } var es = s . euler [ edge . level ] es . setFlag ( true ) //Update flags for t if ( t . euler . length <= edge . level ) { t . euler . push ( createEulerVertex ( t ) ) } var et = t . euler [ edge . level ] et . setFlag ( true ) //Relink if necessary if ( edge . euler ) { edge . euler . push ( es . link ( et , edge ) ) } }
Raise the level of an edge, optionally inserting into higher level trees
Raise the level of an edge optionally inserting into higher level trees