Last active
January 5, 2020 08:39
-
-
Save milafrerichs/9eb795809d0f420c7d86bf34450fdb17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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