stream-charts
    Preparing search index...

    Interface UseObservableValues<CD, D>

    The values exposed through the useDataObservable react hook

    interface UseObservableValues<CD extends ChartData, D> {
        onSubscribe: (subscription: Subscription) => void;
        onUpdateChartTime?: (time: number) => void;
        onUpdateData?: (seriesName: string, data: D[]) => void;
        seriesObservable?: Observable<CD>;
        shouldSubscribe?: boolean;
        windowingTime?: number;
    }

    Type Parameters

    Index

    Properties

    onSubscribe: (subscription: Subscription) => void

    Callback function that is called when the chart subscribes to the observable

    Type Declaration

      • (subscription: Subscription): void
      • Parameters

        • subscription: Subscription

          The subscription resulting form the subscribe action

        Returns void

    onUpdateChartTime?: (time: number) => void

    todo

    onUpdateData?: (seriesName: string, data: D[]) => void

    Callback function that is called when new data arrives to the chart.

    Type Declaration

      • (seriesName: string, data: D[]): void
      • Parameters

        • seriesName: string

          The name of the series for which new data arrived

        • data: D[]

          The new data that arrived in the windowing tine

        Returns void

    UseChartValues.windowingTime

    seriesObservable?: Observable<CD>

    An observable source for chart data

    shouldSubscribe?: boolean

    When true the chart will subscribe to the observable, or if already subscribed, will remain subscribed. When false the chart will unsubscribe to the observable if subscribed, or will remain unsubscribed if not already subscribed.

    windowingTime?: number

    The windowing time for aggregating chart-data events. Defines the update rate of the chart. For example if chart-data events occur every 1 ms, and the windowing time is set to 10 ms, then events will be aggregated for 10 ms, and then the chart will be updated. In this example, the chart would be updated only once per 10 ms.