d3.js force diagram: collapse parent children to tidy up path

246 Views Asked by At

I'm using d3.js for a force diagram and was wondering if anyone could help me with a problem I have? I'd like to hide the parent children as the user clicks down through a branch if that makes sense... tricky to explain so I made a quick sketch:

enter image description here

The green node is the root, and the red nodes have children but are closed because there is an open option further down the branch.

I hope that makes sense! Is this behaviour possible?

0

There are 0 best solutions below