src/expandCollapseUtilities.js
function(node, collapsedChildren){
    var children = node.data('collapsedChildren');
    var i;
    for (i=0; i < children.length; i++){
      if (children[i].data('collapsedChildren')){
        collapsedChildren = collapsedChildren.union(this.getCollapsedChildrenRecursively(children[i], collapsedChildren));
      }
      collapsedChildren = collapsedChildren.union(children[i]);
    }
    return collapsedChildren;
  }
function(node, collapsedChildren){
    var children = node.data('collapsedChildren');
    var i;
    for (i=0; i < children.length; i++){
      if (children[i].data('collapsedChildren')){
        collapsedChildren = collapsedChildren.union(this.getCollapsedChildrenRecursively(children[i], collapsedChildren));
      }
      collapsedChildren = collapsedChildren.union(children[i]);
    }
    return collapsedChildren;
  }
function ( node , collapsedChildren ) { var children = node . data ( 'collapsedChildren' ) ; var i ; for ( i = 0 ; i < children . length ; i ++ ) { if ( children [ i ] . data ( 'collapsedChildren' ) ) { collapsedChildren = collapsedChildren . union ( this . getCollapsedChildrenRecursively ( children [ i ] , collapsedChildren ) ) ; } collapsedChildren = collapsedChildren . union ( children [ i ] ) ; } return collapsedChildren ; }
Get all collapsed children - including nested ones
@param node : a collapsed node
@param collapsedChildren : a collection to store the result
@return : collapsed children
Get all collapsed children - including nested ones