Published
Edited
Dec 20, 2018
Also listed in…
Examples & Tutorials
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof value = select({
title: "President",
description: "Please pick your favorite president.",
options: [
{ value: '0', label: 'Donald Trump' },
{ value: '1', label: 'Barack Obama' }
],
})
Insert cell
presidentText(value)
Insert cell
function presidentText(value) {
const pres = president[value];
return md` ${pres['first-name']} ${pres['last-name']} is United States president ${pres.number}.`;
}
Insert cell
president = d3.csvParse(`number,first-name,last-name
45,Donald,Trump
44,Barack,Obama
`)
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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