chart = {
const svg = d3.create("svg")
.attr("width",width)
.attr("height",height);
const g = svg.append("g");
const circle = g.selectAll("circle")
.data(data)
.enter().append("circle")
.attr("cx", ([x]) => x)
.attr("cy", ([, y]) => y)
.attr("r", radius)
.attr("fill", (d, i) => d3.interpolateRainbow(i / 360));
svg.call(d3.zoom()
.scaleExtent([1, 10])
.on("zoom", zoom));
function zoom() {
g.attr("transform", d3.event.transform);
}
return svg.node();
}