Components Interactions Examples Tutorials API FAQ
Options
Menu

Module DOM

Index

Variables

SCREEN_REFRESH_RATE_MILLISECONDS

SCREEN_REFRESH_RATE_MILLISECONDS: number

Screen refresh rate which is assumed to be 60fps

Functions

boundingSVG

  • boundingSVG(element: SVGElement): SVGElement
  • Retrieves the bounding svg of the input element

    Parameters

    • element: SVGElement

      The element to query

    Returns SVGElement

    The bounding svg

clientRectInside

  • clientRectInside(innerClientRect: ClientRect, outerClientRect: ClientRect): boolean
  • Returns true if and only if innerClientRect is inside outerClientRect.

    Parameters

    • innerClientRect: ClientRect

      The first ClientRect

    • outerClientRect: ClientRect

      The second ClientRect

    Returns boolean

    If and only if the innerClientRect is inside outerClientRect.

clientRectsOverlap

  • clientRectsOverlap(clientRectA: ClientRect, clientRectB: ClientRect): boolean
  • Checks if the first ClientRect overlaps the second.

    Parameters

    • clientRectA: ClientRect

      The first ClientRect

    • clientRectB: ClientRect

      The second ClientRect

    Returns boolean

    If the ClientRects overlap each other.

elementBBox

  • elementBBox(element: Selection<any>): SVGRect
  • Gets the bounding box of an element.

    Parameters

    Returns SVGRect

    The bounding box.

elementHeight

  • elementHeight(element: Element): number
  • Calculates the height of the element. The height includes the padding the and the border on the element's top and bottom sides.

    Parameters

    • element: Element

      The element to query

    Returns number

    The height of the element

elementWidth

  • elementWidth(element: Element): number
  • Calculates the width of the element. The width includes the padding and the border on the element's left and right sides.

    Parameters

    • element: Element

      The element to query

    Returns number

    The width of the element.

generateUniqueClipPathId

  • generateUniqueClipPathId(): string
  • Generates a ClipPath ID that is unique for this instance of Plottable

    Returns string

intersectsBBox

  • intersectsBBox(xValOrRange: number | Range, yValOrRange: number | Range, bbox: SVGRect, tolerance?: number): boolean
  • Returns true if the supplied coordinates or Ranges intersect or are contained by bbox.

    Parameters

    • xValOrRange: number | Range

      The x coordinate or Range to test

    • yValOrRange: number | Range

      The y coordinate or Range to test

    • bbox: SVGRect

      The bbox

    • Optional tolerance: number

      Amount by which to expand bbox, in each dimension, before testing intersection

    Returns boolean

    True if the supplied coordinates or Ranges intersect or are contained by bbox, false otherwise.

requestAnimationFramePolyfill

  • requestAnimationFramePolyfill(callback: function): void
  • Polyfill for window.requestAnimationFrame. If the function exists, then we use the function directly. Otherwise, we set a timeout on SCREEN_REFRESH_RATE_MILLISECONDS and then perform the function.

    Parameters

    • callback: function

      The callback to call in the next animation frame

        • (): void
        • Returns void

    Returns void

translate

  • Retrieves the number array representing the translation for the selection

    Parameters

    • selection: Selection<any>

      The selection to query

    Returns [number, number]

    The number array representing the translation

  • Translates the given selection by the input x / y pixel amounts.

    Parameters

    • selection: Selection<any>

      The selection to translate

    • x: number

      The amount to translate in the x direction

    • y: number

      The amount to translate in the y direction

    Returns Selection<any>

    The input selection

Generated using TypeDoc