Public
Edited
Jul 12, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plot = Plot.plot({
margin,
marks: [
Plot.line(data, { x: "date", y: "value" }),
Plot.ruleY([0]),
Plot.ruleX([data[0].date])
]
})
Insert cell
data = {
let date_strings = d3
.range(1, 32, 1)
.map((d) => `1/${d < 10 ? `0${d}` : d}/2024`);
let dates = parse ? date_strings.map((d) => new Date(d)) : date_strings;
let data = dates.map((d, i) => ({ date: d, value: 1.5 ** i }));

return data;
}
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