Published
Edited
Aug 31, 2018
1 fork
11 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mutable mesh = {
do {
const voronoi = d3.geoVoronoi(points);
voronoi.polygons().features.forEach((poly, i) => {
const c = d3.geoCentroid(poly);
points[i][0] +=
alpha * degrees * Math.sin(radians * (c[0] - points[i][0]));
points[i][1] += alpha * (c[1] - points[i][1]);
});

yield voronoi.cellMesh();
} while (true);
}
Insert cell
clone = {
do {
const clone = (Math.random() * points.length) | 0,
to =
points.length >= N
? (Math.random() * points.length) | 0
: points.length;

if (points.length > N) points.pop();

if (points.length <= N && Math.random() < beta)
points[to] = fixed
? [360 * Math.random(), 89]
: [points[clone][0] + Math.random() - 0.5, points[clone][1]];

yield clone;
} while (true);
}
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