title: What is the best way to form age groups from a list in D3?
body: <p>I am just starting to wrap my head around D3 and arraysorting.</p>
  
  <p>What I have a list of "people". Which I'd like to display separated by gender the amount of people in age groups.</p>
  
  <pre><code>{"age": 73, "sex": "F"},{"age": 65,"sex": "M"} ...
  </code></pre>
  
  <p>Result could be something like:</p>
  
  <pre><code>male = {"age-group" : "0-10", "count" : "3"}, ...
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{"key":"M","values":[{"age-group":"1-10","values":[{"age": 3,"sex":"M},....  
  </code></pre>
  
  <p>I'd browsed through all available tutorials on d3 and supporting libraries. I have the feeling I could manage the task by using scales and d3.nest or crossfilter.js with dimesions for sex and filtering for ages. But somehow I have the feeling I am missing something. What approach would you suggest?</p>