Skip to content

@graphty/graph-io / positions / toFilePositions

Function: toFilePositions() ​

toFilePositions(coords, extra, sizes?): Float64Array

Defined in: positions/convert.ts:66

Neutral coordinates (center, y up, as extractPositions() returns them) back into a column spelled as extra declares, for a writer: the y flip, Pajek's z origin and yEd's top-left corner are undone. Rows that are NaN stay NaN.

Parameters ​

coords ​

Float64Array

x, y, z per node

extra ​

PositionColumnExtra

the spelling of the column to write

sizes? ​

each node's width and height, needed for a top-left anchor

height ​

Float64Array

heights by node index

width ​

Float64Array

widths by node index

Returns ​

Float64Array

a new array, x, y, z per node in the file's spelling