proportionalSymbols = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("transform", "translate(470,500)")
.append(() =>
legend({
color: m,
width: 260,
})
);
svg.append("g")
.selectAll("path")
.data(countries.features)
.join("path")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("stroke-width", 1.5)
.attr("fill", function(d) {
var val = data.get(d.properties.ADM0_A3);
console.log(val);
if(val)
return m(val[2]);
else
return NaN;
})
.attr("d", path_basemap)
.append("title")
.text(d => " Income category: " + d.properties.ADM0_A3 +' '+ (data.get(d.properties.ADM0_A3)));
return svg.node();
}