Published
Edited
Aug 13, 2020
2 forks
Importers
8 stars
Insert cell
Insert cell
LCG = function(seed) {
const a = 1664525,
c = 1013904223,
m = 4294967296; // 2^32
let s = Math.abs(a * +seed) || 1;
return () => (s = (a * s + c) % m) / m;
}
Insert cell
random = LCG()
Insert cell
Array.from({ length: 1000 }, random)
Insert cell
{
const height = 500,
context = DOM.context2d(width, height);

do {
context.fillStyle = "rgba(255,255,255,0.01)";
context.fillRect(0, 0, width, height);
context.fillStyle = "#000";
for (let i = 0; i < width; i++)
context.fillRect(width * random(), height * random(), 1, 1);
yield context.canvas;
} while (true);
}
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