canvas = {
const context = DOM.context2d(1 << n, height * m);
const link = d3.linkVertical().context(context);
context.lineCap = "round";
context.lineJoin = "round";
context.lineWidth = 0.5;
context.globalCompositeOperation = "multiply";
for (let i = 0; i < 1 << n; ++i) {
context.beginPath();
context.strokeStyle = d3.interpolateSpectral(gray2binary(i) / (1 << n));
for (let j = 0, x = reverse(i, n); j < m; ++j) {
link({
source: [gray2binary(reverse(x, n)), height * j],
target: [gray2binary(reverse(x = applyRule(x, n), n)), height * (j + 1)]
});
}
context.stroke();
if (i & 1) yield context.canvas;
}
}