title: Resizable rectangles for nodes in D3 collapsible tree
body: <p>I modified the <a href="https://bl.ocks.org/mbostock/4339083" rel="nofollow">collapsible tree example</a> to use rectangles instead of circles.</p>
  
  <p><code></code><a href="https://plnkr.co/edit/UKUufJItPQqIKH8DBGLx?p=preview" rel="nofollow">https://plnkr.co/edit/UKUufJItPQqIKH8DBGLx?p=preview</a></p>
  
  <p>My question is how to get the rectangle heights to resize themselves depending on the text of the nodes. If you'll notice that the top node has overflowing text while the size of the </p>
  
  <p>I'm aware of .getBBox() and the <a href="https://bl.ocks.org/mbostock/7555321" rel="nofollow">canonical wrap example</a> but as I'm still newish to D3, I'm wondering how to bring it all together to get it to work.</p>