Published
Edited
Mar 22, 2019
8 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plastic = {
const p1 = 0.7548776662466927; // inverse of plastic number
const p2 = 0.5698402909980532;
return function plastic (index) {
return [(p1 * index) % 1, (p2 * index) % 1];
}
}
Insert cell
golden = {
const p = 0.618033988749894848; // inverse of golden ratio
return function golden (index) {
return p * index % 1;
}
}
Insert cell
halton23 = function halton23 (index) {
return [halton(index, 2), halton(index, 3)]
}
Insert cell
halton = function halton (index, base) {
let fraction = 1;
let result = 0;
while (index > 0) {
fraction /= base;
result += fraction * (index % base);
index = ~~(index / base); // floor division
}
return result;
}
Insert cell
Insert cell
npts = 4000
Insert cell
data = [...Array(npts).keys()].map(halton23)
Insert cell
plastic_data = [...Array(npts).keys()].map(plastic)
Insert cell
coloring = (d, i) => d3.interpolatePurples(Math.pow(i/npts, 5))
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