Public
Edited
May 18, 2023
Insert cell
Insert cell
import { pizzariaDB } from "@observablehq/pizza-paradise-data"
Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
marks: [
Plot.density(cars, { x: "power (hp)", y: "economy (mpg)" })
]
})
Insert cell
Insert cell
Insert cell
Insert cell
b = a * 10
Insert cell
Insert cell
test_iris = FileAttachment("test_iris.csv").csv()
Insert cell
test_iris
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
viewof file = Inputs.file({label: "Data"})
Insert cell
mta = d3.json("https://data.ny.gov/resource/vxuj-8kew.json")
Insert cell
mta
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
subways
X
Date
Y
Subways
Color
Buses
Size
Facet X
Facet Y
Mark
line
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.auto(subways, {
x: "Buses",
y: "Subways",
color: "Buses",
size: "Subways"
}).plot({ marginLeft: 100, color: { legend: true } })
Insert cell
Insert cell
viewof color = Inputs.color({ label: "Viz Color", value: "#4682b4" })
Insert cell
Plot.plot({
grid: true,
marks: [
Plot.ruleY([0]),
Plot.lineY(
subways,
Plot.windowY({ x: "Date", y: "Subways", k: range, reduce: "mean" })
),
Plot.lineY(subways, { x: "Date", y: "Subways", stroke: color })
],
marginLeft: 100,
marginRight: 50
})
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