Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new mxGeometry(x?: number, y?: number, width?: number, height?: number): mxGeometry

Properties

TRANSLATE_CONTROL_POINTS

TRANSLATE_CONTROL_POINTS: boolean

Global switch to translate the points in translate. Default is true.

alternateBounds

alternateBounds: mxRectangle

Stores alternate values for x, y, width and height in a rectangle. See swap to exchange the values. Default is null.

see

swap

height

height: number

Variable: height

Holds the height of the rectangle. Default is 0.

offset

offset: mxPoint

For edges, this holds the offset (in pixels) from the position defined by x and y on the edge. For relative geometries (for vertices), this defines the absolute offset from the point defined by the relative coordinates. For absolute geometries (for vertices), this defines the offset for the label. Default is null.

points

points: mxPoint[]

Array of {@link mxPoints} which specifies the control points along the edge. These points are the intermediate points on the edge, for the endpoints use targetPoint and sourcePoint or set the terminals of the edge to a non-null value. Default is null.

relative

relative: boolean

Specifies if the coordinates in the geometry are to be interpreted as relative coordinates. For edges, this is used to define the location of the edge label relative to the edge as rendered on the display. For vertices, this specifies the relative location inside the bounds of the parent cell.

If this is false, then the coordinates are relative to the origin of the parent cell or, for edges, the edge label position is relative to the center of the edge as rendered on screen.

Default is false.

sourcePoint

sourcePoint: mxPoint

Defines the source mxPoint of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null.

targetPoint

targetPoint: mxPoint

Defines the target mxPoint of the edge. This is used if the corresponding edge does not have a target vertex. Otherwise it is ignored. Default is null.

width

width: number

Variable: width

Holds the width of the rectangle. Default is 0.

x

x: number

Variable: x

Holds the x-coordinate of the point. Default is 0.

y

y: number

Variable: y

Holds the y-coordinate of the point. Default is 0.

Methods

add

clone

equals

fromRectangle

getCenterX

  • getCenterX(): number

getCenterY

  • getCenterY(): number

getPoint

getTerminalPoint

  • getTerminalPoint(isSource: boolean): mxPoint
  • Returns the mxPoint representing the source or target point of this edge. This is only used if the edge has no source or target vertex.

    Parameters

    • isSource: boolean

      that specifies if the source or target point should be returned.

    Returns mxPoint

grow

  • grow(amount: number): void
  • Function: grow

    Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.

    Parameters

    • amount: number

    Returns void

intersect

rotate

  • rotate(angle: number, cx: mxPoint): void
  • Rotates the geometry by the given angle around the given center. That is, x and y of the geometry, the sourcePoint, targetPoint and all points are translated by the given amount. x and y are only translated if relative is false.

    Parameters

    • angle: number

      that specifies the rotation angle in degrees.

    • cx: mxPoint

      that specifies the center of the rotation.

    Returns void

rotate90

  • rotate90(): void

scale

  • scale(sx: number, sy: number, fixedAspect: boolean): void
  • Scales the geometry by the given amount. That is, x and y of the geometry, the sourcePoint, targetPoint and all points are scaled by the given amount. x, y, width and height are only scaled if relative is false. If {@link fixedAspect} is true, then the smaller value is used to scale the width and the height.

    Parameters

    • sx: number

      that specifies the horizontal scale factor.

    • sy: number

      that specifies the vertical scale factor.

    • fixedAspect: boolean

      boolean to keep the aspect ratio fixed.

    Returns void

setRect

  • setRect(x: number, y: number, w: number, h: number): void

setRelative

  • setRelative(relative: boolean): void

setTerminalPoint

swap

  • swap(): void
  • Swaps the x, y, width and height with the values stored in alternateBounds and puts the previous values into alternateBounds as a rectangle. This operation is carried-out in-place, that is, using the existing geometry instance. If this operation is called during a graph model transactional change, then the geometry should be cloned before calling this method and setting the geometry of the cell using mxGraphModel.setGeometry.

    Returns void

translate

  • translate(dx: number, dy: number): void
  • Translates the geometry by the specified amount. That is, x and y of the geometry, the sourcePoint, targetPoint and all points are translated by the given amount. x and y are only translated if relative is false. If TRANSLATE_CONTROL_POINTS is false, then points are not modified by this function.

    Parameters

    • dx: number

      that specifies the x-coordinate of the translation.

    • dy: number

      that specifies the y-coordinate of the translation.

    Returns void

Static fromRectangle

Generated using TypeDoc