Published
Edited
Aug 26, 2022
Insert cell
# Stack and Facet
Insert cell
import {data} from "@observablehq/plot-cheatsheets-transforms"
Insert cell
Insert cell
Plot.plot({
facet: {
data: data.filter(d => d.country == 'US' || d.country == 'CA'),
y: 'country'
},
marks: [
Plot.rectY(
data.filter(d => d.country == 'US' || d.country == 'CA'),
Plot.binX(
{ y: "count" },
{
x: "date",
y: "price_in_usd",
fill: "brand",
thresholds: d3.utcDay
}
)
)
],
marginLeft: 100,
width: 666,
height: 300
})
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