@graphty/graph-io / positions / ImporterPositions
Interface: ImporterPositions ​
Defined in: positions/types.ts:129
What an importer's positions() hook returns: where its coordinates are and how they are spelled.
The simple form names two (or three) plain numeric node columns: { x: "x", y: "y", yAxis: "down", units: "px" }. The advanced form names a 3-component column (column) and may add the anchor, size columns, group boxes, a median node size and the tool.
Extends ​
Properties ​
anchor? ​
readonlyoptionalanchor?:PositionAnchor
Defined in: positions/types.ts:62
What the coordinate points at; "top-left" is moved to the center using width and height.
Inherited from ​
column? ​
readonlyoptionalcolumn?:string
Defined in: positions/types.ts:137
A 3-component node column holding the coordinates (advanced form); defaults to the role-position column.
containersFollowChildren? ​
readonlyoptionalcontainersFollowChildren?:boolean
Defined in: positions/types.ts:85
The program that draws the file draws a container node (one other nodes name as their parent) around its children, wherever the container's own stored coordinate says: Cytoscape.js computes a compound node's position and size from its children's. A container's stored coordinate is then not read, and it has no position here unless the file stores its box.
Inherited from ​
PositionColumnExtra.containersFollowChildren
groups? ​
readonlyoptionalgroups?: readonlyImporterGroupBox[]
Defined in: positions/types.ts:139
Group container boxes the file stores apart from the node coordinates (Graphviz cluster bb).
height? ​
readonlyoptionalheight?:string
Defined in: positions/types.ts:66
The name of the node column holding each node's height, for a top-left anchor.
Inherited from ​
medianNodeSize? ​
readonlyoptionalmedianNodeSize?:number|null
Defined in: positions/types.ts:141
The median node diameter in the file's unit, when the importer knows it better than the size columns.
originUnplaced? ​
readonlyoptionaloriginUnplaced?:boolean
Defined in: positions/types.ts:78
The program that draws the file puts a node the file gives no position at the origin, (0, 0, 0) as written, when other nodes are placed (Gephi), rather than leaving it for a layout to place.
Inherited from ​
PositionColumnExtra.originUnplaced
pxPerUnit? ​
readonlyoptionalpxPerUnit?:number
Defined in: positions/types.ts:43
How many px (points) one unit of the coordinates is, when units is "file" but the file's unit is a known length: 72 for Graphviz input inches. Lets a reader draw the coordinates in the same unit as the file's px style lengths; the coordinates themselves stay as written.
Inherited from ​
pxPerUnitY? ​
readonlyoptionalpxPerUnitY?:number
Defined in: positions/types.ts:49
How many px one unit of y is, when the program that draws the file stretches its axes apart (Pajek fits the file's 0..1 square to its Draw window, x across the width and y down the height); absent when y is pxPerUnit like x. extractPositions() returns y in x's unit.
Inherited from ​
PositionColumnExtra.pxPerUnitY
sourceDims? ​
readonlyoptionalsourceDims?:2|3
Defined in: positions/types.ts:58
How many coordinates the file wrote per node: 2, or 3 when it stored a z.
Inherited from ​
PositionColumnExtra.sourceDims
tool? ​
readonlyoptionaltool?:GraphTool|null
Defined in: positions/types.ts:143
The tool that wrote the file, when the importer knows it better than meta.creator.
units? ​
readonlyoptionalunits?:LengthUnit
Defined in: positions/types.ts:37
The unit of the coordinates.
Inherited from ​
unplacedCircle? ​
readonlyoptionalunplacedCircle?:object
Defined in: positions/types.ts:150
Where the program that draws the file puts its nodes when the file places none: evenly round a circle in node order, the first at startDegrees, each next one further round in direction (1: the angle grows, -1: it shrinks), in the file's own coordinates as the rest of this answer spells them (Pajek: center 0.5, 0.5, radius 0.4, the first vertex on the left). Absent, such a file has no positions.
center ​
readonlycenter: readonly [number,number]
The circle's center, x and y.
direction ​
readonlydirection:-1|1
Which way round the next nodes go: 1 the angle grows, -1 it shrinks.
radius ​
readonlyradius:number
Its radius.
startDegrees ​
readonlystartDegrees:number
The angle of the first node, in degrees.
viewerFit? ​
readonlyoptionalviewerFit?:ViewerFit
Defined in: positions/types.ts:56
Set when the coordinates have no fixed length: the program that draws the file fits their bounding box into its canvas, padding px in from each side, and draws label sizes in the canvas's px rather than in the coordinates' unit (sigma.js). Absent when the coordinates keep their own length.
Inherited from ​
width? ​
readonlyoptionalwidth?:string
Defined in: positions/types.ts:64
The name of the node column holding each node's width, for a top-left anchor.
Inherited from ​
x? ​
readonlyoptionalx?:string
Defined in: positions/types.ts:131
A plain numeric node column holding x (simple form).
y? ​
readonlyoptionaly?:string
Defined in: positions/types.ts:133
A plain numeric node column holding y (simple form).
yAxis? ​
readonlyoptionalyAxis?:YAxis
Defined in: positions/types.ts:60
Which way y grows; "down" is flipped to y up.
Inherited from ​
z? ​
readonlyoptionalz?:string
Defined in: positions/types.ts:135
A plain numeric node column holding z (simple form); omit for a 2D file.
zeroUnplaced? ​
readonlyoptionalzeroUnplaced?:boolean
Defined in: positions/types.ts:73
The file writes (0, 0) for a node it has no position for (NetworkX's Pajek writer): when other rows are placed, a (0, 0) shared by two or more rows counts as unplaced.
Inherited from ​
PositionColumnExtra.zeroUnplaced
zOrigin? ​
readonlyoptionalzOrigin?:number
Defined in: positions/types.ts:68
A z the file centers its depth on (Pajek's 0.5): subtracted from a real z before any flip.