score:1

Accepted answer

the easiest way to do this would be to filter your update selections on the depth (depth === 0 is the root node):

 var node = vis.selectall("g.node")
   .data(nodes, function(d) { return d.id || (d.id = ++i); });

 node = node.filter(function(d) { return d.depth > 0 });

you'd also have to do this for the links:

var link = vis.selectall("path.link")
  .data(tree.links(nodes), function(d) { return d.target.id; });

link = link.filter(function(d) { return d.source.depth > 0 });

Related Query