Published
Edited
Dec 15, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
eachDay(["W", "F"], [new Date("2020-04-04"), new Date("2020-05-05")])
Insert cell
Insert cell
function eachDay(days, interval) {
days = days.map(d => dayIndices.get(d));
return d3.timeDay.range(...interval).filter(d => days.includes(d.getDay()));
}
Insert cell
dayIndices = new Map([
["Su", 0],
["M", 1],
["Tu", 2],
["W", 3],
["Th", 4],
["F", 5],
["Sa", 6]
])
Insert cell
f = d3.timeFormat("%Y-%m-%d")
Insert cell
d3 = require("d3@6")
Insert cell
import { checkbox, date } from "@jashkenas/inputs"
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