stream-charts
    Preparing search index...

    Type Alias UseMouseValues<D, TM>

    Type representing the values exposed through the useMouse react hook.

    type UseMouseValues<D, TM> = {
        mouseLeaveHandlerFor: (
            handlerId: string,
            providerId?: string,
        ) => ((seriesName: string, providerId?: string) => void) | undefined;
        mouseOverHandlerFor: (
            handlerId: string,
            providerId?: string,
        ) =>
            | (
                (
                    seriesName: string,
                    time: number,
                    tooltipData: TooltipData<D, TM>,
                    mouseCoords: [x: number, y: number],
                    providerId?: string,
                ) => void
            )
            | undefined;
        registerMouseLeaveHandler: (
            handlerId: string,
            handler: (seriesName: string) => void,
        ) => string;
        registerMouseOverHandler: (
            handlerId: string,
            handler: (
                seriesName: string,
                time: number,
                tooltipData: TooltipData<D, TM>,
                mouseCoords: [x: number, y: number],
            ) => void,
        ) => string;
        unregisterMouseLeaveHandler: (handlerId: string) => void;
        unregisterMouseOverHandler: (handlerId: string) => void;
    }

    Type Parameters

    • D

      The type of the data object for the series

    • TM

      The type of the metadata object for the series

    Index

    Properties

    mouseLeaveHandlerFor: (
        handlerId: string,
        providerId?: string,
    ) => ((seriesName: string, providerId?: string) => void) | undefined

    Attempts to retrieve the mouse-leave-series handler for the specified ID

    Type Declaration

      • (
            handlerId: string,
            providerId?: string,
        ): ((seriesName: string, providerId?: string) => void) | undefined
      • Parameters

        • handlerId: string

          The ID of the handler

        • OptionalproviderId: string

        Returns ((seriesName: string, providerId?: string) => void) | undefined

        The mouse-leave-series handler for the ID, or undefined if not found

    mouseOverHandlerFor: (
        handlerId: string,
        providerId?: string,
    ) =>
        | (
            (
                seriesName: string,
                time: number,
                tooltipData: TooltipData<D, TM>,
                mouseCoords: [x: number, y: number],
                providerId?: string,
            ) => void
        )
        | undefined

    Attempts to retrieve the mouse-over-series handler for the specified ID

    Type Declaration

      • (
            handlerId: string,
            providerId?: string,
        ):
            | (
                (
                    seriesName: string,
                    time: number,
                    tooltipData: TooltipData<D, TM>,
                    mouseCoords: [x: number, y: number],
                    providerId?: string,
                ) => void
            )
            | undefined
      • Parameters

        • handlerId: string

          The ID of the handler

        • OptionalproviderId: string

        Returns
            | (
                (
                    seriesName: string,
                    time: number,
                    tooltipData: TooltipData<D, TM>,
                    mouseCoords: [x: number, y: number],
                    providerId?: string,
                ) => void
            )
            | undefined

        The mouse-over-series handler for the ID, or undefined if not found

    registerMouseLeaveHandler: (
        handlerId: string,
        handler: (seriesName: string) => void,
    ) => string

    Adds a mouse-leave-series handler with the specified ID and handler function

    Type Declaration

      • (handlerId: string, handler: (seriesName: string) => void): string
      • Parameters

        • handlerId: string

          The handler ID

        • handler: (seriesName: string) => void

          The handler function called when a mouse-leave-series event occurs

        Returns string

        The handler ID

    registerMouseOverHandler: (
        handlerId: string,
        handler: (
            seriesName: string,
            time: number,
            tooltipData: TooltipData<D, TM>,
            mouseCoords: [x: number, y: number],
        ) => void,
    ) => string

    Adds a mouse-over-series handler with the specified ID and handler function

    Type Declaration

      • (
            handlerId: string,
            handler: (
                seriesName: string,
                time: number,
                tooltipData: TooltipData<D, TM>,
                mouseCoords: [x: number, y: number],
            ) => void,
        ): string
      • Parameters

        • handlerId: string

          The handler ID

        • handler: (
              seriesName: string,
              time: number,
              tooltipData: TooltipData<D, TM>,
              mouseCoords: [x: number, y: number],
          ) => void

          The handler function called when a mouse-over-series event occurs. The handler function is handed the series name, the time (x-value), the actual series, and the mouse coordinates over which the mouse has moved over.

        Returns string

        The handler ID.

    unregisterMouseLeaveHandler: (handlerId: string) => void

    Removes the mouse-leave-series handler with the specified ID

    Type Declaration

      • (handlerId: string): void
      • Parameters

        • handlerId: string

          The ID of the handler to remove

        Returns void

    unregisterMouseOverHandler: (handlerId: string) => void

    Removes the mouse-over-series handler with the specified ID

    Type Declaration

      • (handlerId: string): void
      • Parameters

        • handlerId: string

          The ID of the handler to remove

        Returns void