Published
Edited
Feb 13, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cells = {
const data = new Uint8ClampedArray(width * height).fill(0);
data[Math.floor(width / 2)] = 1;
let i = 0, j = width;
for (let y = 1; y < height; y++) {
for (let x = 0; x < width; x++) {
const n = (x == 0 ? 0 : data[i-1] << 2) | (data[i] << 1) | (x == width - 1 ? 0 : data[i+1]);
i++;
data[j++] = bits[n];
}
}
return data;
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more