Components Interactions Examples Tutorials API FAQ
Options
Menu

Interface TransformableScale

This interface abstracts the necessary API for implementing pan/zoom on various types of scales.

Due to some limitations of d3, for example category scales can't invert screen space coordinates, we nevertheless allow the scale types to support pan/zoom if they implement this interface. See Category's _d3TransformationScale for more info.

Hierarchy

  • TransformableScale

Implemented by

Index

Methods

getTransformationDomain

  • getTransformationDomain(): [number, number]
  • Returns the current transformed domain of the scale. This must be a numerical range in the same coordinate space used for scaleTransformation.

    Returns [number, number]

invertedTransformation

  • invertedTransformation(value: number): number
  • Returns value in Transformation Space for the provided screen space.

    Parameters

    • value: number

    Returns number

pan

  • pan(translateAmount: number): void
  • Translates the scale by a number of pixels.

    Parameters

    • translateAmount: number

    Returns void

scaleTransformation

  • scaleTransformation(value: number): number
  • Returns value in screen space for the given domain value.

    Parameters

    • value: number

    Returns number

zoom

  • zoom(magnifyAmount: number, centerValue: number): void
  • Apply the magnification with the floating point magnifyAmount centered at the centerValue coordinate.

    Parameters

    • magnifyAmount: number
    • centerValue: number

    Returns void

Generated using TypeDoc