title: D3js Select feature from geojson
body: <p>Learning D3, I am following a lot of tutorials. So far I could create a map of the US with an external json file for all the us-states. However, I like to draw a map with only one of the states (lets say Alabama, which is the 1st feature in the json file).</p>
  
  <p>The code so far:</p>
  
  <pre><code>&lt;script&gt;
  
          var w = 500;
          var h = 300;
  
          var svg = d3.select("body")
                      .append("svg")
                      .attr("width", w)
                      .attr("height",h);
  
          var projection = 3.geo.albersUsa().translate([w/2,h/2]).scale([500]);
          var path = d3.geo.path().projection(projection);
  
          d3.json("us-states.json", function(json){
  
              svg.selectAll("path")
                  .data(json.features)
                  .enter()
                  .append("path")
                  .attr("d",path)
                  .style("fill", "teal");
          });
  
     &lt;/script&gt;
  </code></pre>
  
  <p>And the sturcture of the .json: </p>
  
  <pre><code>{"type":"FeatureCollection","features":[{"type":"Feature","id":"01","properties":{"name":"Alabama"},"geometry":
  {"type":"Polygon","coordinates":[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],...
  </code></pre>
  
  <p>The most primitive way would be, to manually create a new json file with only Alabama in it, but I am sure there are better ways. I think I want to create a new variable with a json object , which I like to use subsequently in the d3.json-function. Something like:</p>
  
  <pre><code>var alabama = "us-states.json" (features.id["01"])
  
  d3.json("alabama", function(json){
  ...
  </code></pre>
  
  <p>but I dont know how to get the information out of the main json file.</p>