Public
Edited
May 6, 2023
Insert cell
Insert cell
Insert cell
Insert cell
canvas = {
const context = DOM.context2d(width, height);
context.fillStyle = "hsl(216deg 20% 90%)";
context.fillRect(0, 0, width, height * (1 - t));
context.canvas.style.background = "hsl(216deg 100% 13%)";
return context.canvas;
}
Insert cell
t = Math.abs(Math.sin(theta)) * bounceHeight
Insert cell
theta = {
let theta = 0;
while (true) {
theta = theta > Math.PI * 2 ? 0 : theta + speed;
yield theta;
}
}
Insert cell
width = 100
Insert cell
height = 500
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