USA Urban population. Data from census.gov.
forked from bricedev's block: Urban Population
xxxxxxxxxx
<meta charset="utf-8">
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
<script>
var width = 960,
height = 600;
var projection = d3.geo.albersUsa()
.scale(1100)
.translate([width / 2, height / 2]);
var path = d3.geo.path()
.projection(projection);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("us.json", function(error, us) {
if (error) throw error;
svg.append("g")
.selectAll("path")
.data(topojson.feature(us, us.objects.usa).features)
.enter().append("path")
.attr("d", path)
.style("stroke","#ee9fc9");
svg.append("g")
.selectAll("path")
.data(topojson.feature(us, us.objects.urban).features)
.enter().append("path")
.attr("d", path)
.style("fill","#ff3d81");
});
d3.select(self.frameElement).style("height", height + "px");
</script>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js
https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js