Published
Edited
Apr 12, 2020
2 stars
Insert cell
Insert cell
{
const height = 600;
var context = (this && this.getContext("2d")) || DOM.context2d(width, height);

for (var x = 0; x < 300; x++) {
context.setTransform(1, 0, 0, 1, 0, 0);
context.translate(10 * x, 1);
for (var y = 0; y < 300; y++) {
if (Math.random() > .5) continue;
context.translate(0, y);
context.fillRect(0, 0, 1, 4);
context.translate(0, .5);
}
}

yield context.canvas;
}
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