chart = {
const r = width / height;
const context = DOM.context2d(width, wide ? height : width * r);
if (!wide) {
context.translate(width / 2, height / 2);
context.rotate(Math.PI / 2);
context.translate(-height / 2, -width / 2);
context.scale(r, r);
}
const path = d3.geoPath(null, context);
context.scale(scale, scale);
context.lineWidth = 0.5 / scale;
context.strokeStyle = "#fff";
while (true) {
const t = (performance.now() / duration) % 1;
for (const [a, b] of d3.pairs(thresholds)) {
const d = a * (1 - t) + b * t;
context.beginPath();
path(contours.contour(data.values, d));
context.fillStyle = color(d);
context.fill();
context.stroke();
}
yield context.canvas;
}
}