Public
Edited
Aug 24, 2023
Fork of Rainbow Pack
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
color = d3.scaleSequential([0, 2 * Math.PI], d3.interpolateRainbow)
Insert cell
circles = {
if (sort) {
return d3
.packSiblings([
{
r: 150,
x: 0,
y: 0,
angle: 0
},
...d3
.range(2000)
.map(d3.randomUniform(8, 26))
.map((r) => ({ r }))
.sort((a, b) => b.r - a.r)
])
.filter((d) => -500 < d.x && d.x < 500 && -500 < d.y && d.y < 500);
}
return d3
.packSiblings([
{
r: 100,
x: 0,
y: 0,
angle: 0
},
...d3
.range(2000)
.map(d3.randomUniform(8, 26))
.map((r) => ({ r }))
])
.filter((d) => -500 < d.x && d.x < 500 && -500 < d.y && d.y < 500);
}
Insert cell
width = 954
Insert cell
height = width
Insert cell
size = Math.max(width, height)
Insert cell
d3 = require("d3@5")
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