Published
Edited
Sep 16, 2020
Insert cell
Insert cell
d3 = require('d3@5')
Insert cell
af_quantile = [0, 10, 11, 12, 13, 14, 30]
Insert cell
d3.quantile(af_quantile, 0.5)
Insert cell
d3.quantile(af_quantile, 0.25)
Insert cell
af_extent = [1,2,3,4,5]
Insert cell
d3.extent(af_extent)
Insert cell
d3.extent(af_extent, (d) => d * 2)
Insert cell
af_deviate = [2,4,6,9,10]
Insert cell
d3.deviation(af_deviate)
Insert cell
af_scan = [1,3,5,7,10,56,12]
Insert cell
scan_index = d3.scan(af_scan, (a,b) => b - a)
Insert cell
af_scan[scan_index]
Insert cell
af_bisect = [1, 2, 7, 4, 5]
Insert cell
d3.bisect(af_bisect)
Insert cell
d3.bisectLeft(af_bisect)
Insert cell
af_bisector = [
{ date: new Date(2011, 1, 1), value: 0.5 },
{ date: new Date(2011, 2, 1), value: 0.6 },
{ date: new Date(2011, 3, 1), value: 0.7 },
{ date: new Date(2011, 4, 1), value: 0.8 }
]
Insert cell
bisectDate = d3.bisector(function(d) {
return d.date;
}).right
Insert cell
d3.merge([[1, 2], [3], [5]])
Insert cell
af_transpose = [[1,2], [3,4]]
Insert cell
d3.transpose(af_transpose)
Insert cell
af_zip = [[1, 2], [3, 4]]
Insert cell
d3.zip(af_zip)
Insert cell
histogram = d3.histogram()
Insert cell
af_histo = [1, 3, 5, 7]
Insert cell
histogram(af_histo)
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