title: d3 tree count all children
body: <p>I have a d3 tree based on the following...</p>
  
  <p><a href="http://bl.ocks.org/mbostock/1093025" rel="nofollow">http://bl.ocks.org/mbostock/1093025</a></p>
  
  <p>How would I get a count of all the children?  I have tried this however it counts all the rows in the tree...</p>
  
  <pre><code>$(".tree_badge").text(tree.links(nodes).length);
  </code></pre>
  
  <p>So in the example it should count all the children where children would be the orange coloured rows in the tree (like those in cluster, graph, etc).</p>
  
  <p>Thanks for any insight!</p>