Skip to content

registerFigure(figure) ​

registerFigure used to custom figure.

Reference ​

typescript
(
  overlay: {
    name: string
    draw: (ctx: CanvasRenderingContext2D, attrs: any, styles: object) => void
    checkEventOn: (coordinate: Coordinate, attrs: any, styles: object) => boolean
  }
) => void

Parameters ​

  • figure Figure configuration.
    • name Name, unique identifier.
    • draw Drawing method.
    • checkEventOn Checks if the event is on a figure.

Returns ​

registerFigure returns undefined 。

Usage ​

Used in custom indicators ​

Used in custom overlays ​