Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GraphTrack

An extension to CanvasTrack for rendering plots

See ./readme.md in source code for more info

Hierarchy

Index

Constructors

constructor

Properties

Protected _data

_data: any

Protected _isLoading

_isLoading: boolean

Protected _mounted

_mounted: boolean

Private Optional _transformCondition

_transformCondition: number = null

Private Optional _transformedData

_transformedData: any

ctx

ctx: CanvasRenderingContext2D

debounce

elm

elm: HTMLElement

error

error: Error | string

id

id: string | number

Optional legendUpdate

legendUpdate: LegendTriggerFunction

loader

loader: D3Selection

options

order

order: number

plots

plots: Plot[]

scale

scale: Scale

trackScale

trackScale: Scale

transform

transform: Transform

Accessors

data

  • get data(): any
  • set data(data: Promise<any> | Function | any): void

isLoading

  • get isLoading(): boolean
  • set isLoading(val: boolean): void

isMounted

  • get isMounted(): boolean

Methods

init

  • init(elm: HTMLElement, scale: Scale): void
  • Calls OnMount and OnUpdate. Useful if track is stand-alone

    Parameters

    • elm: HTMLElement
    • scale: Scale

    Returns void

loadData

  • loadData(data: any, showLoader?: boolean): 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
    • Default value showLoader: boolean = true

    Returns void

onDataLoaded

  • onDataLoaded(): void

onError

  • onError(error: Error | string): void
  • Should be called from track implementation in case an unrecoverable error occurs.

    Parameters

    • error: Error | string

    Returns void

onMount

onRescale

onUnmount

  • 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

    Returns void

onUpdate

plot

  • plot(): void

prepareData

  • prepareData(): void
  • Execute configured transform function if applicable on the track's data and update plots with the result

    Returns void

refresh

  • refresh(): void

setPlotOption

  • setPlotOption(id: string | number, key: string, value: any): GraphTrack

updateRange

  • updateRange(): void

Generated using TypeDoc