chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", d => xScale(xAccessor(d)))
.attr("cy", d => yScale(yAccessor(d)))
.attr("r", radius)
.attr("fill", d => colorScale(colorAccessor(d)));
svg
.append("g")
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(xAxis);
svg
.append("g")
.call(yAxis)
.attr("transform", `translate(${margin.left},0)`);
const yLabel = svg.append("g").call(yTitle);
const xLabel = svg.append("g").call(xTitle);
return svg.node();
}