Skip to content
EliteChart

DrawCallback

Documentation


Documentation / @elitechart/core / DrawCallback

code
type DrawCallback = (dirty) => void;

Defined in: scheduler/frame-scheduler.ts:52

Callback invoked once per frame with the dirty-layer bitmask.

Parameters

dirty

number

Returns

void

Example

code
import { Layer, type DrawCallback } from '@elitechart/core';
const draw: DrawCallback = (dirty) => {
  if (dirty & Layer.Series) repaintSeries();
  if (dirty & Layer.Cursor) repaintCursor();
};