Skip to content

@graphty/layout / index / resolveNodeVector

Function: resolveNodeVector() ​

resolveNodeVector(spec, s, fallback): F32

Defined in: simulation/inputs.ts:41

Resolves a per-node vector: null -> the role-mass node column when present, else fallback(i) for every i; a Float32Array of length n as given; a column name -> that numeric node column; the legacy record -> every id through the id map, missing ids take the fallback.

Parameters ​

spec ​

string | F32 | Readonly<Record<NodeId, number>> | null | undefined

the option value

s ​

GraphSnapshot

the snapshot

fallback ​

(i) => number

the default per index

Returns ​

F32

n values