censusBlocksSvg = function(geoJsonFeaturesCollection) {
const height = 1.3 * width;
const projection = d3.geoMercator()
.fitSize([width, height], geoJsonFeaturesCollection);
const pathGenerator = d3.geoPath()
.projection(projection);
const svg = d3.create('svg')
.attr("viewBox", [0, 0, width, height]);
const g = svg.append('g')
.selectAll('path')
.data(geoJsonFeaturesCollection.features)
.enter()
.append('path')
.attr('d', pathGenerator)
.attr('fill', d => 'lightSkyBlue')
.append('title')
.text(d => {
const properties = d.properties;
const state = d3.format("02d")(properties.census_b_1.slice(0, 2));
const county = d3.format("03d")(properties.census_b_1.slice(2, 5));
const tract = d3.format("04d")(properties.census_tra.slice(0, 4));
const suffix = d3.format("02d")(properties.census_tra.slice(-2));
const block = d3.format("04d")(properties.census_blo);
return state + '-' + county + '-' + tract + '.' + suffix + '-' + block;
})
return svg.node();
}