{
let svg = d3.select(DOM.svg(width, height));
let value = null;
let g = svg.append("g");
var countries = topojson.feature(world_topo, world_topo.objects.world_map_geojson).features
const outline = svg.append("path")
.attr("fill", "green")
.attr("stroke", "green")
.attr("stroke-width", "3px")
.attr("stroke-linejoin", "round")
.attr("pointer-events", "none");
svg.selectAll(".country")
.data(countries)
.enter().insert("path", ".graticule")
.attr("class", function(d) { return "country " + "code" + d.id; })
.attr("d", geoPath)
.style("fill", "lightgrey")
.on("mouseover", d => {
const node = svg.node();
node.value = value = value === d.properties.ADMIN ? null : d.properties.ADMIN;
node.dispatchEvent(new CustomEvent("input"));
outline.attr("d", value ? geoPath(d) : null);
})
.on("click", d => {
const node = svg.node();
node.value = value = value === d.properties.OBJECTID ? null : d.properties.OBJECTID;
node.dispatchEvent(new CustomEvent("input"));
outline.attr("d", value ? path(d) : null);
});
svg.append("g");
return Object.assign(svg.node(), {value: null});
}