Public
Edited
Feb 10, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pod = {
const pod = d3ForcePod()(domEl)
.nodeColor(({ pole }) => COLORS[pole > 0 ? 'attractive' : 'repellent']);

// Add collision force
pod.addForce(d3.forceBounce()
.radius(d => d.r)
.elasticity(0)
);

// Add attraction force
pod.addForce(d3.forceMagnetic()
.charge(node => node.pole * node.r * node.r)
.strength(ACCELERATION_K)
);
return pod;
}
Insert cell
Insert cell
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