examples/browser/tree/tree.js
function collapse(d) {
    if (d.children) {
      d._children = d.children;
      d._children.forEach(collapse);
      d.children = null;
    }
  }
function collapse(d) {
    if (d.children) {
      d._children = d.children;
      d._children.forEach(collapse);
      d.children = null;
    }
  }
function collapse ( d ) { if ( d . children ) { d . _children = d . children ; d . _children . forEach ( collapse ) ; d . children = null ; } }
Collapse the node and all it's children
Collapse the node and all it s children