stream-charts
    Preparing search index...

    An immutable ordinal-axis range that holds the current range and the original (no zoom) range. Create an instance using the OrdinalAxisRange.from factory method.

    Hierarchy (View Summary)

    Index

    Properties

    current: AxisInterval
    original: AxisInterval

    Accessors

    • get currentDistance(): number

      Returns the current distance between the start and end of the range.

      Returns number

    • get originalDistance(): number

      Returns the original (e.g. before any zooming or panning) distance between the start and end of the range.

      Returns number

    • get scaleFactor(): number

      The ratio between the current and original distance.

      Returns number

    Methods

    • Scales the axis-range by the specified scale factor from the specified value, while keeping the range within the constraints (start, end). The equations are written so that the zooming (scaling) occurs at the specified value, and expands/contracts equally from that value.

      Parameters

      • factor: number

        The scale factor

      • value: number

        The value from which to scale the interval

      • constraint: [min: number, max: number]

        The minimum and maximum values that range bounds can be

      Returns OrdinalAxisRange

      A new continuous-axis range with updated values

    • Determines whether the specified (start, end) interval matches the original interval

      Parameters

      • start: number

        The start of the interval

      • end: number

        The end of the interval

      Returns boolean

      true if the specified interval matches the original interval; false otherwise

    • Scales the axis-range by the specified scale factor from the specified value. The equations are written so that the zooming (scaling) occurs at the specified value, and expands/contracts equally from that value. This operation does not modify the original range.

      Parameters

      • factor: number

        The scale factor

      • value: number

        The value from which to scale the interval

      Returns OrdinalAxisRange

      A new continuous-axis range with updated values

    • Assumes that the original ranges start at 0 and end at the width or height of the plot. Calculates the new range based on the change in dimensions and the previous range. And calculates the new original range based on the change in the dimensions.

      Parameters

      • beforeDimension: number

        The width or height before the change in dimensions

      • afterDimension: number

        The width or height after the change in dimensions

      Returns OrdinalAxisRange

      An updated OrdinalAxisRange that has been zoomed based on the change in the dimensions.

    • Factory function for creating a new ordinal-axis range instance.

      Parameters

      • start: number

        The start of the axis-range.

      • end: number

        The end of the axis-range.

      • OptionaloriginalStart: number = start

        The optional original start of the axis-range (e.g. before any zooming or panning. Defaults to the start value if not specified.)

      • OptionaloriginalEnd: number = end

        The optional original end of the axis-range (e.g. before any zooming or panning. Defaults to the end value if not specified.)

      Returns OrdinalAxisRange

      A new continuous-axis range instance.