Skip to content

Instantly share code, notes, and snippets.

@milafrerichs
Last active January 5, 2020 08:39
Show Gist options
  • Save milafrerichs/9eb795809d0f420c7d86bf34450fdb17 to your computer and use it in GitHub Desktop.
Save milafrerichs/9eb795809d0f420c7d86bf34450fdb17 to your computer and use it in GitHub Desktop.
d3.json('data.geojson').then(function(bb) {
let width = 200, height = 200;
let projection = d3.geoEqualEarth();
projection.fitSize([width, height], bb);
let geoGenerator = d3.geoPath()
.projection(projection);
let svg = d3.select("body").append('svg')
.style("width", width).style("height", height);
svg.append('g').selectAll('path')
.data(bb.features)
.join('path')
.attr('d', geoGenerator)
.attr('fill', '#088')
.attr('stroke', '#000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment