chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
svg
.append("path")
.attr("d", `M ${x(0)} ${y(0)} L ${x(1)} ${y(1)}`)
.attr("stroke", "#ccc")
.attr("stroke-dasharray", "3 4");
svg
.append("g")
.attr("fill", "none")
.selectAll("path")
.data(groups)
.join("path")
.attr("d", d => line(d[1].curve))
.attr("stroke", d => color(d[1].gini))
.call(halo);
return svg.node();
}