Published
Edited
Jun 20, 2022
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function forceRadius(nodes, R = 1) {
return () => {
for (const n of nodes) {
const r = Math.hypot(n.x, n.y, n.z);
const u = Math.pow(r ? Math.sqrt(R / r) : 1, 0.5);
n.x *= u;
n.y *= u;
n.z *= u;
}
};
}
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