Public
Edited
Jun 29, 2023
7 forks
5 stars
Insert cell
Insert cell
Insert cell
data = penguins
Insert cell
Insert cell
data
X
culmen_length_mm
Y
culmen_depth_mm
Color
island
Size
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
data
X
culmen_length_mm
Y
culmen_depth_mm
Color
island
Size
Facet X
species
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
data
X
culmen_length_mm
Y
culmen_depth_mm
Color
island
Size
Facet X
species
Facet Y
island
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
data
X
body_mass_g
Y
Color
#4775de
Size
Facet X
Facet Y
species
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(cars, {x: "power (hp)", y: "economy (mpg)", tip: true,
title: d => `${d.name} (19${d.year}): ${d["power (hp)"]} HP, ${d["economy (mpg)"]} MPG`})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot((mode === "Filter" ? carsFiltered : cars), {x: "power (hp)", y: "economy (mpg)", title: "name",
fill: d => (mode === "Filter" ? "black" :
(d["weight (lb)"] >= minWeight && d["weight (lb)"] <= maxWeight ?
"steelblue" : "lightgray"))})
],
x: {
domain: (pinCarAxes || mode === "Highlight") ? [40, 240] : undefined
},
y: {
domain: (pinCarAxes || mode === "Highlight") ? [8, 48] : undefined
}
})
Insert cell
carsFiltered = cars.filter(d => d["weight (lb)"] >= minWeight && d["weight (lb)"] <= maxWeight)
Insert cell
Insert cell
Insert cell
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