example-d3/webworker.js
/** Helper function for sortDocumentOrder. Returns a list of indices, from the
   * node to the root, of positions within parent.
   * For convenience, the node is the first element of the array.
   */
Helper function for sortDocumentOrder. Returns a list of indices, from the
node to the root, of positions within parent.
For convenience, the node is the first element of the array.
Helper function for sortDocumentOrder . Returns a list of indices from the node to the root of positions within parent . For convenience the node is the first element of the array .
function addressVector(node) {
    var r = [node];
    if (null != node.ownerElement) {
      node = node.ownerElement;
      r.push(-1);
    }
    while (null != node) {
      var i = 0;
      while (null != node.previousSibling) {
        node = node.previousSibling;
        i++;
      }
      r.push(i);
      node = node.parentNode
    }
    return r;
  }
function addressVector ( node ) { var r = [ node ] ; if ( null != node . ownerElement ) { node = node . ownerElement ; r . push ( - 1 ) ; } while ( null != node ) { var i = 0 ; while ( null != node . previousSibling ) { node = node . previousSibling ; i ++ ; } r . push ( i ) ; node = node . parentNode } return r ; }
Helper function for sortDocumentOrder.
Helper function for sortDocumentOrder .