-initialTransform = d3.zoomIdentity+mutable transform = d3.zoomIdentity.translate(projection([0, 0])[0], projection([0, 0])[1]) .scale(projection.scale() * 2 * Math.PI)
-mutable globalTileSet = tile(initialTransform)+globalTileSet = tile(transform)
-map = {+viewof context = {const context = DOM.context2d(width, height);-var localTileSet;// Set up zooming, and attach it to the canvas const zoom = d3 .zoom() .scaleExtent([1 << 8, 1 << 26]) .extent([[0, 0], [width, height]]) .on("zoom", () => zoomed(d3.event.transform));+d3.select(context.canvas) .call(zoom)-.call(zoom.transform, initialTransform); // Sets initial zoom transform+.call(zoom.transform, mutable transform); // Sets initial zoom transform+// Update the set of tiles when the transform changesfunction zoomed(transform) {-// Update the set of tiles when the transform changes mutable globalTileSet = tile(transform); localTileSet = tile(transform);+mutable transform = transform;}-// Redraw the canvas on each animation frame, in case the tiles have updated while (true) { context.clearRect(0, 0, width, height); drawTiles(context, globalTileSet); // DOES NOT WORK!! //drawTiles(context, localTileSet); // WORKS yield context.canvas; }+context.canvas.value = context; return context.canvas;}