Public
Edited
Jun 2, 2023
Insert cell
Insert cell
timeSeries.slice()
Insert cell
Plot.plot({
width,
marks: [
Plot.line(dailyMean, { width, x: "time", y: "value", curve: "monotone-x" })
]
})
Insert cell
Inputs.table(dailyMean)
Insert cell
dailyMean = {
const groups = d3.rollup(
timeSeries,
(v) => d3.mean(v, (d) => d.value),
(d) => d3.utcDay.floor(d.time)
);
return arrow.tableFromArrays({
time: Array.from(groups.keys()),
value: Array.from(groups.values())
});
}
Insert cell
timeSeries
Insert cell
Plot.plot({
width,
marks: [Plot.line(timeSeries, { width, x: "time", y: "value" })]
})
Insert cell
Inputs.table(timeSeries)
Insert cell
timeSeries = {
const timestamps = d3.timeHour.range(
d3.isoParse("2022-01-01T00:00Z"),
d3.isoParse("2022-01-31T23:00Z"),
1
);
const dist = d3.randomNormal(1, 5);
const values = timestamps.map(
(time) =>
d3.randomNormal(14, 5)() +
0.001 * d3.randomNormal(1 + Math.sin(time.getTime() / 1000), 2)()
);
return arrow.tableFromArrays({
time: timestamps,
value: values
});
}
Insert cell
arrow = require("apache-arrow@12.0.0")
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