Published unlisted
Edited
Jul 25, 2021
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getDates(5, 'timeMonth', 25)
Insert cell
Insert cell
mutable interval = "timeMonth"
Insert cell
flattenRouteData = _data =>
d3.merge(
d3.merge(Object.values(_data)).map(x => {
return x.history.map(y => {
let it = { time: y, ...x };
delete it.history;
return it;
});
})
)
Insert cell
flattenRouteData([OralRouteInfo])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getRoutes = data => [...new Set(data.map(x => x.route))]
Insert cell
Insert cell
function getWidth(d, xScale) {
//duration === '-' when there is no length
let endTime = new Date(
+d.time + +(d.activeDuration === '-' ? 0 : d.activeDuration)
);
return xScale(endTime) - xScale(d.time);
}
Insert cell
Insert cell
Insert cell
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