Published
Edited
Aug 13, 2019
Insert cell
Insert cell
Insert cell
Insert cell
function d3_time_format_multi(formatsArray) {
function multiFormat(date) {
let i = 0,
found = false,
fmt = "%c";
while (!found && i < formatsArray.length) {
found = formatsArray[i][1](date);
if (found) fmt = formatsArray[i][0];
i++;
}
return fmt;
}
return date => d3.timeFormat(multiFormat(date))(date);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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