script type text javascript src https d3js org d3 v7 min js script svg width 620px height 600px g class map g svg script let projection d3 geoMercator scale 400 translate 200 280 center 0 5 let geoGenerator d3 geoPath projection projection function update geojson let u d3 select svg g map selectAll path data geojson features u enter append path attr d geoGenerator DRAW SOME DATA let json draw something and take the data from https geojson io type FeatureCollection features type Feature properties geometry type Polygon coordinates 4 921875 28 304380682962783 11 25 9 44906182688142 5 2734375 12 211180191503997 16 5234375 31 653381399663985 31 9921875 13 581920900545844 44 6484375 16 29905101458183 4 921875 28 304380682962783 update json console log ready script