Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Canvas

Hierarchy

  • Canvas

Implemented by

Index

Properties

diagram

diagram: Diagram | null

height

height: number

offsetX

offsetX: number

offsetY

offsetY: number

width

width: number

zoom

zoom: number

Methods

drawLine

drawSimpleLine

  • drawSimpleLine(x1: number, y1: number, x2: number, y2: number, stroke: Stroke): void
  • Draws a simple line from four coordinates

    Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • stroke: Stroke

    Returns void

drawText

  • drawText(text: string, x: number, y: number, font: Font, maxWidth?: undefined | number, hAlign?: TextAlign, vAlign?: Baseline): void
  • Draws a text

    Parameters

    • text: string

      The text to draw

    • x: number

      The text X position

    • y: number

      The text Y position

    • font: Font

      The font to use

    • Optional maxWidth: undefined | number

      The maximum width of the text

    • Optional hAlign: TextAlign

      The horizontal alignment

    • Optional vAlign: Baseline

      The vertical alignment

    Returns void

fillRectangle

labelLine

  • labelLine(line: Line, font: Font, label: string, position?: undefined | number): void
  • Labels a line

    Parameters

    • line: Line
    • font: Font
    • label: string
    • Optional position: undefined | number

    Returns void

measureTextWidth

  • measureTextWidth(text: string, font: Font): number
  • Measures the width of a text

    Parameters

    • text: string

      The text to measure

    • font: Font

      The font to use

    Returns number

popCanvasStack

  • popCanvasStack(): void

pushCanvasStack

  • pushCanvasStack(): void

strokeRectangle

translate

  • translate(offset: Point): void

Generated using TypeDoc