title: Using d3.selectAll with nested json
body: <p>Here i want to create bars for each album with the numbers of 'a_tracks' but i can't get into the node "album".</p>
  
  <pre><code>[
      {
          "blazz" : "HisName",
          "firstname" : "HisFirstname",
          "album" :
              [
                  {
                      "a_name" : "titlehere",
                      "a_sells" : 90,
                      "a_years" : 2000,
                      "a_tracks" : 12
                  }
                  ,
                  {
                      "a_name" : "othertitlehere",
                      "a_sells" : 200,
                      "a_years" : 2000,
                      "a_tracks" : 8
                  }
              ]
      }
  ]
  </code></pre>
  
  <p>I try this but it's not working :</p>
  
  <pre><code>  d3.json('data.json', function(data){
      var albums = data.map(function(d) { return d.album });
  
      var canvas = d3.select("body").append('svg')
        .attr("width", 500)
        .attr("height",500)
  
      canvas.selectAll("rect")
        .data(albums)
        .enter()
          .append("rect")
          .attr('width', function(d){ return d.a_tracks*10;})
          .attr('height',50)
          .attr('y',function(d,i){ return i * 52;})
          .attr('fill','blue')
  </code></pre>
  
  <p>I'm on the wrong way to do this ?
  (Json is given a my backbone collection)</p>