Public
Edited
Aug 28, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vQ1P4KYi2C8qd7bpmSxXYhz54IZbfm5mhPvQQmpGork88QzHgduM1xSouAmPTbYr0hZJiP1Jyi1081b/pub?gid=0&single=true&output=csv"
Insert cell
Insert cell
color = d3.scaleOrdinal(
d3.groups(parsed_data, (o) => o[color_by]).map((o) => o[0]),
d3.schemeCategory10
)
Insert cell
color_by = "type"
Insert cell
parsed_data = raw_data.map(function (o) {
let oo = Object.assign({}, o);
oo.start = d3.utcParse("%I:%M %p")(o.start);
oo.fin = d3.utcParse("%I:%M %p")(o.fin);
oo.comment = o.comment == "" ? null : o.comment;
return oo;
})
Insert cell
raw_data = fetch(url)
.then((response) => response.text())
.then(function (text) {
let parsed = d3.csvParse(text);
return parsed;
})
Insert cell
color_scheme = d3.schemeCategory10
Insert cell
import { Swatches } from "@d3/color-legend"
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