Starting from this example http://bl.ocks.org/1062288 I would like to have a tree with all the nodes collapsed, so the initial graph should contain only one node (the root).
Starting from this example http://bl.ocks.org/1062288 I would like to have a tree with all the nodes collapsed, so the initial graph should contain only one node (the root).
var allnode = flatten(root);
for (var i=0;i<allnode.length;i++){click(allnode[i])}
for those still looking for it, here is 2 lines of code. compact and easy to understand.