chart = {
const context = DOM.context2d(width, height, 1);
context.canvas.style.position = "absolute";
context.canvas.style.imageRendering = "pixelated";
context.canvas.style.maxWidth = "100%";
context.globalCompositeOperation = "multiply";
const div = html`
${context.canvas}
<svg viewBox="0 0 ${width} ${height}">
${d3.select(svg`<g>`).call(grid).node()}
${d3.select(svg`<g>`).call(xAxis).node()}
${d3.select(svg`<g>`).call(yAxis).node()}
</svg>
`;
let l = data.length;
for (const d of d3.shuffle(data.slice())) {
context.fillStyle = color(d);
context.fillRect(x(d.carat), y(d.price), Math.max(2, x(d.carat + 0.01) - x(d.carat)), 2);
if (--l % 100 === 0) yield div;
}
}