I am trying to display a map of NYC using the following code:
var width = 960;
var height = 490;
d3.select('svg')
.attr('width', width)
.attr('height', height);
var CityProjection = d3.geoEquirectangular();
d3.json('data.json').then(function (data) {
var boroughs = data.features
d3.select('svg').selectAll('path')
.data(boroughs.map(x => x.geometry))
.enter()
.append('path')
.attr('fill', '#099')
var dAttributeFunction = d3.geoPath()
.projection(CityProjection);
d3.selectAll('path').attr('d', dAttributeFunction);
});
I am able to see the data in the html document, but on my browser the map is being displayed very tiny:
Any insight is highly appreciated. Thanks in advance!