code: function ensureSmin (G, rankSets) {
    for (var i = 0; i < rankSets.length; ++i) {
      if (rankSets[i].type === 'min') {
        return rankSets  // ok
      }
    }
  
    // find the first sourceSet node, or else use the first node
    var sources = G.sources()
    var n0 = sources.length ? sources[0] : G.nodes()[0]
    return [{ type: 'min', nodes: [ n0 ] }].concat(rankSets)
  }
docs: export function linkDelta (nodeBackwards, link) { if (nodeBackwards(link.source)) { return nodeBackwards(link.target) ? 1 : 0 } else { return nodeBackwards(link.target) ? 0 : 1 } }