Skip to content

@graphty/layout / positions / fromPositionMap

Function: fromPositionMap() ​

fromPositionMap(pos, ids, dim, fill): F32

Defined in: positions.ts:46

A flat dim-stride array from a legacy map: a node present in pos takes its row (a missing component is 0), and every other node's row is written by fill.

Parameters ​

pos ​

PositionMap | null | undefined

the id-keyed positions, or null / undefined for none

ids ​

NodeIdMap

the id map of the snapshot the layout runs over

dim ​

2 | 3

components per row

fill ​

(i, out) => void

writes row i of out for a node pos does not give

Returns ​

F32

ids.size * dim values in node-index order