code: function rankWeights(g, fixed, movable) {
      var fixedPos = dig_dot_layout_orderMap(g, fixed);
      var weights = {};
      for (var i = 0; i < movable.length; ++i) {
        var weight = -1;
        var u = movable[i];
        var sucs = g.neighbors(movable[i], "both").filter(function(v) { return v in fixedPos; });
        if (sucs.length > 0) {
          weight = 0;
          sucs.forEach(function(v) {
            weight += fixedPos[v];
          });
          weight = weight / sucs.length;
        }
        weights[u] = weight;
      }
      return weights;
    }
docs: /*
  Given a fixed layer and a movable layer in a graph, this function will
  return weights for the movable layer that can be used to reorder the layer
  for potentially reduced edge crossings.