main
Matt Huntington 3 years ago
parent 4f98164013
commit 7d671f2934

@ -10,14 +10,13 @@ path {
<body>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="https://unpkg.com/topojson@3"></script>
<script src="https://cdn.rawgit.com/mahuntington/mapping-demo/master/map_data3.js" charset="utf-8"></script>
<script>
var width = 960,
height = 500;
var projection = d3.geoMercator()
.center([0, 5 ])
.scale(150)
.rotate([-180,0]);
var projection = d3.geoEquirectangular()
var svg = d3.select("body").append("svg")
.attr("width", width)
@ -31,8 +30,19 @@ var g = svg.append("g");
// load and display the World
d3.json("world-110m2.json").then(function(topology) {
const new_map = map_json.features.filter((feature, index)=>{
//return feature.properties.name != 'Argentina' && feature.properties.name != 'Angola'
//return feature.properties.name == 'Angola'
//return true
return index != 21
})
for(feature of new_map){
console.log(feature.properties.name);
}
g.selectAll("path")
.data(topojson.feature(topology, topology.objects.countries).features)
//.data(topojson.feature(topology, topology.objects.countries).features)
.data(new_map)
.enter().append("path")
.attr("d", path);

Loading…
Cancel
Save