chart = {
const svg = d3.select(DOM.svg(width, height));
const g = svg.append("g")
.selectAll("g")
.data(bins)
.join("g");
g.append("path")
.attr("stroke", "currentColor")
.attr("d", d => `
M${x(d.range[0])},${y((d.x0 + d.x1) / 2)}
H${x(d.range[1])}
`);
g.append("path")
.attr("fill", "#ddd")
.attr("d", d => `
M${x(d.quartiles[2])},${y(d.x0) - 1}
V${y(d.x1)}
H${x(d.quartiles[0])}
V${y(d.x0) - 1}
Z
`);
g.append("path")
.attr("stroke", "currentColor")
.attr("stroke-width", 2)
.attr("d", d => `
M${x(d.quartiles[1])},${y(d.x0) - 1}
V${y(d.x1)}
`);
g.append("g")
.attr("fill", "currentColor")
.attr("fill-opacity", 0.2)
.attr("stroke", "none")
.attr("transform", d => `translate(0,${y((d.x0 + d.x1) / 2)})`)
.selectAll("circle")
.data(d => d.outliers)
.join("circle")
.attr("r", 2)
.attr("cy", () => (Math.random() - 0.5) * 4)
.attr("cx", d => x(d.x));
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
return svg.node();
}