stream-charts
    Preparing search index...

    Type Alias UseAxesValues<AR, A>

    The values exposed by the hook

    type UseAxesValues<AR extends BaseAxisRange, A extends BaseAxis> = {
        addAxesRangesUpdateHandler: (
            handlerId: string,
            handler: (updates: Map<string, AR>, plotDim: Dimensions) => void,
        ) => void;
        addXAxis: (axis: A, id: string, range?: AR) => void;
        addYAxis: (axis: A, id: string, range?: AR) => void;
        axesRanges: () => Map<string, AR>;
        axisAssignmentsFor: (seriesName: string) => AxesAssignment;
        axisRangeFor: (axisId: string) => Optional<AR>;
        onUpdateAxesInterval?: (times: Map<string, AxisInterval>) => void;
        removeAxesRangesUpdateHandler: (handlerId: string) => void;
        resetAxesRanges: (axesBounds?: Map<string, AR>) => void;
        resetAxisIntervalFor: (axisId: string, axisBounds?: AxisInterval) => void;
        setAxesRanges: (ranges: Map<string, AR>) => void;
        setAxisAssignments: (assignments: Map<string, AxesAssignment>) => void;
        setAxisIntervalFor: (axisId: string, domain: AxisInterval) => void;
        setAxisRangeFor: (axisId: string, range: AR) => void;
        setOriginalAxisIntervalFor: (axisId: string, range: AxisInterval) => void;
        updateAxisRanges: (domains: Map<string, AR>) => void;
        xAxesState: AxesState<A>;
        yAxesState: AxesState<A>;
    }

    Type Parameters

    • AR extends BaseAxisRange

      The type of the axis range (e.g. ContinuousAxisRange or OrdinalAxisRange)

    • A extends BaseAxis
    Index

    Properties

    addAxesRangesUpdateHandler: (
        handlerId: string,
        handler: (updates: Map<string, AR>, plotDim: Dimensions) => void,
    ) => void

    Adds a handler for when the axes are updated. An axis domain/range could change because of a zoom action, a pan action, or as new data is streamed in.

    Type Declaration

      • (
            handlerId: string,
            handler: (updates: Map<string, AR>, plotDim: Dimensions) => void,
        ): void
      • Parameters

        • handlerId: string

          The unique ID of the handler to register/add

        • handler: (updates: Map<string, AR>, plotDim: Dimensions) => void

          The handler function that accepts a map of updates and a plot dimension

        Returns void

    addXAxis: (axis: A, id: string, range?: AR) => void

    Adds an x-axis to the axes and updates the internal state

    Type Declaration

      • (axis: A, id: string, range?: AR): void
      • Parameters

        • axis: A

          The axis to add

        • id: string

          The ID of the axis to add

        • Optionalrange: AR

          The initial axis range (start, end)

        Returns void

    addYAxis: (axis: A, id: string, range?: AR) => void

    Adds a y-axis to the axes and updates the internal state

    Type Declaration

      • (axis: A, id: string, range?: AR): void
      • Parameters

        • axis: A

          The axis to add

        • id: string

          The ID of the axis to add

        • Optionalrange: AR

          The initial axis range (start, end)

        Returns void

    axesRanges: () => Map<string, AR>

    Retrieves the current axis bounds for the specified axis ID

    Type Declaration

      • (): Map<string, AR>
      • Returns Map<string, AR>

        The current axis bounds as a map(axis_id, (start, end))

    axisAssignmentsFor: (seriesName: string) => AxesAssignment

    Retrieves the axis assigned to the specified series

    Type Declaration

    axisRangeFor: (axisId: string) => Optional<AR>

    Retrieves the current axis range for the specified axis ID

    Type Declaration

      • (axisId: string): Optional<AR>
      • Parameters

        • axisId: string

          The ID of the axis for which to retrieve the range

        Returns Optional<AR>

        The current axis range for the specified axis ID wrapped in a n Optional, or an empty Optional if the axis ID is not found

    onUpdateAxesInterval?: (times: Map<string, AxisInterval>) => void

    Callback when the time range changes.

    Type Declaration

      • (times: Map<string, AxisInterval>): void
      • Parameters

        • times: Map<string, AxisInterval>

          The times (start, end) times for each axis in the plot. The times argument is a map(axis_id -> (start, end)). Where start and end refer to the time-range for the axis.

        Returns void

        void

    removeAxesRangesUpdateHandler: (handlerId: string) => void

    Removes the axis-update handler with the specified ID

    Type Declaration

      • (handlerId: string): void
      • Parameters

        • handlerId: string

          The ID of the handler to remove

        Returns void

    resetAxesRanges: (axesBounds?: Map<string, AR>) => void

    Resets all the axes bound to the original bounds

    Type Declaration

      • (axesBounds?: Map<string, AR>): void
      • Parameters

        • OptionalaxesBounds: Map<string, AR>

          An optional map holds the new bounds for specified axes. The map associates an axis ID with the new bounds.

        Returns void

    resetAxisIntervalFor: (axisId: string, axisBounds?: AxisInterval) => void

    Resets the axis bounds to its original bounds

    Type Declaration

      • (axisId: string, axisBounds?: AxisInterval): void
      • Parameters

        • axisId: string

          The ID of the axis

        • OptionalaxisBounds: AxisInterval

          An optional bounds that resets the original bounds

        Returns void

    setAxesRanges: (ranges: Map<string, AR>) => void

    Sets the axis ranges specified in the input map

    Type Declaration

      • (ranges: Map<string, AR>): void
      • Parameters

        • ranges: Map<string, AR>

          A map holding the axis ID to the axis range

        Returns void

    setAxisAssignments: (assignments: Map<string, AxesAssignment>) => void

    Sets the axis assigned to each series. This should contain all the series used in the chart.

    Type Declaration

    setAxisIntervalFor: (axisId: string, domain: AxisInterval) => void

    Sets the domain (interval) for the specified axis ID to the specified range

    Type Declaration

      • (axisId: string, domain: AxisInterval): void
      • Parameters

        • axisId: string

          The ID of the axis for which to set the range

        • domain: AxisInterval

          The new domain as a [start: number, end: number] tuple

        Returns void

    setAxisRangeFor: (axisId: string, range: AR) => void

    Sets the axis range for the specified axis ID

    Type Declaration

      • (axisId: string, range: AR): void
      • Parameters

        • axisId: string

          The ID of the axis for which to set the range

        • range: AR

          The new axis range

        Returns void

    setOriginalAxisIntervalFor: (axisId: string, range: AxisInterval) => void

    Sets the original axis bounds for the specified axis ID to the specified range

    Type Declaration

      • (axisId: string, range: AxisInterval): void
      • Parameters

        • axisId: string

          The ID of the axis for which to set the range

        • range: AxisInterval

          The new range as a [start, end] tuple

        Returns void

    updateAxisRanges: (domains: Map<string, AR>) => void

    Callback function that is called when the time ranges change. The time ranges could change because of a zoom action, a pan action, or as new data is streamed in.

    Type Declaration

      • (domains: Map<string, AR>): void
      • Parameters

        • domains: Map<string, AR>

          A map(axis_id -> domain) that associates the axis ID with the current time range.

        Returns void

    xAxesState: AxesState<A>

    The x-axes state holds the currently set x-axes, manipulation and accessor functions

    yAxesState: AxesState<A>

    The y-axes state holds the currently set x-axes, manipulation and accessor functions