Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LegendView

A legend view is responsible for displaying and manging a series of legend elements.

export

Hierarchy

Index

Constructors

constructor

  • Initializes and returns a legend view instance with the specified target and configuration object.

    memberof

    LegendView

    Parameters

    Returns LegendView

Accessors

$el

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

    readonly
    memberof

    LegendView

    Returns any

count

  • get count(): number
  • Returns number

Methods

add

  • Adds a legend for the specified legend type code and options.

    memberof

    LegendView

    Parameters

    Returns void

addLegend

  • Adds a legend item to the view.

    memberof

    LegendView

    Parameters

    Returns void

get

  • Returns the legend for the specified type code if it exists in the view.

    memberof

    LegendView

    Parameters

    • type: string

    Returns LegendRenderable

getSize

  • Returns Size

has

  • has(type: string): boolean
  • Returns whether the view contains a legend for the specified type code.

    memberof

    LegendView

    Parameters

    • type: string

    Returns boolean

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

remove

  • remove(type: string): void
  • Removes the legend for the specified type code.

    memberof

    LegendView

    Parameters

    • type: string

    Returns void

removeAll

  • removeAll(exclude?: string[]): void
  • Removes all existing legends from the view.

    memberof

    LegendView

    Parameters

    • Optional exclude: string[]

    Returns void

removeLegend

  • Removes a legend item from the view.

    memberof

    LegendView

    Parameters

    Returns void

set

  • set(types: string[], opts?: any): void
  • Updates the legend view for the specified type codes and options. All previously existing legends will be removed.

    memberof

    LegendView

    Parameters

    • types: string[]
    • Optional opts: any

    Returns void

setMetric

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

    memberof

    LegendView

    Parameters

    • metric: boolean

    Returns void

setSize

  • setSize(size: Size): void
  • Sets the size of the view and existing legends.

    memberof

    LegendView

    Parameters

    Returns void

setUrl

  • setUrl(url: string): void
  • Sets the legend using a static image URL. All previously existing legends will be removed.

    memberof

    LegendView

    Parameters

    • url: string

    Returns void

setWidth

  • setWidth(width: number): void
  • Sets the width of the view and all existing legends. The previous height value will be used.

    memberof

    LegendView

    Parameters

    • width: number

    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

update

  • update(opts?: {}): void
  • Forces an update of all existing legends.

    memberof

    LegendView

    Parameters

    • Optional opts: {}
      • [key: string]: any

    Returns void

Generated using TypeDoc