{"version":3,"file":"nivo-rects.mjs","sources":["../src/constants.ts","../src/hooks.ts","../src/RectNodeHtml.tsx","../src/RoundedRect.tsx","../src/RectNodeSvg.tsx","../src/useRectsTransition.ts","../src/RectNodeWrapper.tsx","../src/RectNodes.tsx","../src/useRectAnchorsTransition.ts","../src/labels/compute.ts","../src/labels/RectLabelHtml.tsx","../src/labels/RectLabels.tsx","../src/labels/RectLabelSvg.tsx"],"sourcesContent":["import { RectTransitionMode } from './types'\n\nexport const RECT_TRANSITION_MODES: readonly RectTransitionMode[] = [\n    'reveal-up',\n    'reveal-right',\n    'reveal-down',\n    'reveal-left',\n    'center',\n    'flow-up',\n    'flow-right',\n    'flow-down',\n    'flow-left',\n]\n","import { createRef, useMemo, useRef } from 'react'\nimport { RectNodeHandle, NodeRefMap } from './types'\n\n/**\n * Create and Syncs nodeRefs.\n */\nexport const useNodeRefs = (nodeIds: readonly string[]) => {\n    const nodeRefs = useRef<NodeRefMap>({})\n\n    useMemo(() => {\n        for (const nodeId of nodeIds) {\n            if (!nodeRefs.current[nodeId]) {\n                nodeRefs.current[nodeId] = createRef<RectNodeHandle>()\n            }\n        }\n\n        // Clean up refs no longer in use\n        const currentIds = new Set(nodeIds)\n        for (const nodeId in nodeRefs.current) {\n            if (!currentIds.has(nodeId)) {\n                delete nodeRefs.current[nodeId]\n            }\n        }\n    }, [nodeIds])\n\n    return nodeRefs\n}\n","import {\n    forwardRef,\n    Ref,\n    useImperativeHandle,\n    useRef,\n    ReactElement,\n    PropsWithChildren,\n} from 'react'\nimport { animated } from '@react-spring/web'\nimport { borderRadiusToCss } from '@nivo/theming'\nimport { NodeWithRectAndColor, RectNodeHandle, RectNodeComponentProps } from './types'\n\nconst InnerRectNodeHtml = <Node extends NodeWithRectAndColor>(\n    {\n        node,\n        style,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        onDoubleClick,\n        onFocus,\n        onBlur,\n        onKeyDown,\n        onWheel,\n        onContextMenu,\n        testId,\n        children,\n    }: PropsWithChildren<RectNodeComponentProps<Node>>,\n    ref: Ref<RectNodeHandle>\n) => {\n    // Expose the focus method to the parent component.\n    const elementRef = useRef<HTMLDivElement>(null)\n    useImperativeHandle(ref, () => ({\n        focus: () => {\n            elementRef.current?.focus()\n        },\n    }))\n\n    const { x, y, color, borderRadius, transform, progress, ...extraStyle } = style\n\n    return (\n        <animated.div\n            ref={elementRef}\n            style={{\n                position: 'absolute',\n                borderStyle: 'solid',\n                boxSizing: 'border-box',\n                left: x,\n                top: y,\n                backgroundColor: style.color,\n                borderRadius: borderRadiusToCss(borderRadius),\n                ...extraStyle,\n            }}\n            onMouseEnter={onMouseEnter}\n            onMouseMove={onMouseMove}\n            onMouseLeave={onMouseLeave}\n            onClick={onClick}\n            onDoubleClick={onDoubleClick}\n            onFocus={onFocus}\n            onBlur={onBlur}\n            onKeyDown={onKeyDown}\n            onWheel={onWheel}\n            onContextMenu={onContextMenu}\n            tabIndex={node.a11y?.isFocusable ? 0 : undefined}\n            role={node.a11y?.role}\n            aria-label={node.a11y?.label}\n            aria-labelledby={node.a11y?.labelledBy}\n            aria-describedby={node.a11y?.describedBy}\n            aria-hidden={node.a11y?.hidden}\n            aria-level={node.a11y?.level}\n            data-testid={testId}\n        >\n            {children}\n        </animated.div>\n    )\n}\n\nexport const RectNodeHtml = forwardRef(InnerRectNodeHtml) as <Node extends NodeWithRectAndColor>(\n    props: RectNodeComponentProps<Node> & { ref?: Ref<RectNodeHandle> }\n) => ReactElement\n","import { forwardRef, ComponentProps } from 'react'\nimport { animated, to, SpringValue, Interpolation } from '@react-spring/web'\nimport { normalizeBorderRadius, constrainBorderRadius, BorderRadius } from '@nivo/theming'\n\ntype AnimatedPathProps = ComponentProps<typeof animated.path>\n\n/**\n * Draws either an arc to (toX,toY) of radius r, or a straight line if radius===0\n */\nconst corner = (radius: number, toX: number, toY: number): string => {\n    return radius > 0 ? `A${radius},${radius} 0 0 1 ${toX},${toY}` : `L${toX},${toY}`\n}\n\n/**\n * Helper to construct an SVG path for a rectangle with per-corner radii.\n * Radii are first constrained to avoid drawing artifacts when large.\n */\nexport function buildRoundedRectPath(\n    x: number,\n    y: number,\n    width: number,\n    height: number,\n    topLeft: number,\n    topRight: number,\n    bottomRight: number,\n    bottomLeft: number\n): string {\n    const {\n        topLeft: topLeftConstrained,\n        topRight: topRightConstrained,\n        bottomRight: bottomRightConstrained,\n        bottomLeft: bottomLeftConstrained,\n    } = constrainBorderRadius({ topLeft, topRight, bottomRight, bottomLeft }, width, height)\n\n    return [\n        `M${x + topLeftConstrained},${y}`,\n        `H${x + width - topRightConstrained}`,\n        corner(topRightConstrained, x + width, y + topRightConstrained),\n        `V${y + height - bottomRightConstrained}`,\n        corner(bottomRightConstrained, x + width - bottomRightConstrained, y + height),\n        `H${x + bottomLeftConstrained}`,\n        corner(bottomLeftConstrained, x, y + height - bottomLeftConstrained),\n        `V${y + topLeftConstrained}`,\n        corner(topLeftConstrained, x + topLeftConstrained, y),\n        'Z',\n    ].join(' ')\n}\n\ntype AnimatedValue = number | SpringValue<number> | Interpolation<number, number>\n\n/**\n * Use spring values or numbers for geometry,\n * and any animated-compatible SVG path prop (e.g., opacity).\n */\nexport interface RoundedRectProps extends Omit<AnimatedPathProps, 'd' | 'r' | 'ref'> {\n    width: AnimatedValue\n    height: AnimatedValue\n    x?: AnimatedValue\n    y?: AnimatedValue\n    r?: BorderRadius<AnimatedValue>\n}\n\n/**\n * SVGRect only supports rx and ry for corner radii, this component allows for individual corner radii.\n */\nexport const RoundedRect = forwardRef<SVGPathElement, RoundedRectProps>(\n    (\n        {\n            x = 0,\n            y = 0,\n            width,\n            height,\n            // Not fond of abbreviating, but since SVGRect uses rx/ry, we'll follow suit.\n            r = 0,\n            ...svgProps\n        },\n        ref\n    ) => {\n        const { topLeft, topRight, bottomRight, bottomLeft } =\n            normalizeBorderRadius<AnimatedValue>(r)\n\n        const d = to(\n            [x, y, width, height, topLeft, topRight, bottomRight, bottomLeft],\n            (xx, yy, w, h, topLeft, topRight, bottomRight, bottomLeft) =>\n                buildRoundedRectPath(xx, yy, w, h, topLeft, topRight, bottomRight, bottomLeft)\n        )\n\n        return <animated.path ref={ref} d={d} {...svgProps} />\n    }\n)\n","import { forwardRef, Ref, useImperativeHandle, useRef, ReactElement } from 'react'\nimport { NodeWithRectAndColor, RectNodeComponentProps, RectNodeHandle } from './types'\nimport { RoundedRect } from './RoundedRect'\n\nconst InnerRectNodeSvg = <Node extends NodeWithRectAndColor>(\n    {\n        node,\n        style,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        onDoubleClick,\n        onFocus,\n        onBlur,\n        onKeyDown,\n        onWheel,\n        onContextMenu,\n        testId,\n    }: RectNodeComponentProps<Node>,\n    ref: Ref<RectNodeHandle>\n) => {\n    // Expose the focus method to the parent component.\n    const elementRef = useRef<SVGRectElement>(null)\n    useImperativeHandle(ref, () => ({\n        focus: () => {\n            elementRef.current?.focus()\n        },\n    }))\n\n    return (\n        <RoundedRect\n            ref={elementRef}\n            width={style.width}\n            height={style.height}\n            transform={style.transform}\n            r={style.borderRadius}\n            opacity={style.opacity}\n            fill={node.fill || style.color}\n            stroke={style.borderColor}\n            strokeWidth={style.borderWidth}\n            onMouseEnter={onMouseEnter}\n            onMouseMove={onMouseMove}\n            onMouseLeave={onMouseLeave}\n            onClick={onClick}\n            onDoubleClick={onDoubleClick}\n            onFocus={onFocus}\n            onBlur={onBlur}\n            onKeyDown={onKeyDown}\n            onWheel={onWheel}\n            onContextMenu={onContextMenu}\n            tabIndex={node.a11y?.isFocusable ? 0 : undefined}\n            role={node.a11y?.role}\n            aria-label={node.a11y?.label}\n            aria-labelledby={node.a11y?.labelledBy}\n            aria-describedby={node.a11y?.describedBy}\n            aria-hidden={node.a11y?.hidden}\n            aria-level={node.a11y?.level}\n            data-testid={testId}\n        />\n    )\n}\n\nexport const RectNodeSvg = forwardRef(InnerRectNodeSvg) as <Node extends NodeWithRectAndColor>(\n    props: RectNodeComponentProps<Node> & { ref?: Ref<RectNodeHandle> }\n) => ReactElement\n","import { useMemo } from 'react'\nimport { useMotionConfig } from '@nivo/core'\nimport { TransitionFn, useTransition } from '@react-spring/web'\nimport { Rect, NodeWithRect, RectTransitionMode } from './types'\n\nexport interface RectTransitionModeConfig {\n    enter: (rect: Rect) => Rect\n    update: (rect: Rect) => Rect\n    leave: (rect: Rect) => Rect\n}\n\nconst transitionDefault = (rect: Rect) => rect\n\nexport const rectTransitionModeById: Record<RectTransitionMode, RectTransitionModeConfig> = {\n    'reveal-up': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            y: rect.y + rect.height,\n            height: 0,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            height: 0,\n        }),\n    },\n    'reveal-right': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            width: 0,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width,\n            width: 0,\n        }),\n    },\n    'reveal-down': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            height: 0,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            y: rect.y + rect.height,\n            height: 0,\n        }),\n    },\n    'reveal-left': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width,\n            width: 0,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            width: 0,\n        }),\n    },\n    center: {\n        enter: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width / 2,\n            y: rect.y + rect.height / 2,\n            width: 0,\n            height: 0,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width / 2,\n            y: rect.y + rect.height / 2,\n            width: 0,\n            height: 0,\n        }),\n    },\n    'flow-down': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            y: rect.y - rect.height,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            y: rect.y + rect.height,\n        }),\n    },\n    'flow-right': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            x: rect.x - rect.width,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width,\n        }),\n    },\n    'flow-up': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            y: rect.y + rect.height,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            y: rect.y - rect.height,\n        }),\n    },\n    'flow-left': {\n        enter: (rect: Rect) => ({\n            ...rect,\n            x: rect.x + rect.width,\n        }),\n        update: transitionDefault,\n        leave: (rect: Rect) => ({\n            ...rect,\n            x: rect.x - rect.width,\n        }),\n    },\n}\n\n// TransitionExtra is used to add extra animated properties to the rectangles,\n// for example, you could use it to animate the color of the rect\nexport interface RectTransitionExtra<\n    Node extends NodeWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n> {\n    enter: (node: Node) => ExtraProps\n    update: (node: Node) => ExtraProps\n    leave: (node: Node) => ExtraProps\n}\n\nexport type RectTransitionProps<ExtraProps extends Record<string, any> = Record<string, never>> =\n    Rect & {\n        progress: number\n    } & ExtraProps\n\nexport const useRectTransitionMode = <\n    Node extends NodeWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n>(\n    mode: RectTransitionMode,\n    extraTransition?: RectTransitionExtra<Node, ExtraProps>\n) =>\n    useMemo(() => {\n        const transitionMode = rectTransitionModeById[mode]\n\n        return {\n            enter: (node: Node) =>\n                ({\n                    progress: 0,\n                    ...transitionMode.enter(node.rect),\n                    ...(extraTransition ? extraTransition.enter(node) : {}),\n                }) as RectTransitionProps<ExtraProps>,\n            update: (node: Node) =>\n                ({\n                    progress: 1,\n                    ...transitionMode.update(node.rect),\n                    ...(extraTransition ? extraTransition.update(node) : {}),\n                }) as RectTransitionProps<ExtraProps>,\n            leave: (node: Node) =>\n                ({\n                    progress: 0,\n                    ...transitionMode.leave(node.rect),\n                    ...(extraTransition ? extraTransition.leave(node) : {}),\n                }) as RectTransitionProps<ExtraProps>,\n        }\n    }, [mode, extraTransition])\n\n/**\n * This hook can be used to animate a group of rectangles.\n */\nexport const useRectsTransition = <\n    Node extends NodeWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n>(\n    nodes: readonly Node[],\n    getUid: (node: Node) => string,\n    mode: RectTransitionMode = 'flow-down',\n    animateOnMount = false,\n    extra?: RectTransitionExtra<Node, ExtraProps>\n) => {\n    const { animate, config: springConfig } = useMotionConfig()\n\n    const phases = useRectTransitionMode<Node, ExtraProps>(mode, extra)\n\n    return useTransition<Node, RectTransitionProps<ExtraProps>>(nodes, {\n        keys: getUid,\n        initial: animate && animateOnMount ? phases.enter : null,\n        from: phases.enter,\n        enter: phases.update,\n        update: phases.update,\n        leave: phases.leave,\n        config: springConfig,\n        immediate: !animate,\n    }) as unknown as TransitionFn<Node, RectTransitionProps<ExtraProps>>\n}\n","import {\n    useMemo,\n    MouseEvent,\n    FocusEvent,\n    WheelEvent,\n    KeyboardEvent,\n    Ref,\n    forwardRef,\n    ReactElement,\n} from 'react'\nimport { SpringValue, Interpolation } from '@react-spring/web'\nimport { BorderRadiusCorners } from '@nivo/theming'\nimport {\n    NodeWithRectAndColor,\n    RectNodeComponent,\n    NodeInteractionHandlers,\n    RectNodeComponentProps,\n    RectNodeHandle,\n} from './types'\n\nexport interface RectNodeWrapperProps<Node extends NodeWithRectAndColor>\n    extends NodeInteractionHandlers<Node> {\n    nodeComponent: RectNodeComponent<Node>\n    node: Node\n    style: {\n        progress: SpringValue<number>\n        x: SpringValue<number>\n        y: SpringValue<number>\n        transform: Interpolation<string, string>\n        width: Interpolation<number, number>\n        height: Interpolation<number, number>\n        color: SpringValue<string>\n        opacity: SpringValue<number>\n        borderRadius: BorderRadiusCorners\n        borderWidth: number\n        borderColor: SpringValue<string>\n    }\n    isInteractive: boolean\n    testId?: string\n}\n\n/**\n * This component acts as a wrapper for a `Rect` component.\n *\n * It is used to bind mouse events to ease the process of\n * creating custom rectangles without having to re-implement\n * the same logic in the custom component.\n *\n * This is used to create both SVG and HTML implementations\n * of some charts.\n */\nconst InnerRectNodeWrapper = <Node extends NodeWithRectAndColor>(\n    {\n        nodeComponent: Node,\n        node,\n        style,\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        onDoubleClick,\n        onFocus,\n        onBlur,\n        onKeyDown,\n        onWheel,\n        onContextMenu,\n        testId,\n    }: RectNodeWrapperProps<Node>,\n    ref: Ref<RectNodeHandle>\n) => {\n    const eventHandlers = useMemo(() => {\n        const handlers: Pick<RectNodeComponentProps<Node>, keyof NodeInteractionHandlers<Node>> = {}\n        if (!isInteractive) return handlers\n\n        if (onMouseEnter) {\n            handlers.onMouseEnter = (event: MouseEvent) => {\n                onMouseEnter(node, event)\n            }\n        }\n        if (onMouseMove) {\n            handlers.onMouseMove = (event: MouseEvent) => {\n                onMouseMove(node, event)\n            }\n        }\n        if (onMouseLeave) {\n            handlers.onMouseLeave = (event: MouseEvent) => {\n                onMouseLeave(node, event)\n            }\n        }\n        if (onClick) {\n            handlers.onClick = (event: MouseEvent) => {\n                onClick(node, event)\n            }\n        }\n        if (onDoubleClick) {\n            handlers.onDoubleClick = (event: MouseEvent) => {\n                onDoubleClick(node, event)\n            }\n        }\n        if (onFocus) {\n            handlers.onFocus = (event: FocusEvent) => {\n                onFocus(node, event)\n            }\n        }\n        if (onBlur) {\n            handlers.onBlur = (event: FocusEvent) => {\n                onBlur(node, event)\n            }\n        }\n        if (onKeyDown) {\n            handlers.onKeyDown = (event: KeyboardEvent) => {\n                onKeyDown(node, event)\n            }\n        }\n        if (onContextMenu) {\n            handlers.onContextMenu = (event: MouseEvent) => {\n                onContextMenu(node, event)\n            }\n        }\n        if (onWheel) {\n            handlers.onWheel = (event: WheelEvent) => {\n                onWheel(node, event)\n            }\n        }\n\n        return handlers\n    }, [\n        isInteractive,\n        node,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        onDoubleClick,\n        onFocus,\n        onBlur,\n        onKeyDown,\n        onContextMenu,\n        onWheel,\n    ])\n\n    return (\n        <Node\n            ref={ref}\n            node={node}\n            style={style}\n            isInteractive={isInteractive}\n            {...eventHandlers}\n            testId={testId}\n        />\n    )\n}\n\nexport const RectNodeWrapper = forwardRef(InnerRectNodeWrapper) as <\n    Node extends NodeWithRectAndColor,\n>(\n    props: RectNodeWrapperProps<Node> & { ref?: Ref<RectNodeHandle> }\n) => ReactElement\n","import { useCallback, RefObject, MutableRefObject } from 'react'\nimport { to } from '@react-spring/web'\nimport { PropertyAccessor, usePropertyAccessor } from '@nivo/core'\nimport { InheritedColorConfig, useInheritedColor } from '@nivo/colors'\nimport { useTheme, BorderRadius, normalizeBorderRadius } from '@nivo/theming'\nimport {\n    NodeWithRectAndColor,\n    RectTransitionMode,\n    RectNodeComponent,\n    NodeInteractionHandlers,\n    RectNodeHandle,\n} from './types'\nimport { useRectsTransition } from './useRectsTransition'\nimport { RectNodeWrapper } from './RectNodeWrapper'\n\nexport interface RectNodesProps<Node extends NodeWithRectAndColor>\n    extends NodeInteractionHandlers<Node> {\n    nodes: readonly Node[]\n    uid: PropertyAccessor<Node, string>\n    borderRadius?: BorderRadius\n    borderColor: InheritedColorConfig<Node>\n    borderWidth?: number\n    isInteractive: boolean\n    transitionMode?: RectTransitionMode\n    animateOnMount?: boolean\n    component: RectNodeComponent<Node>\n    isFocusable?: boolean\n    getTestId?: (node: Node) => string\n    nodeRefs?: MutableRefObject<Record<string, RefObject<RectNodeHandle>>>\n}\n\nexport const RectNodes = <Node extends NodeWithRectAndColor>({\n    nodes,\n    uid,\n    component,\n    borderRadius = 0,\n    borderWidth = 0,\n    borderColor,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onClick,\n    onDoubleClick,\n    onFocus,\n    onBlur,\n    onKeyDown,\n    onWheel,\n    onContextMenu,\n    transitionMode = 'flow-down',\n    animateOnMount = false,\n    getTestId,\n    nodeRefs,\n}: RectNodesProps<Node>) => {\n    const getUid = usePropertyAccessor(uid)\n    const theme = useTheme()\n    const getBorderColor = useInheritedColor<Node>(borderColor, theme)\n\n    const extractColors = useCallback(\n        (node: Node) => ({\n            color: node.color,\n            borderColor: getBorderColor(node),\n        }),\n        [getBorderColor]\n    )\n\n    const transition = useRectsTransition<\n        Node,\n        {\n            color: string\n            borderColor: string\n        }\n    >(nodes, getUid, transitionMode, animateOnMount, {\n        enter: extractColors,\n        update: extractColors,\n        leave: extractColors,\n    })\n\n    return (\n        <>\n            {transition((transitionProps, node) => (\n                <RectNodeWrapper<Node>\n                    ref={nodeRefs?.current[getUid(node)]}\n                    key={node.id}\n                    node={node}\n                    style={{\n                        ...transitionProps,\n                        width: transitionProps.width.to(v => Math.max(v, 0)),\n                        height: transitionProps.height.to(v => Math.max(v, 0)),\n                        transform: to(\n                            [transitionProps.x, transitionProps.y],\n                            (x, y) => `translate(${x},${y})`\n                        ),\n                        opacity: transitionProps.progress,\n                        borderRadius: normalizeBorderRadius(borderRadius),\n                        borderWidth,\n                    }}\n                    isInteractive={isInteractive}\n                    onMouseEnter={onMouseEnter}\n                    onMouseMove={onMouseMove}\n                    onMouseLeave={onMouseLeave}\n                    onClick={onClick}\n                    onDoubleClick={onDoubleClick}\n                    onFocus={onFocus}\n                    onBlur={onBlur}\n                    onKeyDown={onKeyDown}\n                    onContextMenu={onContextMenu}\n                    onWheel={onWheel}\n                    testId={getTestId?.(node)}\n                    nodeComponent={component}\n                />\n            ))}\n        </>\n    )\n}\n","import { useMemo } from 'react'\nimport { useMotionConfig } from '@nivo/core'\nimport { TransitionFn, useTransition } from '@react-spring/web'\nimport { RectTransitionMode, Anchor, AnchorWithRect } from './types'\n\nexport interface RectAnchorTransitionModeConfig {\n    enter: (anchor: AnchorWithRect) => Anchor\n    update: (anchor: AnchorWithRect) => Anchor\n    leave: (anchor: AnchorWithRect) => Anchor\n}\n\nconst transitionDefault = (anchor: AnchorWithRect): Anchor => ({\n    x: anchor.x,\n    y: anchor.y,\n})\n\nexport const rectAnchorTransitionModeById: Record<\n    RectTransitionMode,\n    RectAnchorTransitionModeConfig\n> = {\n    'reveal-up': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.rect.y + anchor.rect.height,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.rect.y,\n        }),\n    },\n    'reveal-right': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.rect.x,\n            y: anchor.y,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.rect.x + anchor.rect.width,\n            y: anchor.y,\n        }),\n    },\n    'reveal-down': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.rect.y,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.rect.y + anchor.rect.height,\n        }),\n    },\n    'reveal-left': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.rect.x + anchor.rect.width,\n            y: anchor.y,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.rect.x,\n            y: anchor.y,\n        }),\n    },\n    center: {\n        enter: transitionDefault,\n        update: transitionDefault,\n        leave: transitionDefault,\n    },\n    'flow-down': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.y - anchor.rect.height,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.y + anchor.rect.height,\n        }),\n    },\n    'flow-right': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x - anchor.rect.width,\n            y: anchor.y,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x + anchor.rect.width,\n            y: anchor.y,\n        }),\n    },\n    'flow-up': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.y + anchor.rect.height,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x,\n            y: anchor.y - anchor.rect.height,\n        }),\n    },\n    'flow-left': {\n        enter: (anchor: AnchorWithRect) => ({\n            x: anchor.x + anchor.rect.width,\n            y: anchor.y,\n        }),\n        update: transitionDefault,\n        leave: (anchor: AnchorWithRect) => ({\n            x: anchor.x - anchor.rect.width,\n            y: anchor.y,\n        }),\n    },\n}\n\n// TransitionExtra is used to add extra animated properties to the anchors,\n// for example, you could use it to animate a color.\nexport interface ReactAnchorTransitionExtra<\n    Node extends AnchorWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n> {\n    enter: (node: Node) => ExtraProps\n    update: (node: Node) => ExtraProps\n    leave: (node: Node) => ExtraProps\n}\n\nexport type RectAnchorTransitionProps<\n    ExtraProps extends Record<string, any> = Record<string, never>,\n> = Anchor & {\n    progress: number\n} & ExtraProps\n\nexport const useRectAnchorTransitionMode = <\n    Node extends AnchorWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n>(\n    mode: RectTransitionMode,\n    extraTransition?: ReactAnchorTransitionExtra<Node, ExtraProps>\n) =>\n    useMemo(() => {\n        const transitionMode = rectAnchorTransitionModeById[mode]\n\n        return {\n            enter: (node: Node) =>\n                ({\n                    progress: 0,\n                    ...transitionMode.enter(node),\n                    ...(extraTransition ? extraTransition.enter(node) : {}),\n                }) as RectAnchorTransitionProps<ExtraProps>,\n            update: (node: Node) =>\n                ({\n                    progress: 1,\n                    ...transitionMode.update(node),\n                    ...(extraTransition ? extraTransition.update(node) : {}),\n                }) as RectAnchorTransitionProps<ExtraProps>,\n            leave: (node: Node) =>\n                ({\n                    progress: 0,\n                    ...transitionMode.leave(node),\n                    ...(extraTransition ? extraTransition.leave(node) : {}),\n                }) as RectAnchorTransitionProps<ExtraProps>,\n        }\n    }, [mode, extraTransition])\n\nconst getId = (anchor: AnchorWithRect) => anchor.id\n\nexport const useRectAnchorsTransition = <\n    Node extends AnchorWithRect,\n    ExtraProps extends Record<string, any> = Record<string, never>,\n>(\n    nodes: Node[],\n    mode: RectTransitionMode = 'flow-down',\n    extra?: ReactAnchorTransitionExtra<Node, ExtraProps>\n) => {\n    const { animate, config: springConfig } = useMotionConfig()\n\n    const phases = useRectAnchorTransitionMode<Node, ExtraProps>(mode, extra)\n\n    return useTransition<Node, RectAnchorTransitionProps<ExtraProps>>(nodes, {\n        keys: getId,\n        initial: phases.update,\n        from: phases.enter,\n        enter: phases.update,\n        update: phases.update,\n        leave: phases.leave,\n        config: springConfig,\n        immediate: !animate,\n    }) as unknown as TransitionFn<Node, RectAnchorTransitionProps<ExtraProps>>\n}\n","import { BoxAnchor } from '@nivo/core'\nimport { getTextAlignFromBoxAnchor, getTextBaselineFromBoxAnchor } from '@nivo/text'\nimport { Rect } from '../types'\nimport { RectLabelsProps } from './types'\n\nexport type AnchorGetter = (rect: Rect) => { x: number; y: number }\nexport interface AnchorGetterOptions {\n    isOutside: boolean\n    paddingX: number\n    paddingY: number\n    offsetX: number\n    offsetY: number\n}\ntype AnchorGetterFactory = (options: AnchorGetterOptions) => AnchorGetter\n\nexport const anchorCenterFactory: AnchorGetterFactory = () => (rect: Rect) => ({\n    x: rect.x + rect.width / 2,\n    y: rect.y + rect.height / 2,\n})\nexport const anchorTopLeftFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + (isOutside ? -paddingX : paddingX) + offsetX,\n        y: rect.y + (isOutside ? -paddingY : paddingY) + offsetY,\n    })\nexport const anchorTopFactory: AnchorGetterFactory =\n    ({ isOutside, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + rect.width / 2 + offsetX,\n        y: rect.y + (isOutside ? -paddingY : paddingY) + offsetY,\n    })\nexport const anchorTopRightFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + rect.width + (isOutside ? paddingX : -paddingX) + offsetX,\n        y: rect.y + (isOutside ? -paddingY : paddingY) + offsetY,\n    })\nexport const anchorRightFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + rect.width + (isOutside ? paddingX : -paddingX) + offsetX,\n        y: rect.y + rect.height / 2 + offsetY,\n    })\nexport const anchorBottomRightFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + rect.width + (isOutside ? paddingX : -paddingX) + offsetX,\n        y: rect.y + rect.height + (isOutside ? paddingY : -paddingY) + offsetY,\n    })\nexport const anchorBottomFactory: AnchorGetterFactory =\n    ({ isOutside, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + rect.width / 2 + offsetX,\n        y: rect.y + rect.height + (isOutside ? paddingY : -paddingY) + offsetY,\n    })\nexport const anchorBottomLeftFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, paddingY, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + (isOutside ? -paddingX : paddingX) + offsetX,\n        y: rect.y + rect.height + (isOutside ? paddingY : -paddingY) + offsetY,\n    })\nexport const anchorLeftFactory: AnchorGetterFactory =\n    ({ isOutside, paddingX, offsetX, offsetY }) =>\n    (rect: Rect) => ({\n        x: rect.x + (isOutside ? -paddingX : paddingX) + offsetX,\n        y: rect.y + rect.height / 2 + offsetY,\n    })\n\nconst anchorFactoriesMap: Record<BoxAnchor, AnchorGetterFactory> = {\n    center: anchorCenterFactory,\n    'top-left': anchorTopLeftFactory,\n    top: anchorTopFactory,\n    'top-right': anchorTopRightFactory,\n    right: anchorRightFactory,\n    'bottom-right': anchorBottomRightFactory,\n    bottom: anchorBottomFactory,\n    'bottom-left': anchorBottomLeftFactory,\n    left: anchorLeftFactory,\n}\n\nexport const anchorGetter = (anchor: BoxAnchor, options: AnchorGetterOptions) =>\n    anchorFactoriesMap[anchor](options)\n\nexport const getTextLayout = (\n    boxAnchor: BoxAnchor,\n    isOutside: boolean,\n    align: RectLabelsProps<any>['labelAlign'],\n    baseline: RectLabelsProps<any>['labelBaseline']\n) => ({\n    align: align === 'auto' ? getTextAlignFromBoxAnchor(boxAnchor, isOutside) : align,\n    baseline: baseline === 'auto' ? getTextBaselineFromBoxAnchor(boxAnchor, isOutside) : baseline,\n})\n","import { animated } from '@react-spring/web'\nimport { useTheme, sanitizeHtmlTextStyle, TextAlign, TextBaseline } from '@nivo/theming'\nimport { NodeWithRectAndColor } from '../types'\nimport { RectLabelProps } from './types'\n\nconst getTranslation = (align: TextAlign, baseline: TextBaseline) => {\n    const translateX = align === 'start' ? '0%' : align === 'center' ? '-50%' : '-100%'\n    const translateY = baseline === 'top' ? '0%' : baseline === 'center' ? '-50%' : '-100%'\n\n    return `translate(${translateX}, ${translateY})`\n}\n\nexport const RectLabelHtml = <Node extends NodeWithRectAndColor>({\n    label,\n    color,\n    style,\n    testId,\n}: RectLabelProps<Node>) => {\n    const theme = useTheme()\n\n    return (\n        <animated.span\n            style={{\n                ...sanitizeHtmlTextStyle(theme.labels.text),\n                position: 'absolute',\n                display: 'inline-block',\n                whiteSpace: 'nowrap',\n                color,\n                left: style.x,\n                top: style.y,\n                transform: style.rotation.to(\n                    rotation =>\n                        `rotate(${rotation}deg) ${getTranslation(style.align, style.baseline)}`\n                ),\n                transformOrigin: '0 0',\n                pointerEvents: 'none',\n                lineHeight: '1em',\n                opacity: style.progress,\n            }}\n            data-testid={testId}\n        >\n            {label}\n        </animated.span>\n    )\n}\n","import { createElement, useMemo } from 'react'\nimport { usePropertyAccessor } from '@nivo/core'\nimport { useInheritedColor } from '@nivo/colors'\nimport { useTheme } from '@nivo/theming'\nimport { NodeWithRectAndColor, RectTransitionMode } from '../types'\nimport { useRectAnchorsTransition } from '../useRectAnchorsTransition'\nimport {\n    RectLabelsProps as PublicRectLabelProps,\n    RectComputedLabel,\n    RectLabelComponent,\n} from './types'\nimport { anchorGetter, getTextLayout } from './compute'\n\ninterface RectLabelsProps<Node extends NodeWithRectAndColor> {\n    nodes: readonly Node[]\n    uid: PublicRectLabelProps<Node>['uid']\n    label: PublicRectLabelProps<Node>['label']\n    boxAnchor: PublicRectLabelProps<Node>['labelBoxAnchor']\n    isOutside?: PublicRectLabelProps<Node>['labelIsOutside']\n    align?: PublicRectLabelProps<Node>['labelAlign']\n    baseline?: PublicRectLabelProps<Node>['labelBaseline']\n    paddingX?: PublicRectLabelProps<Node>['labelPaddingX']\n    paddingY?: PublicRectLabelProps<Node>['labelPaddingY']\n    offsetX?: PublicRectLabelProps<Node>['labelOffsetX']\n    offsetY?: PublicRectLabelProps<Node>['labelOffsetY']\n    rotation?: PublicRectLabelProps<Node>['labelRotation']\n    skipWidth?: PublicRectLabelProps<Node>['labelSkipWidth']\n    skipHeight?: PublicRectLabelProps<Node>['labelSkipHeight']\n    textColor: PublicRectLabelProps<Node>['labelTextColor']\n    transitionMode?: RectTransitionMode\n    component: RectLabelComponent<Node>\n    getTestId?: (node: Omit<Node, 'rect'>) => string\n}\n\nconst extractRotation = ({ rotation }: { rotation: number }) => ({ rotation })\n\nexport const RectLabels = <Node extends NodeWithRectAndColor>({\n    nodes,\n    uid,\n    label: labelAccessor,\n    boxAnchor = 'center',\n    isOutside = false,\n    align = 'auto',\n    baseline = 'auto',\n    paddingX = 0,\n    paddingY = 0,\n    offsetX = 0,\n    offsetY = 0,\n    rotation = 0,\n    skipWidth = 0,\n    skipHeight = 0,\n    textColor = { theme: 'labels.text.fill' },\n    transitionMode = 'flow-down',\n    component,\n    getTestId,\n}: RectLabelsProps<Node>) => {\n    const getUid = usePropertyAccessor(uid)\n    const getLabel = usePropertyAccessor(labelAccessor)\n\n    const theme = useTheme()\n    const getTextColor = useInheritedColor(textColor, theme)\n\n    const textLayout = useMemo(\n        () => getTextLayout(boxAnchor, isOutside, align, baseline),\n        [boxAnchor, isOutside, align, baseline]\n    )\n\n    const computedLabels = useMemo(() => {\n        const getAnchor = anchorGetter(boxAnchor, {\n            isOutside,\n            paddingX,\n            paddingY,\n            offsetX,\n            offsetY,\n        })\n\n        return (\n            nodes\n                .filter(node => {\n                    return node.rect.width >= skipWidth && node.rect.height >= skipHeight\n                })\n                // We lift the rect from the node, for easier access.\n                .map(({ rect, ...node }) => {\n                    return {\n                        id: getUid(node),\n                        label: getLabel(node),\n                        color: getTextColor(node),\n                        ...getAnchor(rect),\n                        rotation,\n                        rect,\n                        node,\n                    }\n                }) as RectComputedLabel<Node>[]\n        )\n    }, [\n        nodes,\n        getUid,\n        paddingX,\n        paddingY,\n        offsetX,\n        offsetY,\n        skipWidth,\n        skipHeight,\n        getLabel,\n        boxAnchor,\n        isOutside,\n        rotation,\n        getTextColor,\n    ])\n\n    const transition = useRectAnchorsTransition<RectComputedLabel<Node>, { rotation: number }>(\n        computedLabels,\n        transitionMode,\n        {\n            enter: extractRotation,\n            update: extractRotation,\n            leave: extractRotation,\n        }\n    )\n\n    return (\n        <>\n            {transition((transitionProps, label) => {\n                return createElement(component, {\n                    key: label.id,\n                    ...label,\n                    style: {\n                        ...transitionProps,\n                        align: textLayout.align,\n                        baseline: textLayout.baseline,\n                    },\n                    testId: getTestId?.(label.node),\n                })\n            })}\n        </>\n    )\n}\n","import { to } from '@react-spring/web'\nimport { useTheme, svgStyleAttributesMapping } from '@nivo/theming'\nimport { Text } from '@nivo/text'\nimport { NodeWithRectAndColor } from '../types'\nimport { RectLabelProps } from './types'\n\nexport const RectLabelSvg = <Node extends NodeWithRectAndColor>({\n    label,\n    color,\n    style,\n    testId,\n}: RectLabelProps<Node>) => {\n    const theme = useTheme()\n\n    return (\n        <Text\n            textAnchor={svgStyleAttributesMapping.textAlign[style.align]}\n            dominantBaseline={svgStyleAttributesMapping.textBaseline[style.baseline]}\n            transform={to(\n                [style.x, style.y, style.rotation],\n                (x, y, rotation) => `translate(${x},${y}) rotate(${rotation})`\n            )}\n            style={{\n                ...theme.labels.text,\n                fill: color,\n                opacity: style.progress,\n                pointerEvents: 'none',\n            }}\n            data-testid={testId}\n        >\n            {label}\n        </Text>\n    )\n}\n"],"names":["RECT_TRANSITION_MODES","useNodeRefs","nodeIds","nodeRefs","useRef","useMemo","_step","_iterator","_createForOfIteratorHelperLoose","done","nodeId","value","current","createRef","currentIds","Set","has","RectNodeHtml","forwardRef","_ref","ref","_node$a11y","_node$a11y2","_node$a11y3","_node$a11y4","_node$a11y5","_node$a11y6","_node$a11y7","node","style","onMouseEnter","onMouseMove","onMouseLeave","onClick","onDoubleClick","onFocus","onBlur","onKeyDown","onWheel","onContextMenu","testId","children","elementRef","useImperativeHandle","focus","_elementRef$current","x","y","color","borderRadius","transform","progress","extraStyle","_objectWithoutPropertiesLoose","_excluded","_jsx","animated","div","_extends","position","borderStyle","boxSizing","left","top","backgroundColor","borderRadiusToCss","tabIndex","a11y","isFocusable","undefined","role","label","labelledBy","describedBy","hidden","level","corner","radius","toX","toY","buildRoundedRectPath","width","height","topLeft","topRight","bottomRight","bottomLeft","_constrainBorderRadiu","constrainBorderRadius","topLeftConstrained","topRightConstrained","bottomRightConstrained","bottomLeftConstrained","join","RoundedRect","_ref$x","_ref$y","_ref$r","r","svgProps","_normalizeBorderRadiu","normalizeBorderRadius","d","to","xx","yy","w","h","path","RectNodeSvg","opacity","fill","stroke","borderColor","strokeWidth","borderWidth","transitionDefault","rect","rectTransitionModeById","enter","update","leave","center","useRectTransitionMode","mode","extraTransition","transitionMode","useRectsTransition","nodes","getUid","animateOnMount","extra","_useMotionConfig","useMotionConfig","animate","springConfig","config","phases","useTransition","keys","initial","from","immediate","RectNodeWrapper","Node","nodeComponent","isInteractive","eventHandlers","handlers","event","RectNodes","uid","component","_ref$borderRadius","_ref$borderWidth","_ref$transitionMode","_ref$animateOnMount","getTestId","usePropertyAccessor","theme","useTheme","getBorderColor","useInheritedColor","extractColors","useCallback","transition","_Fragment","transitionProps","v","Math","max","id","anchor","rectAnchorTransitionModeById","useRectAnchorTransitionMode","getId","useRectAnchorsTransition","anchorCenterFactory","anchorTopLeftFactory","isOutside","paddingX","paddingY","offsetX","offsetY","anchorTopFactory","_ref2","anchorTopRightFactory","_ref3","anchorRightFactory","_ref4","anchorBottomRightFactory","_ref5","anchorBottomFactory","_ref6","anchorBottomLeftFactory","_ref7","anchorLeftFactory","_ref8","anchorFactoriesMap","right","bottom","anchorGetter","options","getTextLayout","boxAnchor","align","baseline","getTextAlignFromBoxAnchor","getTextBaselineFromBoxAnchor","RectLabelHtml","span","sanitizeHtmlTextStyle","labels","text","display","whiteSpace","rotation","getTranslation","translateX","transformOrigin","pointerEvents","lineHeight","extractRotation","RectLabels","labelAccessor","_ref2$boxAnchor","_ref2$isOutside","_ref2$align","_ref2$baseline","_ref2$paddingX","_ref2$paddingY","_ref2$offsetX","_ref2$offsetY","_ref2$rotation","_ref2$skipWidth","skipWidth","_ref2$skipHeight","skipHeight","_ref2$textColor","textColor","_ref2$transitionMode","getLabel","getTextColor","textLayout","computedLabels","getAnchor","filter","map","createElement","key","RectLabelSvg","Text","textAnchor","svgStyleAttributesMapping","textAlign","dominantBaseline","textBaseline"],"mappings":"gpBAEO,IAAMA,EAAuD,CAChE,YACA,eACA,cACA,cACA,SACA,UACA,aACA,YACA,0pCCLSC,EAAc,SAACC,GACxB,IAAMC,EAAWC,EAAmB,CAAA,GAkBpC,OAhBAC,GAAQ,WACJ,IAAA,IAA4BC,EAA5BC,EAAAC,EAAqBN,KAAOI,EAAAC,KAAAE,MAAE,CAAA,IAAnBC,EAAMJ,EAAAK,MACRR,EAASS,QAAQF,KAClBP,EAASS,QAAQF,GAAUG,IAEnC,CAGA,IAAMC,EAAa,IAAIC,IAAIb,GAC3B,IAAK,IAAMQ,KAAUP,EAASS,QACrBE,EAAWE,IAAIN,WACTP,EAASS,QAAQF,EAGpC,GAAG,CAACR,IAEGC,CACX,4DCoDac,EAAeC,GAlEF,SAAHC,EAiBnBC,GACC,IAAA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