/** * The label plugin displays a text on the canvas element * @author Eirik Måseidvåg */ import CanvasElementPlugin from '../abstract/CanvasElementPlugin'; import { OffsetMatrix, PositionMatrix, LabelPluginOptions } from './types'; import { CanvasElementPluginType } from '../abstract'; export default class LabelPlugin extends CanvasElementPlugin { /** * The text to write */ text: string; /** * The text color. Represented as a hexadecimal number * E.g. 0xffffff (white) * @public */ color: number; /** * The opacity of the text. Float [0 - 1] * @public */ colorOpacity: number; /** * The color of the background. Represented as a hexadecimal number * Transparent if undefined * E.g. 0xffffff (white) * @public */ backgroundColor: number | undefined; /** * The opacity of the background color. Float [0 - 1] * @public */ backgroundColorOpacity: number; /** * The size of the text * @public */ size: number; /** * The offset of the text */ offsetMatrix: OffsetMatrix; /** * The position of the text */ positionMatrix: PositionMatrix; /** * The canvas element plugin type */ name: CanvasElementPluginType; /** * Construct the label plugin * @param options */ constructor(options: LabelPluginOptions); }