score:2

Accepted answer

Why not

d3.select("svg")
  .selectAll("path")
  .data(json.features)
.enter()
  .append("path")
  .attr("d",d3.geo.path().projection(d3.geo.equirectangular().scale(1500)))
  .attr("fill", "#c00")// <- Set color like this, or pass a function
// Or
  .attr("id", function(feature) {
    /* something like: return feature.properties.id; */
  })
// Or
  .attr("class", function(feature) {
    return feature.population > 1e6 ? 'populous' : 'rural';
  });

Related Query

More Query from same tag