Unlisted
Edited
Feb 8, 2024
Insert cell
Insert cell
a = d3.range(0, 100)
Insert cell
b = d3.range(0, 100).map((d) => (d > 50 ? -2 * d : d))
Insert cell
Insert cell
Plot.plot({
title: "B",
marks: [
Plot.frame({ stroke: "#ccc" }),
Plot.lineY(b, { x: (d, i) => i }),
Plot.dotY(b, {
x: (d, i) => i,
fill: "#000"
}),
Plot.ruleX(
b,
Plot.pointerX({
x: (d, i) => i,
stroke: "#f00"
})
),
Plot.tip(
b,
Plot.pointerX({
y: (d) => d,
x: (d, i) => i
})
)
],
height: 200
})
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