{
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const g0 = svg.append("g").attr("id", "all");
const g1 = svg.append("g").attr("id", "africa");
g0.append("path")
.attr("id", "land")
.attr("fill", "#fcfcfc")
.attr("stroke", "none")
.datum(topojson.feature(world, world.objects.land));
g0.append("path")
.attr("id", "borders-all")
.attr("fill", "none")
.attr("stroke", "#eee")
.datum(topojson.mesh(world, world.objects.countries, (a, b) => a !== b));
g0.append("path")
.attr("id", "shore-all")
.attr("fill", "none")
.attr("stroke", "lightblue")
.datum(topojson.feature(world, world.objects.land));
g1.append("g")
.attr("id", "countries-africa")
.selectAll()
.data(AfricanCountries)
.join("path")
.attr("fill", "#fefefe")
.attr("stroke", "none");
g1.append("path")
.attr("id", "borders-africa")
.attr("fill", "none")
.attr("stroke", "#ddd")
.datum(
topojson.mesh(Africa0, Africa0.objects.countries, (a, b) => a !== b)
);
g1.append("path")
.attr("id", "shore-africa")
.attr("fill", "none")
.attr("stroke", "orange")
.datum(Africa);
const path = d3.geoPath(projection);
svg.selectAll("path").attr("d", path);
return svg.node();
}