@maxgraph/core
    Preparing search index...

    Class AbstractCanvas2DAbstract

    Base class for all canvases.

    The following methods make up the public interface of the canvas 2D for all painting in mxGraph:

    arcTo is an additional method for drawing paths. This is a synthetic method, meaning that it is turned into a sequence of curves by default. Subclasses may add native support for arcs.

    All color values of NONE will be converted to null in the state.

    Hierarchy (View Summary)

    Index
    closeOp: string = 'Z'

    Holds the operator for closing curves. Default is 'Z'.

    converter: UrlConverter

    Holds the to convert image URLs.

    curveOp: string = 'C'

    Contains the string used for bezier curves. Default is 'C'.

    lastX: number = 0

    Holds the last x coordinate.

    lastY: number = 0

    Holds the last y coordinate.

    lineOp: string = 'L'

    Contains the string used for moving in paths. Default is 'L'.

    moveOp: string = 'M'

    Contains the string used for moving in paths. Default is 'M'.

    path: (string | number)[] = []

    Holds the current path as an array.

    pointerEvents: boolean = false

    Boolean value that specifies if events should be handled. Default is false.

    pointerEventsValue: string | null = null
    quadOp: string = 'Q'

    Contains the string used for quadratic paths. Default is 'Q'.

    rotateHtml: boolean = true

    Switch for rotation of HTML. Default is false.

    state: CanvasState = ...

    Holds the current state.

    states: CanvasState[] = []

    Stack of states.

    • Adds the given operation to the path.

      Parameters

      • op: string
      • ...args: number[]

      Returns 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: boolean
      • sweepFlag: boolean
      • x: number
      • y: number

      Returns void

    • Closes the current path.

      Parameters

      • Optionalx1: number
      • Optionaly1: number
      • Optionalx2: number
      • Optionaly2: number
      • Optionalx3: number
      • Optionaly3: number

      Returns void

    • Adds a bezier curve to the current path.

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number
      • x3: number
      • y3: number

      Returns void

    • Parameters

      • x: number
      • y: number
      • w: number
      • h: number
      • src: string
      • aspect: boolean
      • flipH: boolean
      • flipV: boolean

      Returns void

    • Draws a line to the given coordinates. Uses moveTo with the op argument.

      Parameters

      • x: number
      • y: number

      Returns void

    • Adds a quadratic curve to the current path.

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number

      Returns void

    • Rotates the current state.

      Parameters

      • theta: number
      • flipH: boolean
      • flipV: boolean
      • cx: number
      • cy: number

      Returns void

    • Rotates the given point and returns the result as an Point.

      Parameters

      • x: number
      • y: number
      • theta: number
      • cx: number
      • cy: number

      Returns Point

    • Parameters

      • x: number
      • y: number
      • w: number
      • h: number
      • r1: number
      • r2: number

      Returns void

    • Enables or disables dashed lines.

      Parameters

      • value: boolean
      • fixDash: boolean = false

      Returns void

    • Sets the current font background color.

      Parameters

      • value: string | null

      Returns void

    • Sets the current font border color.

      Parameters

      • value: string | null

      Returns void

    • Sets the current gradient.

      Parameters

      • color1: string
      • color2: string
      • x: number
      • y: number
      • w: number
      • h: number
      • direction: DirectionValue
      • alpha1: number = 1
      • alpha2: number = 1

      Returns void

    • Enables or disables and configures the current shadow.

      Parameters

      • enabled: boolean

      Returns void

    • Sets the current shadow alpha.

      Parameters

      • value: number

        Number that represents the new alpha. Possible values are between 1 (opaque) and 0 (transparent).

      Returns void

    • Sets the current shadow color.

      Parameters

      • value: string | null

        Hexadecimal representation of the color or none.

      Returns void

    • Sets the current shadow offset.

      Parameters

      • dx: number

        Number that represents the horizontal offset of the shadow.

      • dy: number

        Number that represents the vertical offset of the shadow.

      Returns void