chart = {
const svg = d3.select(DOM.svg(width, height));
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.selectAll("circle")
.data(gap1960)
.join("circle")
.attr("cx", d => xScale(d.life_expect))
.attr("cy", d => yScale(d.fertility))
.attr("r", d => rScale(d.pop))
.attr("fill", "purple")
.attr("opacity", 0.6);
svg.append("text")
.text("Life expectancy →")
.attr("dx", width / 1.4)
.attr("dy", height - margin.top + margin.bottom - 14)
.attr("font-family", "sans-serif")
.attr("font-size", 10)
svg.append("text")
.text("Fertility ↑")
.attr("x", -margin.top + 40)
.style("text-anchor", "start")
.attr("y", 10)
.attr("font-family", "sans-serif")
.attr("font-size", 10)
return svg.node();
}