Skip to Content
DocsInternalsForce Simulation

Force Simulation

lib/forceSimulation.ts builds a 3D layout from GraphData using d3-force-3d with several customizations.

Highlights

  • Community clustering force with cached centers on spherical shells
  • Spherical constraint to maintain a coherent knowledge “universe”
  • Node charge scaled by degree; link distance and strength from weight
  • Precomputed node size/color and community bounds/hierarchy for render speed

Configuration (defaults)

  • chargeStrength: -100
  • linkDistance: 30
  • linkStrength: 0.2
  • collisionRadius: 6
  • communityStrength: 0.2
  • centerStrength: 0.02
Last updated on