pivotick / SimulationOptions / SimulationOptions
Interface: SimulationOptions
Defined in: interfaces/SimulationOptions.ts:16
Remarks
These may be scalled based on the amount of node and canvas size
Properties
callbacks?
optionalcallbacks:SimulationCallbacks
Defined in: interfaces/SimulationOptions.ts:121
cooldownTime
cooldownTime:
number
Defined in: interfaces/SimulationOptions.ts:72
How long a simulation run is given before it is stopped, in milliseconds. Spent as ticks so it holds below 60fps; the settleTime knob sets this and d3AlphaDecay together.
Default
2000d3Alpha
d3Alpha:
number
Defined in: interfaces/SimulationOptions.ts:18
Default
1.0d3AlphaDecay
d3AlphaDecay:
number
Defined in: interfaces/SimulationOptions.ts:22
Default
0.0228d3AlphaMin
d3AlphaMin:
number
Defined in: interfaces/SimulationOptions.ts:20
Default
0.001d3AlphaTarget
d3AlphaTarget:
number
Defined in: interfaces/SimulationOptions.ts:24
Default
0d3CollideIterations
d3CollideIterations:
number
Defined in: interfaces/SimulationOptions.ts:52
Default
1d3CollideRadius
d3CollideRadius:
number
Defined in: interfaces/SimulationOptions.ts:40
Fallback collision radius, in px, used only for nodes that report no circle radius. Nodes with a radius use d3CollideRadiusMultiplier × their radius.
Default
12d3CollideRadiusMultiplier
d3CollideRadiusMultiplier:
number
Defined in: interfaces/SimulationOptions.ts:48
Multiplier applied to each node's circle radius to derive its collision radius (the spacing the sim keeps between nodes). Higher spreads nodes further apart. This is what the "collision radius" physics knob scales via Simulation.setCollisionRadius.
Default
1.2d3CollideStrength
d3CollideStrength:
number
Defined in: interfaces/SimulationOptions.ts:50
Default
1d3GravityStrength
d3GravityStrength:
number
Defined in: interfaces/SimulationOptions.ts:58
Centring pull toward the canvas centre, applied only to isolated (degree-0) nodes so they don't fly off; connected nodes use d3GravityStrengthConnected.
Default
0.1d3GravityStrengthConnected
d3GravityStrengthConnected:
number
Defined in: interfaces/SimulationOptions.ts:65
Centring pull for connected nodes. Kept low by default so link + charge forces find their own equilibrium; raise it to stop a sparsely-linked graph from drifting apart.
Default
0.001d3LinkDistance
d3LinkDistance:
number
Defined in: interfaces/SimulationOptions.ts:28
Default
30d3LinkStrength
d3LinkStrength:
number|null
Defined in: interfaces/SimulationOptions.ts:30
Default
nulld3ManyBodyStrength
d3ManyBodyStrength:
number
Defined in: interfaces/SimulationOptions.ts:32
Default
-150d3ManyBodyTheta
d3ManyBodyTheta:
number
Defined in: interfaces/SimulationOptions.ts:34
Default
0.9d3VelocityDecay
d3VelocityDecay:
number
Defined in: interfaces/SimulationOptions.ts:26
Default
0.4enabled
enabled:
boolean
Defined in: interfaces/SimulationOptions.ts:116
Default
truefitViewOnExpandCollapse
fitViewOnExpandCollapse:
boolean
Defined in: interfaces/SimulationOptions.ts:90
Automatically fit the graph to the viewport after a cluster is expanded or collapsed, or a group from graph.simplify is opened or closed.
Default
falsefreezeNodesOnDrag
freezeNodesOnDrag:
boolean
Defined in: interfaces/SimulationOptions.ts:80
Default
truegridSize
gridSize:
number
Defined in: interfaces/SimulationOptions.ts:84
Default
50gridSnappingEnabled
gridSnappingEnabled:
boolean
Defined in: interfaces/SimulationOptions.ts:82
Default
falsephysics?
optionalphysics:"manual"|"auto"
Defined in: interfaces/SimulationOptions.ts:113
Who drives the physics knobs.
'auto'— the layout re-tunes itself from what is on screen (node count, node sizes, canvas size) and keeps doing so as the graph changes.'manual'— the knobs stay exactly where they were configured.
Left unset, 'auto' is used unless the graph configures a physics option auto drives (d3LinkDistance, d3ManyBodyStrength, d3CollideRadiusMultiplier, d3VelocityDecay, d3GravityStrength, d3GravityStrengthConnected, d3AlphaDecay, cooldownTime) — so tuning any of them is enough to keep it, and no existing configuration is taken over. Setting physics: 'auto' and d3 options is legal: the explicit values seed the opening frame and auto takes over from there.
Turning any knob by hand (a flyout slider, a set* call, a preset) also leaves auto.
Default
'auto' when no physics option is configured, 'manual' otherwise
useWorker
useWorker:
boolean
Defined in: interfaces/SimulationOptions.ts:118
Default
truewarmupTicks
warmupTicks:
number|"auto"
Defined in: interfaces/SimulationOptions.ts:78
Ticks the opening layout runs before the first frame. 0 runs none, so nodes that carry their own x/y open where they were given.
Default
auto