example-d3/webworker.js
/** Sort node multiset. Does not do any de-duping. */
Sort node multiset. Does not do any de-duping.
Sort node multiset . Does not do any de - duping .
function sortNodeMultiSet(nodeMultiSet) {
    var a = [];
    for (var i = 0; i < nodeMultiSet.nodes.length; i++) {
      var v = addressVector(nodeMultiSet.nodes[i]);
      a.push({v:v, n:nodeMultiSet.nodes[i],
              p:nodeMultiSet.pos[i], l:nodeMultiSet.lasts[i]});
    }
    a.sort(compare);
    var r = {nodes:[], pos:[], lasts:[]};
    for (var i = 0; i < a.length; ++i) {
      r.nodes.push(a[i].n);
      r.pos.push(a[i].p);
      r.lasts.push(a[i].l);
    }
    function compare(x, y) {
      return addressComparator(x.v, y.v);
    }
    return r;
  }
function sortNodeMultiSet ( nodeMultiSet ) { var a = [ ] ; for ( var i = 0 ; i < nodeMultiSet . nodes . length ; i ++ ) { var v = addressVector ( nodeMultiSet . nodes [ i ] ) ; a . push ( { v : v , n : nodeMultiSet . nodes [ i ] , p : nodeMultiSet . pos [ i ] , l : nodeMultiSet . lasts [ i ] } ) ; } a . sort ( compare ) ; var r = { nodes : [ ] , pos : [ ] , lasts : [ ] } ; for ( var i = 0 ; i < a . length ; ++ i ) { r . nodes . push ( a [ i ] . n ) ; r . pos . push ( a [ i ] . p ) ; r . lasts . push ( a [ i ] . l ) ; } function compare ( x , y ) { return addressComparator ( x . v , y . v ) ; } return r ; }
Sort node multiset.
Sort node multiset .