Skip to content

@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? ​

readonly optional anchor?: 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 ​

PositionColumnExtra.anchor


column? ​

readonly optional column?: string

Defined in: positions/types.ts:137

A 3-component node column holding the coordinates (advanced form); defaults to the role-position column.


containersFollowChildren? ​

readonly optional containersFollowChildren?: 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? ​

readonly optional groups?: readonly ImporterGroupBox[]

Defined in: positions/types.ts:139

Group container boxes the file stores apart from the node coordinates (Graphviz cluster bb).


height? ​

readonly optional height?: 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 ​

PositionColumnExtra.height


medianNodeSize? ​

readonly optional medianNodeSize?: 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? ​

readonly optional originUnplaced?: 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? ​

readonly optional pxPerUnit?: 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 ​

PositionColumnExtra.pxPerUnit


pxPerUnitY? ​

readonly optional pxPerUnitY?: 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? ​

readonly optional sourceDims?: 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? ​

readonly optional tool?: GraphTool | null

Defined in: positions/types.ts:143

The tool that wrote the file, when the importer knows it better than meta.creator.


units? ​

readonly optional units?: LengthUnit

Defined in: positions/types.ts:37

The unit of the coordinates.

Inherited from ​

PositionColumnExtra.units


unplacedCircle? ​

readonly optional unplacedCircle?: 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 ​

readonly center: readonly [number, number]

The circle's center, x and y.

direction ​

readonly direction: -1 | 1

Which way round the next nodes go: 1 the angle grows, -1 it shrinks.

radius ​

readonly radius: number

Its radius.

startDegrees ​

readonly startDegrees: number

The angle of the first node, in degrees.


viewerFit? ​

readonly optional viewerFit?: 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 ​

PositionColumnExtra.viewerFit


width? ​

readonly optional width?: 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 ​

PositionColumnExtra.width


x? ​

readonly optional x?: string

Defined in: positions/types.ts:131

A plain numeric node column holding x (simple form).


y? ​

readonly optional y?: string

Defined in: positions/types.ts:133

A plain numeric node column holding y (simple form).


yAxis? ​

readonly optional yAxis?: YAxis

Defined in: positions/types.ts:60

Which way y grows; "down" is flipped to y up.

Inherited from ​

PositionColumnExtra.yAxis


z? ​

readonly optional z?: string

Defined in: positions/types.ts:135

A plain numeric node column holding z (simple form); omit for a 2D file.


zeroUnplaced? ​

readonly optional zeroUnplaced?: 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? ​

readonly optional zOrigin?: 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.

Inherited from ​

PositionColumnExtra.zOrigin