chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
buildXAxis(svg);
buildYAxis(svg)
createChartGroup(svg)
plotBars(svg)
plotDotsImportant(svg)
plotDotsNotImportant(svg)
buildLegend(svg);
let updateYAxis = () => {
yScale.domain(sortedData.map(d => d.country)).transition().duration(100)
}
viewof sortSelection.addEventListener("input", updateYAxis)
return svg.node();
}