chart = {
const svg = d3.select(
html`<svg width="100%" height="100%" viewBox="0, 0, ${width}, ${height}"></svg>`
);
const g = svg.append("g");
const circle = g
.selectAll("circle")
.data(data)
.join("circle")
.attr("r", 2.5)
.style("fill", "steelblue")
.attr("transform", d => `translate(${d})`);
svg
.append("rect")
.attr("fill", "none")
.attr("pointer-events", "all")
.attr("width", width)
.attr("height", height)
.call(
d3
.zoom()
.scaleExtent([1, 8])
.on("zoom", zoom)
);
function zoom(event) {
g.attr("transform", event.transform);
}
return svg.node();
}