Published
Edited
Jun 25, 2019
Fork of Demo
Insert cell
Insert cell
Insert cell
1 + 1 // Edit me!
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
c = {
for (let i = 0; true; ++i) {
yield i;
}
}
Insert cell
Insert cell
Insert cell
{
const height = 33;
const context = DOM.context2d(width, height);
for (let i = 0; i < width; ++i) {
const t = i / width;
const r = Math.floor(255 * Math.sin(Math.PI * (t + 0 / 3)) ** 2);
const g = Math.floor(255 * Math.sin(Math.PI * (t + 1 / 3)) ** 2);
const b = Math.floor(255 * Math.sin(Math.PI * (t + 2 / 3)) ** 2);
context.fillStyle = `rgb(${r},${g},${b})`;
context.fillRect(i, 0, 1, height);
yield context.canvas;
}
}
Insert cell
Insert cell
tick = {
while (true) {
const date = new Date(Math.ceil(Date.now() / 1000) * 1000);
await Promises.when(date);
yield date;
}
}
Insert cell
Insert cell
slider = html`<input type=range>`
Insert cell
sliderValue = Generators.input(slider)
Insert cell
Insert cell
viewof d = html`<input type=range>` // Edit me! Try type=text.
Insert cell
Insert cell
Insert cell
import {tweet} from "@mbostock/tweet"
Insert cell
tweet("958726175123128321")
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