Skip to content

pivotick v3.0.0


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? ​

optional callbacks: 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 ​

ts
2000

d3Alpha ​

d3Alpha: number

Defined in: interfaces/SimulationOptions.ts:18

Default ​

ts
1.0

d3AlphaDecay ​

d3AlphaDecay: number

Defined in: interfaces/SimulationOptions.ts:22

Default ​

ts
0.0228

d3AlphaMin ​

d3AlphaMin: number

Defined in: interfaces/SimulationOptions.ts:20

Default ​

ts
0.001

d3AlphaTarget ​

d3AlphaTarget: number

Defined in: interfaces/SimulationOptions.ts:24

Default ​

ts
0

d3CollideIterations ​

d3CollideIterations: number

Defined in: interfaces/SimulationOptions.ts:52

Default ​

ts
1

d3CollideRadius ​

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 ​

ts
12

d3CollideRadiusMultiplier ​

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 ​

ts
1.2

d3CollideStrength ​

d3CollideStrength: number

Defined in: interfaces/SimulationOptions.ts:50

Default ​

ts
1

d3GravityStrength ​

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 ​

ts
0.1

d3GravityStrengthConnected ​

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 ​

ts
0.001

d3LinkDistance ​

d3LinkDistance: number

Defined in: interfaces/SimulationOptions.ts:28

Default ​

ts
30

d3LinkStrength ​

d3LinkStrength: number | null

Defined in: interfaces/SimulationOptions.ts:30

Default ​

ts
null

d3ManyBodyStrength ​

d3ManyBodyStrength: number

Defined in: interfaces/SimulationOptions.ts:32

Default ​

ts
-150

d3ManyBodyTheta ​

d3ManyBodyTheta: number

Defined in: interfaces/SimulationOptions.ts:34

Default ​

ts
0.9

d3VelocityDecay ​

d3VelocityDecay: number

Defined in: interfaces/SimulationOptions.ts:26

Default ​

ts
0.4

enabled ​

enabled: boolean

Defined in: interfaces/SimulationOptions.ts:116

Default ​

ts
true

fitViewOnExpandCollapse ​

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 ​

ts
false

freezeNodesOnDrag ​

freezeNodesOnDrag: boolean

Defined in: interfaces/SimulationOptions.ts:80

Default ​

ts
true

gridSize ​

gridSize: number

Defined in: interfaces/SimulationOptions.ts:84

Default ​

ts
50

gridSnappingEnabled ​

gridSnappingEnabled: boolean

Defined in: interfaces/SimulationOptions.ts:82

Default ​

ts
false

physics? ​

optional physics: "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 ​

ts
true

warmupTicks ​

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 ​

ts
auto