{"version":3,"file":"nivo-tooltip.mjs","sources":["../src/TooltipWrapper.tsx","../src/Chip.tsx","../src/BasicTooltip.tsx","../src/TableTooltip.tsx","../src/CrosshairLine.tsx","../src/Crosshair.tsx","../src/context.ts","../src/hooks.ts","../src/Tooltip.tsx","../src/TooltipProvider.tsx"],"sourcesContent":["import { memo, useRef, PropsWithChildren, CSSProperties } from 'react'\nimport { useSpring, animated } from '@react-spring/web'\nimport { useMotionConfig, useMeasure } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { TooltipStateContextDataVisible } from './context'\n\nconst TOOLTIP_OFFSET = 14\n\nconst tooltipStyle: Partial<CSSProperties> = {\n    pointerEvents: 'none',\n    position: 'absolute',\n    zIndex: 10,\n    top: 0,\n    left: 0,\n}\n\nconst translate = (x: number, y: number) => `translate(${x}px, ${y}px)`\n\ninterface TooltipWrapperProps {\n    position: TooltipStateContextDataVisible['position']\n    anchor: TooltipStateContextDataVisible['anchor']\n}\n\nexport const TooltipWrapper = memo<PropsWithChildren<TooltipWrapperProps>>(\n    ({ position, anchor, children }) => {\n        const theme = useTheme()\n        const { animate, config: springConfig } = useMotionConfig()\n        const [measureRef, bounds] = useMeasure()\n        const previousPosition = useRef<[number, number] | false>(false)\n\n        let to = undefined\n        let immediate = false\n        const hasDimension = bounds.width > 0 && bounds.height > 0\n\n        let x = Math.round(position[0])\n        let y = Math.round(position[1])\n\n        if (hasDimension) {\n            if (anchor === 'top') {\n                x -= bounds.width / 2\n                y -= bounds.height + TOOLTIP_OFFSET\n            } else if (anchor === 'right') {\n                x += TOOLTIP_OFFSET\n                y -= bounds.height / 2\n            } else if (anchor === 'bottom') {\n                x -= bounds.width / 2\n                y += TOOLTIP_OFFSET\n            } else if (anchor === 'left') {\n                x -= bounds.width + TOOLTIP_OFFSET\n                y -= bounds.height / 2\n            } else if (anchor === 'center') {\n                x -= bounds.width / 2\n                y -= bounds.height / 2\n            }\n\n            to = {\n                transform: translate(x, y),\n            }\n\n            if (!previousPosition.current) {\n                immediate = true\n            }\n\n            previousPosition.current = [x, y]\n        }\n\n        const animatedProps = useSpring<{\n            transform: string\n        }>({\n            to,\n            config: springConfig,\n            immediate: !animate || immediate,\n        })\n\n        const { basic, chip, container, table, tableCell, tableCellValue, ...defaultStyle } =\n            theme.tooltip\n\n        const style = {\n            ...tooltipStyle,\n            ...defaultStyle,\n            transform: animatedProps.transform ?? translate(x, y),\n            opacity: animatedProps.transform ? 1 : 0,\n        }\n\n        return (\n            <animated.div ref={measureRef} style={style}>\n                {children}\n            </animated.div>\n        )\n    }\n)\n\nTooltipWrapper.displayName = 'TooltipWrapper'\n","import { CSSProperties, memo } from 'react'\n\ninterface ChipProps {\n    size?: number\n    color: string\n    style?: CSSProperties\n}\n\nexport const Chip = memo<ChipProps>(({ size = 12, color, style = {} }) => (\n    <span style={{ display: 'block', width: size, height: size, background: color, ...style }} />\n))\n","import { memo, ReactNode } from 'react'\nimport { ValueFormat, useValueFormatter } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { Chip } from './Chip'\n\nexport interface BasicTooltipProps {\n    id: ReactNode\n    value?: number | string | Date\n    format?: ValueFormat<number | string | Date>\n    color?: string\n    enableChip?: boolean\n    /**\n     * @deprecated This should be replaced by custom tooltip components.\n     */\n    renderContent?: () => JSX.Element\n}\n\nexport const BasicTooltip = memo<BasicTooltipProps>(\n    ({ id, value: _value, format, enableChip = false, color, renderContent }) => {\n        const theme = useTheme()\n        const formatValue = useValueFormatter<number | string | Date>(format)\n\n        let content: JSX.Element\n        if (typeof renderContent === 'function') {\n            content = renderContent()\n        } else {\n            let value = _value\n            if (formatValue !== undefined && value !== undefined) {\n                value = formatValue(value)\n            }\n            content = (\n                <div style={theme.tooltip.basic}>\n                    {enableChip && <Chip color={color!} style={theme.tooltip.chip} />}\n                    {value !== undefined ? (\n                        <span>\n                            {id}: <strong>{`${value}`}</strong>\n                        </span>\n                    ) : (\n                        id\n                    )}\n                </div>\n            )\n        }\n\n        return (\n            <div style={theme.tooltip.container} role=\"tooltip\">\n                {content}\n            </div>\n        )\n    }\n)\n","import { CSSProperties, memo, ReactNode } from 'react'\nimport { useTheme } from '@nivo/theming'\n\nconst tableStyle = {\n    width: '100%',\n    borderCollapse: 'collapse' as CSSProperties['borderCollapse'],\n}\n\ninterface TableTooltipProps {\n    title?: ReactNode\n    renderContent?: () => JSX.Element\n    rows?: ReactNode[][]\n}\n\nexport const TableTooltip = memo(({ title, rows = [], renderContent }: TableTooltipProps) => {\n    const theme = useTheme()\n\n    if (!rows.length) return null\n\n    let content\n    if (typeof renderContent === 'function') {\n        content = renderContent()\n    } else {\n        content = (\n            <div>\n                {title && title}\n                <table style={{ ...tableStyle, ...theme.tooltip.table }}>\n                    <tbody>\n                        {rows.map((row, i) => (\n                            <tr key={i}>\n                                {row.map((column, j) => (\n                                    <td key={j} style={theme.tooltip.tableCell}>\n                                        {column}\n                                    </td>\n                                ))}\n                            </tr>\n                        ))}\n                    </tbody>\n                </table>\n            </div>\n        )\n    }\n\n    return <div style={theme.tooltip.container}>{content}</div>\n})\n\nTableTooltip.displayName = 'TableTooltip'\n","import { CSSProperties, memo, useMemo } from 'react'\nimport { useSpring, animated } from '@react-spring/web'\nimport { useMotionConfig } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\n\ninterface CrosshairLineProps {\n    x0: number\n    x1: number\n    y0: number\n    y1: number\n}\n\nexport const CrosshairLine = memo(({ x0, x1, y0, y1 }: CrosshairLineProps) => {\n    const theme = useTheme()\n    const { animate, config: springConfig } = useMotionConfig()\n    const style = useMemo(\n        () => ({\n            ...theme.crosshair.line,\n            pointerEvents: 'none' as CSSProperties['pointerEvents'],\n        }),\n        [theme.crosshair.line]\n    )\n\n    const animatedProps = useSpring({\n        x1: x0,\n        x2: x1,\n        y1: y0,\n        y2: y1,\n        config: springConfig,\n        immediate: !animate,\n    })\n\n    return <animated.line {...animatedProps} fill=\"none\" style={style} />\n})\n\nCrosshairLine.displayName = 'CrosshairLine'\n","import { memo } from 'react'\nimport { CrosshairLine } from './CrosshairLine'\nimport { CrosshairType } from './types'\n\ninterface CrosshairProps {\n    width: number\n    height: number\n    type: CrosshairType\n    x: number\n    y: number\n}\n\nexport const Crosshair = memo(({ width, height, type, x, y }: CrosshairProps) => {\n    let xLine\n    let yLine\n    if (type === 'cross') {\n        xLine = { x0: x, x1: x, y0: 0, y1: height }\n        yLine = { x0: 0, x1: width, y0: y, y1: y }\n    } else if (type === 'top-left') {\n        xLine = { x0: x, x1: x, y0: 0, y1: y }\n        yLine = { x0: 0, x1: x, y0: y, y1: y }\n    } else if (type === 'top') {\n        xLine = { x0: x, x1: x, y0: 0, y1: y }\n    } else if (type === 'top-right') {\n        xLine = { x0: x, x1: x, y0: 0, y1: y }\n        yLine = { x0: x, x1: width, y0: y, y1: y }\n    } else if (type === 'right') {\n        yLine = { x0: x, x1: width, y0: y, y1: y }\n    } else if (type === 'bottom-right') {\n        xLine = { x0: x, x1: x, y0: y, y1: height }\n        yLine = { x0: x, x1: width, y0: y, y1: y }\n    } else if (type === 'bottom') {\n        xLine = { x0: x, x1: x, y0: y, y1: height }\n    } else if (type === 'bottom-left') {\n        xLine = { x0: x, x1: x, y0: y, y1: height }\n        yLine = { x0: 0, x1: x, y0: y, y1: y }\n    } else if (type === 'left') {\n        yLine = { x0: 0, x1: x, y0: y, y1: y }\n    } else if (type === 'x') {\n        xLine = { x0: x, x1: x, y0: 0, y1: height }\n    } else if (type === 'y') {\n        yLine = { x0: 0, x1: width, y0: y, y1: y }\n    }\n\n    return (\n        <>\n            {xLine && <CrosshairLine x0={xLine.x0} x1={xLine.x1} y0={xLine.y0} y1={xLine.y1} />}\n            {yLine && <CrosshairLine x0={yLine.x0} x1={yLine.x1} y0={yLine.y0} y1={yLine.y1} />}\n        </>\n    )\n})\n\nCrosshair.displayName = 'Crosshair'\n","import { createContext, MouseEvent, TouchEvent } from 'react'\nimport { TooltipAnchor } from './types'\n\nexport interface TooltipActionsContextData {\n    showTooltipAt: (\n        content: JSX.Element,\n        position: [number, number],\n        anchor?: TooltipAnchor\n    ) => void\n    showTooltipFromEvent: (\n        content: JSX.Element,\n        event: MouseEvent | TouchEvent,\n        anchor?: TooltipAnchor\n    ) => void\n    hideTooltip: () => void\n}\n\nconst defaultActions: TooltipActionsContextData = {\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    showTooltipAt: () => {},\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    showTooltipFromEvent: () => {},\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    hideTooltip: () => {},\n}\n\nexport const TooltipActionsContext = createContext<TooltipActionsContextData>(defaultActions)\n\nexport interface TooltipStateContextDataVisible {\n    isVisible: true\n    position: [number, number]\n    content: JSX.Element\n    anchor: TooltipAnchor\n}\n\nexport interface TooltipStateContextDataHidden {\n    isVisible: false\n    position: [null, null]\n    content: null\n    anchor: null\n}\n\nexport type TooltipStateContextData = TooltipStateContextDataVisible | TooltipStateContextDataHidden\n\nexport const hiddenTooltipState: TooltipStateContextDataHidden = {\n    isVisible: false,\n    position: [null, null],\n    content: null,\n    anchor: null,\n}\n\nexport const TooltipStateContext = createContext<TooltipStateContextData>(hiddenTooltipState)\n","import {\n    useState,\n    useContext,\n    useCallback,\n    MutableRefObject,\n    MouseEvent,\n    TouchEvent,\n    useMemo,\n} from 'react'\nimport {\n    TooltipActionsContext,\n    TooltipActionsContextData,\n    TooltipStateContext,\n    TooltipStateContextData,\n    hiddenTooltipState,\n} from './context'\nimport { TooltipAnchor } from './types'\n\nexport const useTooltipHandlers = (container: MutableRefObject<HTMLDivElement>) => {\n    const [state, setState] = useState<TooltipStateContextData>(hiddenTooltipState)\n\n    const showTooltipAt: TooltipActionsContextData['showTooltipAt'] = useCallback(\n        (content: JSX.Element, [x, y]: [number, number], anchor: TooltipAnchor = 'top') => {\n            setState({\n                isVisible: true,\n                position: [x, y],\n                anchor,\n                content,\n            })\n        },\n        [setState]\n    )\n\n    const showTooltipFromEvent: TooltipActionsContextData['showTooltipFromEvent'] = useCallback(\n        (content: JSX.Element, event: MouseEvent | TouchEvent, anchor: TooltipAnchor = 'top') => {\n            const bounds = container.current.getBoundingClientRect()\n            const offsetWidth = container.current.offsetWidth\n            // In a normal situation mouse enter / mouse leave events\n            // capture the position ok. But when the chart is inside a scaled\n            // element with a CSS transform like: `transform: scale(2);`\n            // tooltip are not positioned ok.\n            // Comparing original width `offsetWidth` agains scaled\n            // width give us the scaling factor to calculate\n            // ok mouse position\n            const scaling = offsetWidth === bounds.width ? 1 : offsetWidth / bounds.width\n            const { clientX, clientY } = 'touches' in event ? event.touches[0] : event\n            const x = (clientX - bounds.left) * scaling\n            const y = (clientY - bounds.top) * scaling\n\n            if (anchor === 'left' || anchor === 'right') {\n                if (x < bounds.width / 2) anchor = 'right'\n                else anchor = 'left'\n            }\n\n            setState({\n                isVisible: true,\n                position: [x, y],\n                anchor,\n                content,\n            })\n        },\n        [container, setState]\n    )\n\n    const hideTooltip = useCallback(() => {\n        setState(hiddenTooltipState)\n    }, [setState])\n\n    const actions: TooltipActionsContextData = useMemo(() => {\n        return {\n            showTooltipAt,\n            showTooltipFromEvent,\n            hideTooltip,\n        }\n    }, [showTooltipAt, showTooltipFromEvent, hideTooltip])\n\n    return {\n        actions,\n        state,\n    }\n}\n\nexport const useTooltip = () => {\n    const context = useContext(TooltipActionsContext)\n    if (context === undefined) {\n        throw new Error('useTooltip must be used within a TooltipProvider')\n    }\n\n    return context\n}\n\nexport const useTooltipState = () => {\n    const context = useContext(TooltipStateContext)\n    if (context === undefined) {\n        throw new Error('useTooltipState must be used within a TooltipProvider')\n    }\n\n    return context\n}\n","import { useTooltipState } from './hooks'\nimport { TooltipWrapper } from './TooltipWrapper'\nimport { TooltipStateContextData, TooltipStateContextDataVisible } from './context'\n\nexport const isVisibleTooltipState = (\n    state: TooltipStateContextData\n): state is TooltipStateContextDataVisible => state.isVisible\n\nexport const Tooltip = () => {\n    const state = useTooltipState()\n\n    if (!isVisibleTooltipState(state)) {\n        return null\n    }\n\n    return (\n        <TooltipWrapper position={state.position} anchor={state.anchor}>\n            {state.content}\n        </TooltipWrapper>\n    )\n}\n","import { PropsWithChildren, MutableRefObject } from 'react'\nimport { TooltipActionsContext, TooltipStateContext } from './context'\nimport { useTooltipHandlers } from './hooks'\n\ninterface TooltipProviderProps {\n    container: MutableRefObject<HTMLDivElement>\n}\n\nexport const TooltipProvider = ({\n    container,\n    children,\n}: PropsWithChildren<TooltipProviderProps>) => {\n    const { actions, state } = useTooltipHandlers(container)\n\n    return (\n        <TooltipActionsContext.Provider value={actions}>\n            <TooltipStateContext.Provider value={state}>{children}</TooltipStateContext.Provider>\n        </TooltipActionsContext.Provider>\n    )\n}\n"],"names":["tooltipStyle","pointerEvents","position","zIndex","top","left","translate","x","y","TooltipWrapper","memo","_ref","_animatedProps$transf","anchor","children","theme","useTheme","_useMotionConfig","useMotionConfig","animate","springConfig","config","_useMeasure","useMeasure","measureRef","bounds","previousPosition","useRef","to","undefined","immediate","hasDimension","width","height","Math","round","transform","current","animatedProps","useSpring","_theme$tooltip","tooltip","basic","chip","container","table","tableCell","tableCellValue","defaultStyle","_objectWithoutPropertiesLoose","_excluded","style","_extends","opacity","_jsx","animated","div","ref","displayName","Chip","_ref$size","size","color","_ref$style","display","background","BasicTooltip","content","id","_value","value","format","_ref$enableChip","enableChip","renderContent","formatValue","useValueFormatter","_jsxs","role","tableStyle","borderCollapse","TableTooltip","title","_ref$rows","rows","length","map","row","i","column","j","CrosshairLine","x0","x1","y0","y1","useMemo","crosshair","line","x2","y2","fill","Crosshair","xLine","yLine","type","_Fragment","TooltipActionsContext","createContext","showTooltipAt","showTooltipFromEvent","hideTooltip","hiddenTooltipState","isVisible","TooltipStateContext","useTooltipHandlers","_useState","useState","state","setState","useCallback","event","getBoundingClientRect","offsetWidth","scaling","_ref2","touches","clientX","clientY","actions","useTooltip","context","useContext","Error","useTooltipState","isVisibleTooltipState","Tooltip","TooltipProvider","_useTooltipHandlers","Provider"],"mappings":"ipBAQMA,EAA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