pub struct SimulationConfig {
pub repulsion_strength: f32,
pub link_strength: f32,
pub link_distance: f32,
pub center_strength: f32,
pub velocity_decay: f32,
pub theta: f32,
pub seed: u64,
pub dimensions: u8,
}Expand description
Force simulation configuration. The defaults match d3-force’s defaults so graphs that used to render there look the same here.
Fields§
§repulsion_strength: f32Negative values repel, positive values attract. d3 default -30.
link_strength: f32Spring stiffness scaling on the link force (0..1 range is typical).
link_distance: f32Natural length of each link edge in world units.
center_strength: f32Center-of-mass gravity pulling nodes toward the origin.
velocity_decay: f32Per-tick velocity damping. 0.4 matches d3’s default velocity decay.
theta: f32Barnes-Hut approximation threshold. Larger = faster but less
accurate. d3 uses 0.9 under the name theta.
seed: u64RNG seed used to scatter initial positions deterministically.
dimensions: u8Dimensionality of the simulation: 2 (default, quadtree) or 3
(octree). Phase 224 Wave 2 toggle — anything else is clamped
to 2. Positions keep the 2D layout when dimensions == 2 and
switch to 3-vector positions (accessible via positions_3d())
when dimensions == 3.
Trait Implementations§
Source§impl Clone for SimulationConfig
impl Clone for SimulationConfig
Source§fn clone(&self) -> SimulationConfig
fn clone(&self) -> SimulationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more