Commit f430c20f authored by Mike Bostock's avatar Mike Bostock
Browse files

Remove symbol-map example.

Replaced by <http://bl.ocks.org/4342045>.
parent 8fb69fa2
<!DOCTYPE html>
<meta charset="utf-8">
<title>U.S. States</title>
<style>
svg {
width: 960px;
height: 500px;
}
#states path,
#state-centroids circle {
fill: #ccc;
stroke: #fff;
stroke-width: 1.5px;
}
#state-centroids circle {
fill: steelblue;
fill-opacity: .8;
}
</style>
<body>
<script src="../../d3.js"></script>
<script>
var r = d3.scale.sqrt()
.domain([0, 1e6])
.range([0, 10]);
var projection = d3.geo.albersUsa();
var svg = d3.select("body").append("svg");
var states = svg.append("g").attr("id", "states");
var centroids = svg.append("g").attr("id", "state-centroids");
d3.json("../data/us-states.json", function(error, collection) {
states.append("path")
.datum(collection)
.attr("d", d3.geo.path().projection(projection));
});
d3.json("../data/us-state-centroids.json", function(error, collection) {
centroids.selectAll("circle")
.data(collection.features.sort(function(a, b) { return b.properties.population - a.properties.population; }))
.enter().append("circle")
.attr("transform", function(d) { return "translate(" + projection(d.geometry.coordinates) + ")"; })
.attr("r", 0)
.transition()
.duration(1000)
.delay(function(d, i) { return i * 50; })
.attr("r", function(d) { return r(d.properties.population); });
});
</script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment