Public
Edited
Apr 24, 2023
Importers
Insert cell
Insert cell
Insert cell
Insert cell
cars.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
cars
X
year
Y
power (hp)
Color
Size
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
cars
X
power (hp)
Y
economy (mpg)
Color
#cccccc
Size
Facet X
cylinders
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
cars
X
weight (lb)
Y
0-60 mph (s)
Color
#cccccc
Size
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
cars
X
power (hp)
Y
0-60 mph (s)
Color
#cccccc
Size
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
import { chart } from "@d3/bar-line-chart"
Insert cell
import { data } from "@d3/bar-line-chart"
Insert cell
import { Wrangler, op } from "@observablehq/data-wrangler"
Insert cell
// To use copied code replace "data" with your own variable
processed_data = aq
.from(cars)
.select("name", "power (hp)")
.filter((d) => op.startswith(d["name"], "Volvo"))
.rename({ "power (hp)": "frequency" })
.rename({ name: "letter" })
.objects() // Uncomment to return an array of objects
Insert cell
processed_data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
import { alphabet } from "@d3/bar-chart"
Insert cell
car_chart
Insert cell
import { chart as car_chart } with { processed_data as alphabet } from "78b3c96c93737459"
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