score:0

Accepted answer

you can just pop out the last node you make in update(source), which is the root node. like this:

    // compute the new tree layout.
    var nodes = tree.nodes(root).reverse();
    nodes.pop()

Related Query

More Query from same tag