Public
Edited
Jun 20, 2023
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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more