Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Legend

A legend implements the LegendRenderable interface and provides the base legend functionality.

export
implements

{LegendRenderable}

Hierarchy

Implements

Index

Constructors

constructor

  • Initializes and returns a legend for the specified key and configuration options.

    memberof

    Legend

    Parameters

    Returns Legend

Accessors

$el

  • get $el(): any
  • DOM element for the legend.

    readonly
    memberof

    Legend

    Returns any

account

  • Aeris account used when requesting data for dynamic legends.

    readonly
    memberof

    Legend

    Returns Account

key

  • get key(): string
  • Key associated with the legend.

    readonly
    memberof

    Legend

    Returns string

opts

  • Configuration options.

    readonly
    memberof

    Legend

    Returns LegendOptions

Methods

getSize

has

  • has(type: string): boolean
  • Returns whether the listeners are registered for the specified event name.

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hide

  • hide(): void
  • Hides the legend DOM element.

    memberof

    Legend

    Returns void

off

  • Removes a registered listener function for the specified event.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to remove the listener for.

    • callback: Function

      Handler function to remove so it won't be executed next time the event is triggered.

    • Default value scope: any = null

    Returns EventDispatcher

offAll

on

  • on(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed each time an event occurs

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

once

  • once(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed the first time an event occurs.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

reset

  • reset(): void
  • Resets the legend by removing an existing image.

    memberof

    Legend

    Returns void

resize

  • resize(): void
  • Returns void

setMetric

  • setMetric(metric: boolean): void
  • Sets whether to display data values in Metric units.

    memberof

    Legend

    Parameters

    • metric: boolean

    Returns void

setSize

  • setSize(size: Size): void
  • Sets the size of the legend.

    memberof

    Legend

    Parameters

    Returns void

show

  • show(): void
  • Shows the legend DOM element.

    memberof

    Legend

    Returns void

trigger

  • Triggers the specified event so that all registered listeners will be executed with the specified parameters.

    memberof

    EventDispatcher

    Parameters

    • type: any

      Event name to trigger

    • Default value data: any = null

    Returns EventDispatcher

units

  • units(): string
  • Returns the unit based on whether the legend is displaying values in Metric or Imperial.

    memberof

    Legend

    Returns string

update

  • update(opts?: any, force?: boolean): void
  • Forces the legend to update if needed.

    memberof

    Legend

    Parameters

    • Optional opts: any
    • Default value force: boolean = false

    Returns void

Generated using TypeDoc