Public
Edited
Nov 22, 2022
1 star
Insert cell
Insert cell
Insert cell
Plot.plot({
width: width,
y: {
domain: [420,540],
label: "↑ VAC"
},
marks: [
Plot.ruleY([0]),
Plot.dotY(data, { x: "date", y: "value", fill: "value" })
]
})
Insert cell
Insert cell
faithful_bars = Plot.plot({
y: {
grid: true
},
marks: [
Plot.barY(
data,
Plot.groupX({ y: "mean", filter: null }, { x: "hour", y: "value" })
),
Plot.ruleY([480], { stroke: "goldenrod", strokeWidth: 2 })
]
})
Insert cell
Insert cell
bars_with_y1_y2 = Plot.plot({
y: {
domain: [420, 540],
grid: true
},
marks: [Plot.barY(grouped_data, { x: "hour", y1: 420, y2: "value" })]
})
Insert cell
grouped_data = Array.from(d3.group(data, (o) => o.hour).values()).map((a) => ({
value: d3.mean(a.map((o) => o.value)),
hour: a[0].hour
}))
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