Published unlisted
Edited
Mar 18, 2022
Insert cell
Insert cell
start = d3.utcDay.offset(new Date(), -30)
Insert cell
end = new Date()
Insert cell
days = d3.utcDay.range(start, end)
Insert cell
Plot.plot({
x: { axis: "top" },
marks: [
Plot.rectX(days, {
x1: (d) => d,
x2: (d) => d3.utcDay.offset(d, 1),
fill: "#ccc",
inset: 1
}),
Plot.dot(days, { x: (d) => d, y: () => (Math.random() > 0.5 ? "a" : "b") })
]
})
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