Published
Edited
Dec 30, 2019
1 fork
5 stars
Insert cell
Insert cell
Insert cell
Insert cell
async function* draw(c, transform) {
c.save();
c.clearRect(0, 0, width, height);
for (const [i, d] of Object.entries(data)) {
const [x, y] = transform.apply(d);
c.beginPath();
c.moveTo(x + 1.5, y);
c.arc(x, y, 1.5, 0, 2 * Math.PI);
c.fill();
if (i % 10 === 0) {
const h = yield timeout();
console.log("h", h);
}
}
c.restore();
}
Insert cell
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