I'm plotting points on a US Map with TopoJSON. I think my data is formatted correctly, everything is loading, the states are showing... but I have no points. The console has no errors. Here is my script:
var width = 800,
height = 500;
var projection = d3.geo.albersUsa()
.scale(1070)
.translate([420, height / 2]);
var path = d3.geo.path()
.projection(projection)
.pointRadius(1.5);
var svg = d3.select("#map").append("svg")
.attr("width", width)
.attr("height", height);
queue()
.defer(d3.json, "../us.json")
.defer(d3.json, "../users.json")
.await(ready);
function ready(error, us, users) {
svg.append("path")
.datum(topojson.feature(us, us.objects.land))
.attr("class", "land")
.attr("d", path);
svg.append("path")
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "states")
.attr("d", path);
svg.append("path")
.datum(topojson.feature(users, users.objects.users))
.attr("class", "points")
.attr("d", path);
};
And my data looks like:
{
"type": "Topology",
"transform": {
"scale": [
0.032229964456445645,
0.006392461796179619
],
"translate": [
-176.6460306,
7.367222
]
},
"objects": {
"users": {
"type": "MultiPoint",
"coordinates": [[-121.3806, 38.0213],
[-69.726226, 44.275051],
...long JSON file...
]
}
},
"arcs" : []
}
Again, I get no errors.. it just doesn't work.