Published
Edited
Feb 10, 2021
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
filter
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
quadtree = d3.quadtree()
.extent([[-1, -1], [width + 1, height + 1]])
.addAll(data)
Insert cell
// Collapse the quadtree into an array of rectangles.
function nodes(quadtree) {
const nodes = [];
quadtree.visit((node, x0, y0, x1, y1) => void nodes.push({x0, y0, x1, y1}));
return nodes;
}
Insert cell
data = {
const randomX = d3.randomUniform(0, width);
const randomY = d3.randomUniform(0, height);
return Array.from({ length: size }, () => [randomX(), randomY()]);
}
Insert cell
height = 500
Insert cell
tau = 2 * Math.PI
Insert cell
Insert cell
d3 = require("d3@6")
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