touch-ups to match lesson

pull/1/head
Matt Huntington 8 years ago
parent cde914075e
commit e84ad3f390

@ -1,5 +1,5 @@
var width = 960, var width = 960;
height = 490; var height = 490;
d3.select('svg') d3.select('svg')
.attr('width', width) .attr('width', width)
@ -7,12 +7,13 @@ d3.select('svg')
var worldProjection = d3.geoEquirectangular(); var worldProjection = d3.geoEquirectangular();
var geoPath = d3.geoPath()
.projection(worldProjection);
d3.select('svg').selectAll('path') d3.select('svg').selectAll('path')
.data(map_json.features) .data(map_json.features)
.enter() .enter()
.append('path') .append('path')
.attr('fill', '#099') .attr('fill', '#099');
.attr('d', geoPath)
var dAttributeFunction = d3.geoPath()
.projection(worldProjection);
d3.selectAll('path').attr('d', dAttributeFunction);

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title></title> <title></title>
<script src="https://d3js.org/d3.v5.min.js" charset="utf-8"></script> <script src="https://d3js.org/d3.v5.min.js" charset="utf-8"></script>
<script src="map_data3.js" charset="utf-8"></script> <script src="https://cdn.rawgit.com/mahuntington/mapping-demo/master/map_data3.js" charset="utf-8"></script>
</head> </head>
<body> <body>
<svg></svg> <svg></svg>

Loading…
Cancel
Save