title: D3 data undefined when attempting nested selection
body: <p>I'm having trouble working with json data in D3. The file is read properly, judging from the fact that it appears when I <code>console.log</code>, and seems to be formatted right based on the way all the examples I found. But, when I try to do a nested selection using <code>.data(function(json_data){return json_data.accessibility;})</code> I get: "cannot read property 'length' of undefined". </p>
  
  <p>My function:</p>
  
  <pre><code>//load scenario json data
  d3.json("./SupportTool/scenario1result.json", function(error, json_data){
  if(error) {return console.warn(error)};
  console.log(json_data); //works
  
  // add main SVG block
  var svg = d3.select(d3id)
      .append('svg')
      .attr('width', 300)
      .attr('height', 75)
      .attr('id', 'svgblock');
  
  // add an SVG group element for each scenario
  var series = svg.selectAll('g.series')
      .data(d3.keys(json_data))
      .enter()
      .append('g')
      .attr('class', 'series');
  
  var circles = series.selectAll("circle")
      .data(function(json_data){return json_data.accessibility;})
      .enter()
      .append("circle");
  var circleAttributes = circles
      .attr("cx", 20)
      .attr("cy", 20)
      .attr("r", 20)
      .style("color","blue");       });
  </code></pre>
  
  <p>My json data:</p>
  
  <pre><code>{
  "meta":[{"sc":"1"},{"stratid":"1"}],
  
  "accessibility":[
      {"pop400":"77"},{"pop800":"86"},{"jobs800":"78"},{"pop400tr":"41"},{"pop800tr":"69"},{"jobs800tr":"80"}
  ],
  
  "housing":[
      {"newcom":"0"},{"redev":"100"},
      {"apt5":"6"},{"apt4":"65"},{"twn":"14"},{"sglf":"15"},
  
      {"urb":"0"},{"urbhec":"0"}
  
  ],
  
  "transport":[
  
      {"walk":"55"},{"transit":"18"},{"auto":"27"},
      {"vkt":"11000"},
  
      {"kmtr":"502"},{"form":"grid"},
      {"lanekm":"3250"},
  
      {"ghgtr":"67"},{"ghgres":"75"}
  ],
  
  "costs":[
      {"roadcapbils":null,"roadcap":null},
      {"transitcapbils":null,"transitcap":null},
      {"watercapbils":null,"watercap":null},
      {"firecapbils":null,"firecap":null},
      {"reccapbils":null,"reccap":null},
      {"educapbils":null,"educap":null}
  ],
  
  "opcosts":[
      {"roadopbils":null,"roadop":null},
      {"transitoppbils":null,"transitop":null},
      {"wateropbils":null,"waterop":null},
      {"fireopbils":null,"fireop":null},
      {"parksopbils":null,"parksop":null}
  ] }    
  </code></pre>