{
const n = width / radius;
const m = height / radius;
const context = DOM.context2d(width, height);
const tiles = [hexagons, squares, triangles]
.map(tile => tile(n, m)
.map(translate(width / 2, height / 2))
.map(jitter(1e-2)));
context.lineWidth = 1.5;
for (let i = 0; true; ++i) {
const ti = d3.interpolate(tiles[i % 3], tiles[(i + 1) % 3]);
for (let f = 0, F = 120; f < F; ++f) {
const delaunay = d3.Delaunay.from(ti(d3.easeCubic(f / F)));
const voronoi = delaunay.voronoi([0, 0, width, height]);
context.clearRect(0, 0, width, height);
context.beginPath();
voronoi.render(context);
context.stroke();
if (viewof centroids.value) {
context.beginPath();
delaunay.renderPoints(context, 1.5);
context.fill();
}
yield context.canvas;
}
}
}