function zoom(sel) {
const context = sel.node().getContext('2d');
const zoomBehaviour = d3.zoom().on('zoom', zoomed);
sel.call(zoomBehaviour);
function zoomed() {
const t = d3.event.transform;
context.save();
context.clearRect(0, 0, w, h);
context.translate(t.x, t.y);
context.scale(t.k, t.k);
context.beginPath();
context.arc(w / 2, h / 2, h / 4, 0, 2 * Math.PI);
context.stroke();
context.restore();
}
}