D3 Paths from external data not appearing
<p>I have downloaded a file from OSM and taken a few coordinates to practice loading data from a GeoJSON and writing them into an SVG. Most of the JS code is taken from the maps tutorial by D3Vienno but even though I do not get errors I cannot get anything to appear on screen. Here is the JS file: </p>

<pre><code>window.onload = function(){

var canvas = d3.selectAll("body").append("svg")
    .attr("width", 600)
    .attr("height", 600)

d3.json("test.geojson", function (data){

    var group = canvas.selectAll("g")
    .data(data)
    .enter()
    .append("g")

    var projection= d3.geo.albers();

    var path = d3.geo.path().projection(projection); //.scale(450).translate([0, 1980]);

    var areas = group.append("path")
        .attr("d", path)
        .attr("class", "area")
        .style("stroke-width", 1)
        .style("fill", "none")
        .style("stroke", "steelblue");


});
}
</code></pre>

<p>The GeoJSON file has been validated by jsonformatter and I also built a <a href="https://jsfiddle.net/7joagLar/1/" rel="nofollow">JSFiddle</a> of it to see if that makes a difference.</p>

<p>If I don't comment out the <code>.scale(450).translate([0, 1980])</code> portion I get a "is not a function error" but it is in the API and I believe it is formatted correctly. </p>

<p>Here is also the HTML:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script type="text/javascript" src="http://localhost:8080/d3.min.js"&gt;&lt;/script&gt;
    &lt;!--&lt;script src="test.geojson"&gt;&lt;/script&gt;--&gt;
    &lt;script type="text/javascript" src="mapPractice.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>If I don't comment out the script tag for the GeoJSON I get "unexpected token error : in the GeoJSON file and this continues to happen until I delete everything but the coordinates, and then I get "Cannot read property 'length' of null" in the D3 file. Sorry for such a multi-part question but I've been trying to understand this problem for days and I just go in circles. </p>