chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const circleGroup = svg.append("g");
circleGroup
.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", ([x]) => x)
.attr("cy", ([, y]) => y)
.attr("r", 1.5);
const zoom = d3
.zoom()
.extent([
[0, 0],
[width, height]
])
.scaleExtent([1, 8])
.on("zoom", ({ transform }) => circleGroup.attr("transform", transform));
zoom(svg);
return svg.node();
}