Components Interactions Examples Tutorials API FAQ
Options
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected _boundingBox

_boundingBox: Selection<void>

Private _calculatedLayout

_calculatedLayout: any

Protected _clipPathEnabled

_clipPathEnabled: boolean

Private _columnPadding

_columnPadding: any

Private _columnWeights

_columnWeights: any

Protected _isAnchored

_isAnchored: boolean

Protected _isSetup

_isSetup: boolean

Private _nCols

_nCols: any

Private _nRows

_nRows: any

Private _rowPadding

_rowPadding: any

Private _rowWeights

_rowWeights: any

Private _rows

_rows: any

Methods

Protected _adoptAndAnchor

  • _adoptAndAnchor(component: Component): void

Private _determineGuarantees

  • _determineGuarantees(offeredWidths: any, offeredHeights: any, isFinalOffer?: any): any
  • Parameters

    • offeredWidths: any
    • offeredHeights: any
    • Optional isFinalOffer: any

    Returns any

Protected _forEach

  • _forEach(callback: function): void

Private _iterateLayout

  • _iterateLayout(availableWidth: any, availableHeight: any, isFinalOffer?: any): any
  • Parameters

    • availableWidth: any
    • availableHeight: any
    • Optional isFinalOffer: any

    Returns any

Private _padTableToSize

  • _padTableToSize(nRows: any, nCols: any): any

Protected _remove

Protected _setup

  • _setup(): void
  • Creates additional elements as necessary for the Component to function. Called during anchor() if the Component's element has not been created yet. Override in subclasses to provide additional functionality.

    Returns void

Protected _sizeFromOffer

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

add

  • add(component: Component, row: number, col: number)
  • Adds a Component in the specified row and column position.

    For example, instead of calling new Table([[a, b], [null, c]]), you could call var table = new Plottable.Components.Table(); table.add(a, 0, 0); table.add(b, 0, 1); table.add(c, 1, 1);

    Parameters

    • component: Component

      The Component to be added.

    • row: number
    • col: number

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.

columnPadding

  • columnPadding(): number
  • columnPadding(columnPadding: number)
  • Gets the padding to the left and right of each column in pixels.

    Returns number

  • Sets the padding to the left and right of each column in pixels.

    Parameters

    • columnPadding: number

columnWeight

  • columnWeight(index: number): number
  • columnWeight(index: number, weight: number)
  • Gets the weight of the specified column.

    Parameters

    • index: number

    Returns number

  • Sets the weight of the specified column. Space is allocated to columns based on their weight. Columns with higher weights receive proportionally more space.

    Please see rowWeight docs for an example.

    Parameters

    • index: number
    • weight: number

componentAt

  • componentAt(rowIndex: number, columnIndex: number): Component
  • Returns the Component at the specified row and column index.

    Parameters

    • rowIndex: number
    • columnIndex: number

    Returns Component

    The Component at the specified position, or null if no Component is there.

computeLayout

  • computeLayout(origin?: Point, availableWidth?: number, 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().

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>

has

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

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.

remove

removeClass

  • removeClass(cssClass: string)

render

  • render()

renderImmediately

  • renderImmediately()

renderTo

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

requestedSpace

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

rowPadding

  • rowPadding(): number
  • rowPadding(rowPadding: number)
  • Gets the padding above and below each row in pixels.

    Returns number

  • Sets the padding above and below each row in pixels.

    Parameters

    • rowPadding: number

rowWeight

  • rowWeight(index: number): number
  • rowWeight(index: number, weight: number)
  • Gets the weight of the specified row.

    Parameters

    • index: number

    Returns number

  • Sets the weight of the specified row. Space is allocated to rows based on their weight. Rows with higher weights receive proportionally more space.

    A common case would be to have one row take up 2/3rds of the space, and the other row take up 1/3rd.

    Example:

    plot = new Plottable.Component.Table([
     [row1],
     [row2]
    ]);
    
    // assign twice as much space to the first row
    plot
     .rowWeight(0, 2)
     .rowWeight(1, 1)
    

    Parameters

    • index: number
    • weight: number

width

  • width(): number

xAlignment

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

yAlignment

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

Static Private _calcComponentWeights

  • _calcComponentWeights(setWeights: any, componentGroups: any, fixityAccessor: any): any
  • Parameters

    • setWeights: any
    • componentGroups: any
    • fixityAccessor: any

    Returns any

Static Private _calcProportionalSpace

  • _calcProportionalSpace(weights: any, freeSpace: any): any

Static Private _fixedSpace

  • _fixedSpace(componentGroup: any, fixityAccessor: any): any
  • Parameters

    • componentGroup: any
    • fixityAccessor: any

    Returns any

Generated using TypeDoc