code: function sortFn(a, b) {
      var apct = getWeightedPercent(a);
      var bpct = getWeightedPercent(b);
      var diff = apct - bpct;
  
      if (diff === 0) {
        return ascending(a.id(), b.id()); // make sure sort doesn't have don't-care comparisons
      } else {
        return diff;
      }
    }
docs: rearrange the indices in each depth level based on connectivity