Class CanvasTrack<TOptions>

Base track for tracks that renders to a canvas context

Type Parameters

  • TOptions extends TrackOptions

Hierarchy (view full)

Constructors

Properties

_data: any
_isLoading: boolean
_mounted: boolean
ctx: CanvasRenderingContext2D
elm: HTMLElement
error: string | Error
id: string | number
legendUpdate?: LegendTriggerFunction
loader: any
options: TOptions
order: number
scale: Scale
transform: Transform

Accessors

  • get isLoading(): boolean
  • Returns boolean

  • set isLoading(val): void
  • Parameters

    • val: boolean

    Returns void

  • get isMounted(): boolean
  • Returns boolean

Methods

  • Calls OnMount and OnUpdate. Useful if track is stand-alone

    Parameters

    • elm: HTMLElement
    • scale: Scale

    Returns void

  • Initiate loading of data for track. Will set response to the track's data property. If showLoader is set to true, the current track will be hidden, and (if supplied) the loader element will be shown, until data is resolved. Calls onDataLoaded if implemented by track.

    Parameters

    • data: any
    • showLoader: boolean = true

    Returns void

  • Should be called from track implementation in case an unrecoverable error occurs.

    Parameters

    • error: string | Error

    Returns void

  • Override to add canvas element for plotting track data

    Parameters

    • trackEvent: OnMountEvent

    Returns void

  • Handler for onRescale event. Called by container when y-scale domain/transform is changed.

    Parameters

    • trackEvent: OnRescaleEvent

    Returns void

  • Handler for onUnmount event. Called when track DOM-element is remove from the DOM model. Typically, trackEvent will be an empty object, but depends on container.

    Parameters

    • trackEvent: OnUnmountEvent = {}

    Returns void

Generated using TypeDoc