Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

closeOp

closeOp: string

Holds the operator for closing curves.

default

'Z'

compressed

compressed: boolean

Specifies if the output should be compressed by removing redundant calls.

default

true

curveOp

curveOp: string

Contains the string used for bezier curves.

default

'C'

lastX

lastX: number

Holds the last x coordinate.

default

0

lastY

lastY: number

Holds the last y coordinate.

default

0

lineOp

lineOp: string

Contains the string used for moving in paths.

default

'L'

moveOp

moveOp: string

Contains the string used for moving in paths.

default

'M'

path

path: string[]

Holds the current path as an array.

pointerEvents

pointerEvents: boolean

Boolean value that specifies if events should be handled.

default

false

quadOp

quadOp: string

Contains the string used for quadratic paths.

default

'Q'

root

root: Element

Reference to the container for the SVG content.

rotateHtml

rotateHtml: boolean

Switch for rotation of HTML.

default

true

state

Holds the current state.

states

states: mxCanvas2DState[]

Stack of states.

textEnabled

textEnabled: boolean

Specifies if text output should be enabled.

default

true

Methods

addOp

  • addOp(): void

arcTo

  • arcTo(rx: number, ry: number, angle: number, largeArcFlag: number, sweepFlag: number, x: number, y: number): void
  • Adds the given arc to the current path. This is a synthetic operation that is broken down into curves.

    Parameters

    • rx: number
    • ry: number
    • angle: number
    • largeArcFlag: number
    • sweepFlag: number
    • x: number
    • y: number

    Returns void

begin

  • begin(): void

close

  • close(): void

createElement

  • createElement(name: string): Element

createState

createUrlConverter

curveTo

  • curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): void
  • Adds a bezier curve to the current path.

    Parameters

    • x1: number

      Number that represents the x-coordinate of the first control point.

    • y1: number

      Number that represents the y-coordinate of the first control point.

    • x2: number

      Number that represents the x-coordinate of the second control point.

    • y2: number

      Number that represents the y-coordinate of the second control point.

    • x3: number

      Number that represents the x-coordinate of the endpoint.

    • y3: number

      Number that represents the y-coordinate of the endpoint.

    Returns void

ellipse

  • ellipse(x: number, y: number, w: number, h: number): void
  • Puts an ellipse into the drawing buffer.

    Parameters

    • x: number

      Number that represents the x-coordinate of the ellipse.

    • y: number

      Number that represents the y-coordinate of the ellipse.

    • w: number

      Number that represents the width of the ellipse.

    • h: number

      Number that represents the height of the ellipse.

    Returns void

end

  • end(): void

fill

  • fill(): void

fillAndStroke

  • fillAndStroke(): void

format

  • format(value: string): number

image

  • image(x: number, y: number, w: number, h: number, src: string, aspect: boolean, flipH: boolean, flipV: boolean): void
  • Paints an image.

    Parameters

    • x: number

      Number that represents the x-coordinate of the image.

    • y: number

      Number that represents the y-coordinate of the image.

    • w: number

      Number that represents the width of the image.

    • h: number

      Number that represents the height of the image.

    • src: string

      String that specifies the URL of the image.

    • aspect: boolean

      Boolean indicating if the aspect of the image should be preserved.

    • flipH: boolean

      Boolean indicating if the image should be flipped horizontally.

    • flipV: boolean

      Boolean indicating if the image should be flipped vertically.

    Returns void

lineTo

  • lineTo(x: number, y: number): void
  • Draws a line to the given coordinates.

    Parameters

    • x: number

      Number that represents the x-coordinate of the endpoint.

    • y: number

      Number that represents the y-coordinate of the endpoint.

    Returns void

moveTo

  • moveTo(x: number, y: number): void
  • Moves the current path the given point.

    Parameters

    • x: number

      Number that represents the x-coordinate of the point.

    • y: number

      Number that represents the y-coordinate of the point.

    Returns void

quadTo

  • quadTo(x1: number, y1: number, x2: number, y2: number): void
  • Adds a quadratic curve to the current path.

    Parameters

    • x1: number

      Number that represents the x-coordinate of the control point.

    • y1: number

      Number that represents the y-coordinate of the control point.

    • x2: number

      Number that represents the x-coordinate of the endpoint.

    • y2: number

      Number that represents the y-coordinate of the endpoint.

    Returns void

rect

  • rect(x: number, y: number, w: number, h: number): void
  • Puts a rectangle into the drawing buffer.

    Parameters

    • x: number

      Number that represents the x-coordinate of the rectangle.

    • y: number

      Number that represents the y-coordinate of the rectangle.

    • w: number

      Number that represents the width of the rectangle.

    • h: number

      Number that represents the height of the rectangle.

    Returns void

reset

  • reset(): void

restore

  • restore(): void

rotate

  • rotate(theta: number, flipH: boolean, flipV: boolean, cx: number, cy: number): void
  • Rotates and/or flips the output around a given center. (Note: Due to limitations in VML, the rotation cannot be concatenated.)

    Parameters

    • theta: number

      Number that represents the angle of the rotation (in degrees).

    • flipH: boolean

      Boolean indicating if the output should be flipped horizontally.

    • flipV: boolean

      Boolean indicating if the output should be flipped vertically.

    • cx: number

      Number that represents the x-coordinate of the rotation center.

    • cy: number

      Number that represents the y-coordinate of the rotation center.

    Returns void

rotatePoint

  • rotatePoint(x: number, y: number, theta: number, cx: number, cy: number): void

roundrect

  • roundrect(x: number, y: number, w: number, h: number, dx: number, dy: number): void
  • Puts a rounded rectangle into the drawing buffer.

    Parameters

    • x: number

      Number that represents the x-coordinate of the rectangle.

    • y: number

      Number that represents the y-coordinate of the rectangle.

    • w: number

      Number that represents the width of the rectangle.

    • h: number

      Number that represents the height of the rectangle.

    • dx: number

      Number that represents the horizontal rounding.

    • dy: number

      Number that represents the vertical rounding.

    Returns void

save

  • save(): void

scale

  • scale(value: number): void

setAlpha

  • setAlpha(value: number): void

setDashPattern

  • setDashPattern(value: string): void
  • Sets the current dash pattern.

    default

    '3 3'

    Parameters

    • value: string

      String that represents the dash pattern, which is a sequence of numbers defining the length of the dashes and the length of the spaces between the dashes. The lengths are relative to the line width - a length of 1 is equals to the line width.

    Returns void

setDashed

  • setDashed(value: boolean, fixDash: boolean): void

setFillAlpha

  • setFillAlpha(value: number): void

setFillColor

  • setFillColor(value: string): void

setFontBackgroundColor

  • setFontBackgroundColor(value: string): void

setFontBorderColor

  • setFontBorderColor(value: string): void

setFontColor

  • setFontColor(value: string): void

setFontFamily

  • setFontFamily(value: string): void

setFontSize

  • setFontSize(value: number): void

setFontStyle

  • setFontStyle(value: string): void

setGradient

  • setGradient(color1: string, color2: string, x: number, y: number, w: number, h: number, direction: string, alpha1: number, alpha2: number): void
  • Sets the gradient. Note that the coordinates may be ignored by some implementations.

    default

    1 Possible values are between 1 (opaque) and 0 (transparent).

    default

    1 Possible values are between 1 (opaque) and 0 (transparent).

    Parameters

    • color1: string

      Hexadecimal representation of the start color.

    • color2: string

      Hexadecimal representation of the end color.

    • x: number

      X-coordinate of the gradient region.

    • y: number

      y-coordinate of the gradient region.

    • w: number

      Width of the gradient region.

    • h: number

      Height of the gradient region.

    • direction: string
    • alpha1: number

      Optional alpha of the start color.

    • alpha2: number

      Optional alpha of the end color.

    Returns void

setLineCap

  • setLineCap(value: string): void

setLineJoin

  • setLineJoin(value: string): void

setLink

  • setLink(link: string): void

setMiterLimit

  • setMiterLimit(value: number): void

setShadow

  • setShadow(value: boolean): void

setShadowAlpha

  • setShadowAlpha(value: number): void

setShadowColor

  • setShadowColor(value: string): void

setShadowOffset

  • setShadowOffset(dx: number, dy: number): void

setStrokeAlpha

  • setStrokeAlpha(value: number): void

setStrokeColor

  • setStrokeColor(value: string): void

setStrokeWidth

  • setStrokeWidth(value: number): void

stroke

  • stroke(): void

text

  • text(x: number, y: number, w: number, h: number, str: string, align: string, valign: string, wrap: string, format: string, overflow: string, clip: string, rotation: number, dir: string): void
  • Paints the given text. Possible values for format are empty string for plain text and html for HTML markup. Background and border color as well as clipping is not available in plain text labels for VML. HTML labels are not available as part of shapes with no foreignObject support in SVG (eg. IE9, IE10).

    Parameters

    • x: number

      Number that represents the x-coordinate of the text.

    • y: number

      Number that represents the y-coordinate of the text.

    • w: number

      Number that represents the available width for the text or 0 for automatic width.

    • h: number

      Number that represents the available height for the text or 0 for automatic height.

    • str: string

      String that specifies the text to be painted.

    • align: string

      String that represents the horizontal alignment.

    • valign: string

      String that represents the vertical alignment.

    • wrap: string

      Boolean that specifies if word-wrapping is enabled. Requires w > 0.

    • format: string

      Empty string for plain text or 'html' for HTML markup.

    • overflow: string

      Specifies the overflow behaviour of the label. Requires w > 0 and/or h > 0.

    • clip: string

      Boolean that specifies if the label should be clipped. Requires w > 0 and/or h > 0.

    • rotation: number

      Number that specifies the angle of the rotation around the anchor point of the text.

    • dir: string

      Optional string that specifies the text direction. Possible values are rtl and lrt.

    Returns void

translate

  • translate(dx: number, dy: number): void

writeDefaults

  • writeDefaults(): void

Generated using TypeDoc