@graphty/graphty-element / session / ReadonlyElementPositions
Interface: ReadonlyElementPositions ​
Defined in: graphty-element/src/session/types.ts:1666
The node coordinates, read by dense node index: a row no layout has placed reads as unplaced rather than as the origin.
Read-only. A consumer places and pins nodes through session.positions.set, pin and unpin, which are undoable steps; the array a layout writes every frame is the element's own.
Extended by ​
Properties ​
capacity ​
readonlycapacity:number
Defined in: graphty-element/src/session/types.ts:1668
Rows the coordinates can hold without growing.
count ​
readonlycount:number
Defined in: graphty-element/src/session/types.ts:1670
Rows in use: the node count of the current snapshot.
generation ​
readonlygeneration:number
Defined in: graphty-element/src/session/types.ts:1676
Moves whenever coordinates are written on purpose, so a reader can tell they changed.
pinnedCount ​
readonlypinnedCount:number
Defined in: graphty-element/src/session/types.ts:1674
Rows in use that are pinned.
placedCount ​
readonlyplacedCount:number
Defined in: graphty-element/src/session/types.ts:1672
Rows in use that hold a coordinate.
Methods ​
isPinned() ​
isPinned(
index):boolean
Defined in: graphty-element/src/session/types.ts:1688
Whether a row is pinned.
Parameters ​
index ​
number
The dense node index.
Returns ​
boolean
False for an unpinned row or one past the rows in use.
isPlaced() ​
isPlaced(
index):boolean
Defined in: graphty-element/src/session/types.ts:1682
Whether a row holds a coordinate.
Parameters ​
index ​
number
The dense node index.
Returns ​
boolean
False for an unplaced row or one past the rows in use.
read() ​
read(
index,out):void
Defined in: graphty-element/src/session/types.ts:1697
Read a row's coordinates into an object the caller owns.
Parameters ​
index ​
number
The dense node index.
out ​
Receives x, y and z in scene units; NaN for an unplaced row.
x ​
number
Receives x.
y ​
number
Receives y.
z ​
number
Receives z.
Returns ​
void