Public
Edited
Mar 29, 2023
1 star
Insert cell
Insert cell
gi = import("https://cdn.skypack.dev/@thi.ng/grid-iterators?min")
Insert cell
Insert cell
Insert cell
iterator = gi[method]
Insert cell
curve = {
const pts = [];
for (const p of iterator({
cols: 32,
rows: 32,
tx: () => (x, y) => ({ x, y }) // optional, this transform changes [0,1] into {x: 0, y: 1}
})) {
pts.push(p);
yield pts;
}
}
Insert cell
Insert cell
Plot.rect(iterator({ slope: 4, cols: 80, rows: 25 }), {
x: "0",
y: "1",
interval: 1,
fill: (d, i) => i
}).plot({ aspectRatio: 1 })
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