Components Interactions Examples Tutorials API FAQ
Options
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected _boundingBox

_boundingBox: Selection<void>

Protected _clipPathEnabled

_clipPathEnabled: boolean

Private _colorScale

_colorScale: any

Private _comparator

_comparator: any

Private _formatter

_formatter: any

Protected _isAnchored

_isAnchored: boolean

Protected _isSetup

_isSetup: boolean

Private _maxEntriesPerRow

_maxEntriesPerRow: any

Private _measurer

_measurer: any

Private _padding

_padding: any

Private _redrawCallback

_redrawCallback: any

Private _symbolFactoryAccessor

_symbolFactoryAccessor: any

Private _symbolOpacityAccessor

_symbolOpacityAccessor: any

Private _wrapper

_wrapper: any

Private _writer

_writer: any

Static LEGEND_ENTRY_CLASS

LEGEND_ENTRY_CLASS: string

The css class applied to each legend entry

Static LEGEND_ROW_CLASS

LEGEND_ROW_CLASS: string

The css class applied to each legend row

Static LEGEND_SYMBOL_CLASS

LEGEND_SYMBOL_CLASS: string

The css class applied to each legend symbol

Methods

Private _calculateLayoutInfo

  • _calculateLayoutInfo(availableWidth: any, availableHeight: any): any
  • Parameters

    • availableWidth: any
    • availableHeight: any

    Returns any

Private _packRows

  • _packRows(availableWidth: any, entries: any, entryLengths: any): any
  • Parameters

    • availableWidth: any
    • entries: any
    • entryLengths: any

    Returns any

Protected _setup

  • _setup(): void

Protected _sizeFromOffer

  • _sizeFromOffer(availableWidth: number, availableHeight: number): object

addClass

  • addClass(cssClass: string)

anchor

background

  • Gets the Selection containing the behind the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

    background selection for the Component

bounds

  • Returns Bounds

    for the component in pixel space, where the topLeft represents the component's minimum x and y values and the bottomRight represents the component's maximum x and y values.

colorScale

  • colorScale(): Color
  • colorScale(colorScale: Color)

comparator

  • comparator(): function
  • comparator(comparator: function)
  • Gets the current comparator for the Legend's entries.

    Returns function

      • (a: string, b: string): number
      • Parameters

        • a: string
        • b: string

        Returns number

  • Sets a new comparator for the Legend's entries. The comparator is used to set the display order of the entries.

    Parameters

    • comparator: function
        • (a: string, b: string): number
        • Parameters

          • a: string
          • b: string

          Returns number

computeLayout

  • computeLayout(origin?: Point, availableWidth?: number, availableHeight?: number)
  • Computes and sets the size, position, and alignment of the Component from the specified values. If no parameters are supplied and the Component is a root node, they are inferred from the size of the Component's element.

    Parameters

    • Optional origin: Point
    • Optional availableWidth: number
    • Optional availableHeight: number

content

  • Gets a Selection containing a that holds the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

    content selection for the Component

destroy

  • destroy(): void

detach

  • detach()
  • Detaches a Component from the DOM. The Component can be reused.

    This should only be used if you plan on reusing the calling Component. Otherwise, use destroy().

entitiesAt

  • Gets the Entities (representing Legend entries) at a particular point. Returns an empty array if no Entities are present at that location.

    Parameters

    Returns Entity<Legend>[]

fixedHeight

  • fixedHeight(): boolean

fixedWidth

  • fixedWidth(): boolean

foreground

  • Gets the Selection containing the in front of the visual elements of the Component.

    Will return undefined if the Component has not been anchored.

    Returns Selection<void>

formatter

hasClass

  • hasClass(cssClass: string): boolean
  • Checks if the Component has a given CSS class.

    Parameters

    • cssClass: string

      The CSS class to check for.

    Returns boolean

height

  • height(): number

maxEntriesPerRow

  • maxEntriesPerRow(): number
  • maxEntriesPerRow(maxEntriesPerRow: number)
  • Gets the maximum number of entries per row.

    Returns number

  • Sets the maximum number of entries perrow.

    Parameters

    • maxEntriesPerRow: number

offAnchor

offDetach

onAnchor

onDetach

onResize

  • Sets a callback that gets called when the component resizes. The size change is not guaranteed to be reflected by the DOM at the time the callback is fired.

    Parameters

origin

originToSVG

parent

redraw

  • redraw()
  • Causes the Component to re-layout and render.

    This function should be called when a CSS change has occured that could influence the layout of the Component, such as changing the font size.

removeClass

  • removeClass(cssClass: string)

render

  • render()

renderImmediately

  • renderImmediately()

renderTo

  • renderTo(element: String | Element | Selection<void>)

requestedSpace

  • requestedSpace(offeredWidth: number, offeredHeight: number): SpaceRequest

symbol

  • symbol(): function
  • symbol(symbol: function)

symbolOpacity

  • symbolOpacity(): function
  • symbolOpacity(symbolOpacity: number | function)
  • Gets the opacity of the symbols of the Legend.

    Returns function

      • (datum: any, index: number): number
      • Parameters

        • datum: any
        • index: number

        Returns number

  • Sets the opacity of the symbols of the Legend.

    Parameters

    • symbolOpacity: number | function

width

  • width(): number

xAlignment

  • xAlignment(): string
  • xAlignment(xAlignment: string)

yAlignment

  • yAlignment(): string
  • yAlignment(yAlignment: string)

Generated using TypeDoc