Public
Edited
May 15, 2023
Insert cell
Insert cell
timedata = [
{ date: new Date("2023/10/05 13:00") },
{ date: new Date("2023/10/05 14:00") },
{ date: new Date("2023/10/05 15:00") },
{ date: new Date("2023/10/05 16:00") },
{ date: new Date("2023/10/05 17:00") },
{ date: new Date("2023/10/05 18:00") }
]
Insert cell
d3.timeDay.every(1).range(new Date(2015, 0, 2), new Date(2015, 0, 5))
Insert cell
diff = {
const diff = [];
for (var i = 0; i < timedata.length - 1; i++) {
diff.push({
difference: Math.floor(
(timedata[i + 1].date - timedata[i].date) / 1000 / 60
),
time: timedata[i + 1].date
});
}
return diff;
}
Insert cell
[...new Set(diff.map((d) => d.difference))].length
Insert cell
d3.utcMinute.every(60).range(new Date(2023, 0, 1), new Date(2023, 0, 7))
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