Components Interactions Examples Tutorials API FAQ
Options
Menu

Class Component

Hierarchy

Index

Constructors

constructor

Properties

Private _backgroundContainer

_backgroundContainer: any

Protected _boundingBox

_boundingBox: Selection<void>

Private _boxContainer

_boxContainer: any

Private _boxes

_boxes: any

Protected _clipPathEnabled

_clipPathEnabled: boolean

Private _clipPathID

_clipPathID: any

Private _content

_content: any

Private _cssClasses

_cssClasses: any

Private _destroyed

_destroyed: any

Private _element

_element: any

Private _foregroundContainer

_foregroundContainer: any

Private _height

_height: any

Protected _isAnchored

_isAnchored: boolean

Protected _isSetup

_isSetup: boolean

Private _isTopLevelComponent

_isTopLevelComponent: any

Private _onAnchorCallbacks

_onAnchorCallbacks: any

Private _onDetachCallbacks

_onDetachCallbacks: any

Private _origin

_origin: any

Private _parent

_parent: any

Private _resizeHandler

_resizeHandler: any

Private _rootSVG

_rootSVG: any

Private _width

_width: any

Private _xAlignment

_xAlignment: any

Private _yAlignment

_yAlignment: any

Static Private _SAFARI_EVENT_BACKING_CLASS

_SAFARI_EVENT_BACKING_CLASS: any

Static Private _xAlignToProportion

_xAlignToProportion: any

Static Private _yAlignToProportion

_yAlignToProportion: any

Methods

Private _addBox

  • _addBox(className?: any, parentElement?: any): any
  • Parameters

    • Optional className: any
    • Optional parentElement: any

    Returns any

Private _generateClipPath

  • _generateClipPath(): any

Private _scheduleComputeLayout

  • _scheduleComputeLayout(): any

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
  • Parameters

    • availableWidth: number
    • availableHeight: number

    Returns object

    • height: number
    • width: number

Private _updateClipPath

  • _updateClipPath(): any

addClass

  • addClass(cssClass: string)
  • Adds a given CSS class to the Component.

    Parameters

    • cssClass: string

      The CSS class to add.

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.

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
  • Removes a Component from the DOM and disconnects all listeners.

    Returns 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
  • Checks if the Component has a fixed height or if it grows to fill available space. Returns false by default on the base Component class.

    Returns boolean

fixedWidth

  • fixedWidth(): boolean
  • Checks if the Component has a fixed width or if it grows to fill available space. Returns false by default on the base Component class.

    Returns 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>

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

  • Removes a callback that would be called on anchoring the Component to the DOM. The callback is identified by reference equality.

    Parameters

offDetach

  • Removes a callback to be called when the Component is detach()-ed. The callback is identified by reference equality.

    Parameters

onAnchor

  • Adds a callback to be called on anchoring the Component to the DOM. If the Component is already anchored, the callback is called immediately.

    Parameters

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

  • Gets the parent ComponentContainer for this Component.

    Returns ComponentContainer

  • Sets the parent ComponentContainer for this Component. An error will be thrown if the parent does not contain this Component. Adding a Component to a ComponentContainer should be done using the appropriate method on the ComponentContainer.

    Parameters

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)
  • Removes a given CSS class from the Component.

    Parameters

    • cssClass: string

      The CSS class to remove.

render

  • render()

renderImmediately

  • renderImmediately()

renderTo

  • renderTo(element: String | Element | Selection<void>)
  • Renders the Component to a given .

    Parameters

    • element: String | Element | Selection<void>

      A selector-string for the , or a d3 selection containing an .

requestedSpace

  • requestedSpace(availableWidth: number, availableHeight: number): SpaceRequest
  • Given available space in pixels, returns the minimum width and height this Component will need.

    Parameters

    • availableWidth: number
    • availableHeight: number

    Returns SpaceRequest

width

  • width(): number

xAlignment

  • xAlignment(): string
  • xAlignment(xAlignment: string)
  • Gets the x alignment of the Component.

    Returns string

  • Sets the x alignment of the Component.

    Parameters

    • xAlignment: string

      The x alignment of the Component ("left"/"center"/"right").

yAlignment

  • yAlignment(): string
  • yAlignment(yAlignment: string)
  • Gets the y alignment of the Component.

    Returns string

  • Sets the y alignment of the Component.

    Parameters

    • yAlignment: string

      The y alignment of the Component ("top"/"center"/"bottom").

Generated using TypeDoc