function drawGraph(points, cellSize = 1) {
const xmin = _.min(points.map((p) => p[0]));
const xmax = _.max(points.map((p) => p[0]));
const ymin = _.min(points.map((p) => p[1]));
const ymax = _.max(points.map((p) => p[1]));
const width = xmax - xmin + 1;
const height = ymax - ymin + 1;
const canvas = html`<canvas width="${width * cellSize}" height="${
height * cellSize
}"/>`;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "black";
for (const cell of points) {
ctx.fillRect(
cellSize * (-xmin + cell[0]),
cellSize * (height - (-ymin + cell[1])),
cellSize,
cellSize
);
}
return canvas;
}