title: D3.js collapsible tree - expand/collapse nodes
body: <p>I have a D3.js collapsible tree which has a bunch of nodes as like shown in below figure <a href="https://i.stack.imgur.com/RuE8l.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RuE8l.jpg" alt="enter image description here"></a></p>
  
  <p>Now I want to collapse all other node if a node is expanded. For example in figure if <code>analytics node</code> is expanded then it should collapse <code>data node</code>. I am refering  <a href="https://stackoverflow.com/questions/17448894/d3-js-collapsible-tree-expand-collapse-intermediate-nodes">D3.js collapsible tree - expand/collapse intermediate nodes</a> but its not much helpful.</p>