title: Loop through array of arrays in D3
body: <p>I have an array of x objects each with an array of y objects like so:</p>
  
  <pre><code>var data = [
      { name: '1', data: [1,2,3] },
      { name: '2', data: [1,2,3] }
  ]
  </code></pre>
  
  <p>Is there a way to chain d3 functions in order to iterate through each data[x] and each data[x][y]?</p>
  
  <p>I thought something like this would have helped, but not apparently:</p>
  
  <pre><code>var svg = d3.selectAll('g')
      .data(data)
      .enter()
      .append('g')
      .selectAll('rect') /* This might be made up, but it makes sense to me :)*/
      .data(data, function (d, i) {
          return data[i].data;
      })
      .enter()
      .append('rect')
  </code></pre>
  
  <p>Thanks</p>