censusTractsSvg = function(geoJsonFeaturesCollection) {
const height = 1.4 * 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 => questionableTracts.has(d.properties.tractce10) ? 'red' : 'lightSkyBlue')
.append('title')
.text(d => {
const properties = d.properties;
const state = d3.format("02d")(properties.statefp10);
const county = d3.format("03d")(properties.countyfp10);
const tract = d3.format("04d")(properties.name10);
const suffix = d3.format("02d")(properties.tractce10.slice(-2));
return state + '-' + county + '-' + tract + '.' + suffix;
})
return svg.node();
}