Public
Edited
Nov 7, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataByTimeline = d3.nest().key(d=>d.timeline).entries(data);
Insert cell
dataByType = d3.nest().key(d=>d.region).entries(data);
Insert cell
axisBottom = d3.axisBottom(x)
.tickPadding(2)
.tickFormat(formatDate)
Insert cell
axisTop = d3.axisTop(x)
.tickPadding(2)
.tickFormat(formatDate)
Insert cell
Insert cell
d3 = require("d3@5")
Insert cell
csv =d3.csvParse(await FileAttachment("bldgdata@2.csv").text())
Insert cell
data = csv.map(d=>{
return {
...d,
start: +d.start,
end: +d.end
}
}).sort((a,b)=> a.start-b.start);
Insert cell
regions = d3.nest().key(d=>d.region).entries(data).map(d=>d.key)
Insert cell
timelines = dataByTimeline.map(d=>d.key)
Insert cell
color = d3.scaleOrdinal(d3.schemeSet2).domain(regions)
Insert cell
import {checkbox, select} from "@jashkenas/inputs"
Insert cell
html`CSS<style> svg{font: 10px sans-serif;}</style>`
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