Published
Edited
Apr 21, 2022
Insert cell
Insert cell
Insert cell
viewof xSpacing = Inputs.range([2, 200], {
label: "x Spacing",
step: 1,
value: 50
})
Insert cell
viewof ySpacing = Inputs.range([2, 200], {
label: "y Spacing",
step: 1,
value: 50
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function cactus(x, y, r, i) {
if (r > minR) {
let list = [];
list.push(circle(x, y, r, scheme[i]));
for (let theta = 0; theta < 2 * pi; theta += pi / 2) {
list.push(
cactus(
x - xSpacing * sin(theta),
y - ySpacing * cos(theta),
rScaling * r,
i + 1
)
);
}
return list.flat();
}
}
Insert cell
Insert cell
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