C

CoordinateConverter

A class that converts coordinates in the yFiles coordinate space (origin is top left, y-axis goes down) to the VSDX coordinate space (origin is bottom left, y-axis goes up).

Inheritance Hierarchy

Members

No filters for this type

Methods

Converts a point in yFiles coordinates to the local (VSDX) coordinate system of a shape.

Parameters

point: Point

The point in yFiles coordinates

shape: PageLike | Shape

The shape, page or master

height?: number

Return Value

Point
A point in the local coordinate system of the shape

Converts a point in yFiles coordinates to the (VSDX) coordinate system of a shape's parent.

Parameters

point: Point

The point in yFiles coordinates

shape: Shape

The shape

height?: number

Return Value

Point
A point in the coordinate system of the shape's parent

Converts a point in yFiles coordinates to VSDX coordinates. Equivalent to applying the x and y methods pointwise.

Parameters

point: Point

The point

height?: number

Return Value

Scales a value. Since x and y scale uniformly the orientation of this length value does not matter.

Parameters

l: number

The value to scale

Return Value

Converts an x coordinate to the VSDX coordinate space.

Parameters

x: number

The x coordinate

Return Value

Converts a y coordinate to the VSDX coordinate space.

Parameters

y: number

The y coordinate.

height?: number

By passing a height value you can convert the reference point of a shape from top-left to bottom-left in the same step.

Return Value

Static Methods

Creates a new CoordinateConverter instance that is valid for the given page, sourceBounds, and targetBounds.

In order to retrieve an instance equivalent to MasterProviderContext.coordinateConverter or ShapeProcessingContext.coordinateConverter, pass the GraphComponent's GraphComponent.contentRect as sourceBounds and use the same targetBounds as in VsdxIO.addGraph, reduced by VsdxExportConfiguration.margins (in inches, 1 inch = 96 pixels).

static

Parameters

page: Page
sourceBounds: Rect
targetBounds?: Rect

Converts a point in some other shape's (VSDX) coordinate system and transforms it to a point in targetShape`s (VSDX) coordinate system. Equivalent to VSDX's LOC function.

static

Parameters

xValue: Value<number>

The x-value

yValue: Value<number>

The y-value

targetShape: Shape

The shape used as target

Return Value

Converts a point in some other shape's (VSDX) coordinate system and transforms it to a point in targetShape`s parent (VSDX) coordinate system. Equivalent to VSDX's PAR function.

static

Parameters

xValue: Value<number>

The x-value

yValue: Value<number>

The y-value

targetShape: Shape

The shape used as target

Return Value