stream-charts
    Preparing search index...

    Function calculateConstrainedZoomFor

    • Called when the user uses the scroll wheel (or scroll gesture) to zoom in or out. Zooms in/out at the location of the mouse when the scroll wheel or gesture was applied, while ensure that the range (start, end) is contained within the constraint (min, max).

      Parameters

      • transform: ZoomTransform

        The d3 zoom transformation information

      • x: number

        The x-position of the mouse when the scroll wheel or gesture is used

      • axis: ContinuousNumericAxis

        The axis being zoomed

      • range: ContinuousAxisRange

        The current range for the axis being zoomed

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

        The minimum and maximum value the scaled range can have

      Returns ZoomResult<ContinuousAxisRange>

      The updated range and the new zoom factor