{"version":3,"file":"nivo-tree.mjs","sources":["../src/hooks.ts","../src/defaults.ts","../src/Node.tsx","../src/Link.tsx","../src/Label.tsx","../src/canvas.ts","../src/Links.tsx","../src/Nodes.tsx","../src/labelsHooks.ts","../src/Labels.tsx","../src/Mesh.tsx","../src/Tree.tsx","../src/ResponsiveTree.tsx","../src/TreeCanvas.tsx","../src/ResponsiveTreeCanvas.tsx"],"sourcesContent":["import { createElement, MouseEvent, useCallback, useMemo, useState } from 'react'\nimport { hierarchy as d3Hierarchy, cluster as d3Cluster, tree as d3Tree } from 'd3-hierarchy'\nimport { scaleLinear, ScaleLinear } from 'd3-scale'\nimport {\n    link as d3Link,\n    CurveFactory,\n    curveLinear,\n    curveBumpX,\n    curveBumpY,\n    curveStep,\n    curveStepBefore,\n    curveStepAfter,\n} from 'd3-shape'\nimport { Margin, usePropertyAccessor } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { TooltipAnchor, TooltipPosition, useTooltip } from '@nivo/tooltip'\nimport { useOrdinalColorScale, useInheritedColor } from '@nivo/colors'\nimport {\n    DefaultDatum,\n    HierarchyTreeNode,\n    HierarchyTreeLink,\n    TreeDataProps,\n    CommonProps,\n    Layout,\n    ComputedNode,\n    ComputedLink,\n    NodeMouseEventHandler,\n    NodeTooltip,\n    IntermediateComputedLink,\n    LinkThicknessFunction,\n    LinkMouseEventHandler,\n    LinkTooltip,\n    IntermediateComputedNode,\n    CurrentNodeSetter,\n    NodeSizeModifierFunction,\n    LinkThicknessModifierFunction,\n    TreeMode,\n    LinkCurve,\n} from './types'\nimport { commonDefaultProps } from './defaults'\n\nexport const useRoot = <Datum>({\n    data,\n    mode,\n    getIdentity,\n}: {\n    data: TreeDataProps<Datum>['data']\n    mode: TreeMode\n    getIdentity: (node: Datum) => string\n}) =>\n    useMemo(() => {\n        const root = d3Hierarchy<Datum>(data) as HierarchyTreeNode<Datum>\n        const cluster = mode === 'tree' ? d3Tree<Datum>() : d3Cluster<Datum>()\n\n        root.eachBefore(node => {\n            const ancestors = node\n                .ancestors()\n                .filter(ancestor => ancestor !== node)\n                .reverse()\n            const ancestorIds = ancestors.map(ancestor => getIdentity(ancestor.data))\n\n            node.ancestorIds = ancestorIds\n            node.uid = [...ancestorIds, getIdentity(node.data)].join('.')\n            node.ancestorUids = ancestors.map(ancestor => ancestor.uid!)\n        })\n\n        root.each(node => {\n            node.descendantUids = node\n                .descendants()\n                .filter(descendant => descendant !== node)\n                .map(descendant => descendant.uid!)\n        })\n\n        cluster(root)\n\n        return root\n    }, [data, mode, getIdentity])\n\n/**\n * By default, the x/y positions are computed for a 0~1 range,\n * so that we can easily change the layout without having to\n * recompute the nodes.\n */\nconst useCartesianScales = ({\n    width,\n    height,\n    layout,\n}: {\n    width: number\n    height: number\n    layout: Layout\n}) =>\n    useMemo(() => {\n        const xScale = scaleLinear().domain([0, 1])\n        const yScale = scaleLinear().domain([0, 1])\n\n        if (layout === 'top-to-bottom') {\n            xScale.range([0, width])\n            yScale.range([0, height])\n        } else if (layout === 'right-to-left') {\n            xScale.range([width, 0])\n            yScale.range([0, height])\n        } else if (layout === 'bottom-to-top') {\n            xScale.range([width, 0])\n            yScale.range([height, 0])\n        } else if (layout === 'left-to-right') {\n            xScale.range([0, width])\n            yScale.range([height, 0])\n        }\n\n        return {\n            xScale,\n            yScale,\n        }\n    }, [width, height, layout])\n\nconst useNodeSize = <Datum>(size: Exclude<CommonProps<Datum>['nodeSize'], undefined>) =>\n    useMemo(() => {\n        if (typeof size === 'function') return size\n        return () => size\n    }, [size])\n\nconst useNodeSizeModifier = <Datum>(size?: NodeSizeModifierFunction<Datum> | number) =>\n    useMemo(() => {\n        if (size === undefined) return (node: ComputedNode<Datum>) => node.size\n        if (typeof size === 'function') return size\n        return () => size\n    }, [size])\n\nconst useNodes = <Datum>({\n    root,\n    xScale,\n    yScale,\n    layout,\n    getIdentity,\n    nodeSize,\n    activeNodeSize,\n    inactiveNodeSize,\n    nodeColor,\n    fixNodeColorAtDepth,\n}: {\n    root: HierarchyTreeNode<Datum>\n    xScale: ScaleLinear<number, number>\n    yScale: ScaleLinear<number, number>\n    layout: Layout\n    getIdentity: (node: Datum) => string\n    nodeSize: Exclude<CommonProps<Datum>['nodeSize'], undefined>\n    activeNodeSize?: CommonProps<Datum>['activeNodeSize']\n    inactiveNodeSize?: CommonProps<Datum>['inactiveNodeSize']\n    nodeColor: Exclude<CommonProps<Datum>['nodeColor'], undefined>\n    fixNodeColorAtDepth: number\n}) => {\n    const intermediateNodes = useMemo<IntermediateComputedNode<Datum>[]>(() => {\n        return root.descendants().map(node => {\n            let x: number\n            let y: number\n            if (layout === 'top-to-bottom' || layout === 'bottom-to-top') {\n                x = xScale(node.x!)\n                y = yScale(node.y!)\n            } else {\n                x = xScale(node.y!)\n                y = yScale(node.x!)\n            }\n\n            const id = getIdentity(node.data)\n\n            return {\n                path: [...node.ancestorIds!, id],\n                uid: node.uid!,\n                isRoot: node.depth === 0,\n                isLeaf: node.height === 0,\n                ancestorIds: node.ancestorIds!,\n                ancestorUids: node.ancestorUids!,\n                descendantUids: node.descendantUids!,\n                id,\n                data: node.data,\n                depth: node.depth,\n                height: node.height,\n                x,\n                y,\n            }\n        })\n    }, [root, getIdentity, layout, xScale, yScale])\n\n    const getNodeSize = useNodeSize<Datum>(nodeSize)\n    const getActiveNodeSize = useNodeSizeModifier<Datum>(activeNodeSize)\n    const getInactiveNodeSize = useNodeSizeModifier<Datum>(inactiveNodeSize)\n\n    const getNodeColorBase = useOrdinalColorScale(nodeColor, 'uid')\n    // Wrap the default color function to support `getNodeColorAtDepth`.\n    const getNodeColor = useMemo(() => {\n        if (fixNodeColorAtDepth === Infinity) return getNodeColorBase\n\n        return (\n            node: IntermediateComputedNode<Datum>,\n            nodeByUid: Record<string, ComputedNode<Datum>>\n        ) => {\n            if (\n                node.depth <= 0 ||\n                node.depth <= fixNodeColorAtDepth ||\n                node.ancestorUids.length === 0\n            )\n                return getNodeColorBase(node)\n\n            const parentUid = node.ancestorUids[node.ancestorUids.length - 1]\n            const parent = nodeByUid[parentUid]\n            if (parent === undefined) return getNodeColorBase(node)\n\n            return parent.color\n        }\n    }, [getNodeColorBase, fixNodeColorAtDepth])\n\n    const [activeNodeUids, setActiveNodeUids] = useState<string[]>([])\n\n    const computed = useMemo(() => {\n        const nodeByUid: Record<string, ComputedNode<Datum>> = {}\n\n        const nodes: ComputedNode<Datum>[] = intermediateNodes.map(intermediateNode => {\n            const computedNode: ComputedNode<Datum> = {\n                ...intermediateNode,\n                size: getNodeSize(intermediateNode),\n                color: getNodeColor(intermediateNode, nodeByUid),\n                isActive: null,\n            }\n\n            if (activeNodeUids.length > 0) {\n                computedNode.isActive = activeNodeUids.includes(computedNode.uid)\n                if (computedNode.isActive) {\n                    computedNode.size = getActiveNodeSize(computedNode)\n                } else {\n                    computedNode.size = getInactiveNodeSize(computedNode)\n                }\n            }\n\n            nodeByUid[computedNode.uid] = computedNode\n\n            return computedNode\n        })\n\n        return { nodes, nodeByUid }\n    }, [\n        intermediateNodes,\n        getNodeSize,\n        getActiveNodeSize,\n        getInactiveNodeSize,\n        getNodeColor,\n        activeNodeUids,\n    ])\n\n    return { ...computed, activeNodeUids, setActiveNodeUids }\n}\n\nconst useLinkThicknessModifier = <Datum>(\n    thickness?: LinkThicknessModifierFunction<Datum> | number\n) =>\n    useMemo(() => {\n        if (thickness === undefined) return (link: ComputedLink<Datum>) => link.thickness\n        if (typeof thickness === 'function') return thickness\n        return () => thickness\n    }, [thickness])\n\nconst useLinks = <Datum>({\n    root,\n    nodeByUid,\n    activeNodeUids,\n    linkThickness,\n    activeLinkThickness,\n    inactiveLinkThickness,\n    linkColor,\n}: {\n    root: HierarchyTreeNode<Datum>\n    nodeByUid: Record<string, ComputedNode<Datum>>\n    activeNodeUids: readonly string[]\n    linkThickness: Exclude<CommonProps<Datum>['linkThickness'], undefined>\n    activeLinkThickness?: CommonProps<Datum>['activeLinkThickness']\n    inactiveLinkThickness?: CommonProps<Datum>['inactiveLinkThickness']\n    linkColor: Exclude<CommonProps<Datum>['linkColor'], undefined>\n}) => {\n    const intermediateLinks = useMemo<IntermediateComputedLink<Datum>[]>(() => {\n        return (root.links() as HierarchyTreeLink<Datum>[]).map(link => {\n            return {\n                id: `${link.source.uid}:${link.target.uid}`,\n                // Replace with computed nodes.\n                source: nodeByUid[link.source.uid!],\n                target: nodeByUid[link.target.uid!],\n            }\n        })\n    }, [root, nodeByUid])\n\n    const getLinkThickness: LinkThicknessFunction<Datum> = useMemo(() => {\n        if (typeof linkThickness === 'function') return linkThickness\n        return () => linkThickness\n    }, [linkThickness])\n    const getActiveLinkThickness = useLinkThicknessModifier(activeLinkThickness)\n    const getInactiveLinkThickness = useLinkThicknessModifier(inactiveLinkThickness)\n\n    const theme = useTheme()\n    const getLinkColor = useInheritedColor(linkColor, theme)\n\n    const [activeLinkIds, setActiveLinkIds] = useState<string[]>([])\n\n    const links = useMemo(() => {\n        return intermediateLinks.map(intermediateLink => {\n            const computedLink: ComputedLink<Datum> = {\n                ...intermediateLink,\n                thickness: getLinkThickness(intermediateLink),\n                color: getLinkColor(intermediateLink),\n                isActive: null,\n            }\n\n            if (activeNodeUids.length > 0) {\n                computedLink.isActive = activeLinkIds.includes(computedLink.id)\n                if (computedLink.isActive) {\n                    computedLink.thickness = getActiveLinkThickness(computedLink)\n                } else {\n                    computedLink.thickness = getInactiveLinkThickness(computedLink)\n                }\n            }\n\n            return computedLink\n        })\n    }, [\n        intermediateLinks,\n        getLinkThickness,\n        getActiveLinkThickness,\n        getInactiveLinkThickness,\n        getLinkColor,\n        activeNodeUids.length,\n        activeLinkIds,\n    ])\n\n    return {\n        links,\n        setActiveLinkIds,\n    }\n}\n\nconst useLinkGenerator = ({ layout, curve }: { layout: Layout; curve: LinkCurve }) =>\n    useMemo(() => {\n        let curveFactory: CurveFactory = curveLinear\n\n        if (curve === 'bump') {\n            if (layout === 'top-to-bottom' || layout === 'bottom-to-top') {\n                curveFactory = curveBumpY\n            } else {\n                curveFactory = curveBumpX\n            }\n        } else if (curve === 'step') {\n            curveFactory = curveStep\n        } else if (curve === 'step-before') {\n            curveFactory = curveStepBefore\n        } else if (curve === 'step-after') {\n            curveFactory = curveStepAfter\n        }\n\n        return d3Link(curveFactory)\n    }, [layout, curve])\n\nconst useSetCurrentNode = <Datum>({\n    setActiveNodeUids,\n    highlightAncestorNodes,\n    highlightDescendantNodes,\n    links,\n    setActiveLinkIds,\n    highlightAncestorLinks,\n    highlightDescendantLinks,\n}: {\n    setActiveNodeUids: (uids: string[]) => void\n    highlightAncestorNodes: boolean\n    highlightDescendantNodes: boolean\n    links: readonly ComputedLink<Datum>[]\n    setActiveLinkIds: (ids: string[]) => void\n    highlightAncestorLinks: boolean\n    highlightDescendantLinks: boolean\n}) =>\n    useCallback(\n        (node: ComputedNode<Datum> | null) => {\n            if (node === null) {\n                setActiveNodeUids([])\n                setActiveLinkIds([])\n            } else {\n                let nodeUids: string[] = [node.uid]\n                if (highlightAncestorNodes) {\n                    nodeUids = [...nodeUids, ...node.ancestorUids]\n                }\n                if (highlightDescendantNodes) {\n                    nodeUids = [...nodeUids, ...node.descendantUids]\n                }\n                setActiveNodeUids(nodeUids)\n\n                const linkIds: string[] = []\n                if (highlightAncestorLinks) {\n                    links\n                        .filter(link => {\n                            return (\n                                link.target.uid === node.uid ||\n                                node.ancestorUids.includes(link.target.uid)\n                            )\n                        })\n                        .forEach(link => {\n                            linkIds.push(link.id)\n                        })\n                }\n                if (highlightDescendantLinks) {\n                    links\n                        .filter(link => {\n                            return (\n                                link.source.uid === node.uid ||\n                                node.descendantUids.includes(link.source.uid)\n                            )\n                        })\n                        .forEach(link => {\n                            linkIds.push(link.id)\n                        })\n                }\n                setActiveLinkIds(linkIds)\n            }\n        },\n        [\n            setActiveNodeUids,\n            highlightAncestorNodes,\n            highlightDescendantNodes,\n            links,\n            setActiveLinkIds,\n            highlightAncestorLinks,\n            highlightDescendantLinks,\n        ]\n    )\n\nexport const useTree = <Datum = DefaultDatum>({\n    data,\n    width,\n    height,\n    identity = commonDefaultProps.identity,\n    mode = commonDefaultProps.mode,\n    layout = commonDefaultProps.layout,\n    nodeSize = commonDefaultProps.nodeSize,\n    activeNodeSize,\n    inactiveNodeSize,\n    nodeColor = commonDefaultProps.nodeColor,\n    fixNodeColorAtDepth = commonDefaultProps.fixNodeColorAtDepth,\n    highlightAncestorNodes = commonDefaultProps.highlightAncestorNodes,\n    highlightDescendantNodes = commonDefaultProps.highlightDescendantNodes,\n    linkCurve = commonDefaultProps.linkCurve,\n    linkThickness = commonDefaultProps.linkThickness,\n    linkColor = commonDefaultProps.linkColor,\n    activeLinkThickness,\n    inactiveLinkThickness,\n    highlightAncestorLinks = commonDefaultProps.highlightAncestorLinks,\n    highlightDescendantLinks = commonDefaultProps.highlightDescendantLinks,\n}: {\n    data: TreeDataProps<Datum>['data']\n    width: number\n    height: number\n    identity?: CommonProps<Datum>['identity']\n    mode?: TreeMode\n    layout?: Layout\n    nodeSize?: CommonProps<Datum>['nodeSize']\n    activeNodeSize?: CommonProps<Datum>['activeNodeSize']\n    inactiveNodeSize?: CommonProps<Datum>['inactiveNodeSize']\n    nodeColor?: CommonProps<Datum>['nodeColor']\n    fixNodeColorAtDepth?: number\n    highlightAncestorNodes?: boolean\n    highlightDescendantNodes?: boolean\n    linkCurve?: LinkCurve\n    linkThickness?: CommonProps<Datum>['linkThickness']\n    activeLinkThickness?: CommonProps<Datum>['activeLinkThickness']\n    inactiveLinkThickness?: CommonProps<Datum>['inactiveLinkThickness']\n    linkColor?: CommonProps<Datum>['linkColor']\n    highlightAncestorLinks?: boolean\n    highlightDescendantLinks?: boolean\n}) => {\n    const getIdentity = usePropertyAccessor(identity)\n    const root = useRoot<Datum>({ data, mode, getIdentity })\n\n    const { xScale, yScale } = useCartesianScales({ width, height, layout })\n    const { nodes, nodeByUid, activeNodeUids, setActiveNodeUids } = useNodes<Datum>({\n        root,\n        xScale,\n        yScale,\n        layout,\n        getIdentity,\n        nodeSize,\n        activeNodeSize,\n        inactiveNodeSize,\n        nodeColor,\n        fixNodeColorAtDepth,\n    })\n\n    const linkGenerator = useLinkGenerator({ layout, curve: linkCurve })\n    const { links, setActiveLinkIds } = useLinks<Datum>({\n        root,\n        nodeByUid,\n        activeNodeUids,\n        linkThickness,\n        activeLinkThickness,\n        inactiveLinkThickness,\n        linkColor,\n    })\n\n    const setCurrentNode = useSetCurrentNode<Datum>({\n        setActiveNodeUids,\n        highlightAncestorNodes,\n        highlightDescendantNodes,\n        links,\n        setActiveLinkIds,\n        highlightAncestorLinks,\n        highlightDescendantLinks,\n    })\n\n    return {\n        nodes,\n        nodeByUid,\n        links,\n        linkGenerator,\n        setCurrentNode,\n    }\n}\n\n/**\n * This hook may generates mouse event handlers for a node according to the main chart props.\n * It's used for the default `Node` component and may be used for custom nodes\n * to simplify their implementation.\n */\nexport const useNodeMouseEventHandlers = <Datum>(\n    node: ComputedNode<Datum>,\n    {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onMouseDown,\n        onMouseUp,\n        onClick,\n        onDoubleClick,\n        setCurrentNode,\n        tooltip,\n        tooltipPosition,\n        tooltipAnchor,\n        margin,\n    }: {\n        isInteractive: boolean\n        onMouseEnter?: NodeMouseEventHandler<Datum>\n        onMouseMove?: NodeMouseEventHandler<Datum>\n        onMouseLeave?: NodeMouseEventHandler<Datum>\n        onMouseDown?: NodeMouseEventHandler<Datum>\n        onMouseUp?: NodeMouseEventHandler<Datum>\n        onClick?: NodeMouseEventHandler<Datum>\n        onDoubleClick?: NodeMouseEventHandler<Datum>\n        setCurrentNode: CurrentNodeSetter<Datum>\n        tooltip?: NodeTooltip<Datum>\n        tooltipPosition: TooltipPosition\n        tooltipAnchor: TooltipAnchor\n        margin: Margin\n    }\n) => {\n    const { showTooltipFromEvent, showTooltipAt, hideTooltip } = useTooltip()\n\n    const showTooltip = useMemo(() => {\n        if (!tooltip) return undefined\n\n        if (tooltipPosition === 'fixed') {\n            return () => {\n                const { x, y } = node\n                showTooltipAt(\n                    createElement(tooltip, {\n                        node,\n                    }),\n                    [x + margin.left, y + margin.top],\n                    tooltipAnchor\n                )\n            }\n        }\n\n        return (event: MouseEvent) => {\n            showTooltipFromEvent(\n                createElement(tooltip, {\n                    node,\n                }),\n                event,\n                tooltipAnchor\n            )\n        }\n    }, [node, tooltip, showTooltipFromEvent, showTooltipAt, tooltipPosition, tooltipAnchor, margin])\n\n    const handleMouseEnter = useCallback(\n        (event: MouseEvent) => {\n            setCurrentNode(node)\n            showTooltip?.(event)\n            onMouseEnter?.(node, event)\n        },\n        [node, showTooltip, setCurrentNode, onMouseEnter]\n    )\n\n    const handleMouseMove = useCallback(\n        (event: MouseEvent) => {\n            showTooltip?.(event)\n            onMouseMove?.(node, event)\n        },\n        [node, showTooltip, onMouseMove]\n    )\n\n    const handleMouseLeave = useCallback(\n        (event: MouseEvent) => {\n            setCurrentNode(null)\n            hideTooltip()\n            onMouseLeave?.(node, event)\n        },\n        [node, hideTooltip, setCurrentNode, onMouseLeave]\n    )\n\n    const handleMouseDown = useCallback(\n        (event: MouseEvent) => {\n            onMouseDown?.(node, event)\n        },\n        [node, onMouseDown]\n    )\n\n    const handleMouseUp = useCallback(\n        (event: MouseEvent) => {\n            onMouseUp?.(node, event)\n        },\n        [node, onMouseUp]\n    )\n\n    const handleClick = useCallback(\n        (event: MouseEvent) => {\n            onClick?.(node, event)\n        },\n        [node, onClick]\n    )\n\n    const handleDoubleClick = useCallback(\n        (event: MouseEvent) => {\n            onDoubleClick?.(node, event)\n        },\n        [node, onDoubleClick]\n    )\n\n    return {\n        onMouseEnter: isInteractive ? handleMouseEnter : undefined,\n        onMouseMove: isInteractive ? handleMouseMove : undefined,\n        onMouseLeave: isInteractive ? handleMouseLeave : undefined,\n        onMouseDown: isInteractive ? handleMouseDown : undefined,\n        onMouseUp: isInteractive ? handleMouseUp : undefined,\n        onClick: isInteractive ? handleClick : undefined,\n        onDoubleClick: isInteractive ? handleDoubleClick : undefined,\n    }\n}\n\n/**\n * This hook may generates mouse event handlers for a node according to the main chart props.\n * It's used for the default `Node` component and may be used for custom nodes\n * to simplify their implementation.\n */\nexport const useLinkMouseEventHandlers = <Datum>(\n    link: ComputedLink<Datum>,\n    {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onMouseDown,\n        onMouseUp,\n        onClick,\n        onDoubleClick,\n        tooltip,\n        tooltipAnchor,\n    }: {\n        isInteractive: boolean\n        onMouseEnter?: LinkMouseEventHandler<Datum>\n        onMouseMove?: LinkMouseEventHandler<Datum>\n        onMouseLeave?: LinkMouseEventHandler<Datum>\n        onMouseDown?: LinkMouseEventHandler<Datum>\n        onMouseUp?: LinkMouseEventHandler<Datum>\n        onClick?: LinkMouseEventHandler<Datum>\n        onDoubleClick?: LinkMouseEventHandler<Datum>\n        tooltip?: LinkTooltip<Datum>\n        tooltipAnchor: TooltipAnchor\n    }\n) => {\n    const { showTooltipFromEvent, hideTooltip } = useTooltip()\n\n    const showTooltip = useMemo(() => {\n        if (!tooltip) return undefined\n\n        return (event: MouseEvent) => {\n            showTooltipFromEvent(\n                createElement(tooltip, {\n                    link,\n                }),\n                event,\n                tooltipAnchor\n            )\n        }\n    }, [link, tooltip, showTooltipFromEvent, tooltipAnchor])\n\n    const handleMouseEnter = useCallback(\n        (event: MouseEvent) => {\n            showTooltip?.(event)\n            onMouseEnter?.(link, event)\n        },\n        [link, showTooltip, onMouseEnter]\n    )\n\n    const handleMouseMove = useCallback(\n        (event: MouseEvent) => {\n            showTooltip?.(event)\n            onMouseMove?.(link, event)\n        },\n        [link, showTooltip, onMouseMove]\n    )\n\n    const handleMouseLeave = useCallback(\n        (event: MouseEvent) => {\n            hideTooltip()\n            onMouseLeave?.(link, event)\n        },\n        [link, hideTooltip, onMouseLeave]\n    )\n\n    const handleMouseDown = useCallback(\n        (event: MouseEvent) => {\n            onMouseDown?.(link, event)\n        },\n        [link, onMouseDown]\n    )\n\n    const handleMouseUp = useCallback(\n        (event: MouseEvent) => {\n            onMouseUp?.(link, event)\n        },\n        [link, onMouseUp]\n    )\n\n    const handleClick = useCallback(\n        (event: MouseEvent) => {\n            onClick?.(link, event)\n        },\n        [link, onClick]\n    )\n\n    const handleDoubleClick = useCallback(\n        (event: MouseEvent) => {\n            onDoubleClick?.(link, event)\n        },\n        [link, onDoubleClick]\n    )\n\n    return {\n        onMouseEnter: isInteractive ? handleMouseEnter : undefined,\n        onMouseMove: isInteractive ? handleMouseMove : undefined,\n        onMouseLeave: isInteractive ? handleMouseLeave : undefined,\n        onMouseDown: isInteractive ? handleMouseDown : undefined,\n        onMouseUp: isInteractive ? handleMouseUp : undefined,\n        onClick: isInteractive ? handleClick : undefined,\n        onDoubleClick: isInteractive ? handleDoubleClick : undefined,\n    }\n}\n","import { CommonProps, TreeCanvasProps, TreeSvgProps } from './types'\nimport { Node } from './Node'\nimport { Link } from './Link'\nimport { Label } from './Label'\nimport { renderNode, renderLink, renderLabel } from './canvas'\n\nexport const commonDefaultProps: Pick<\n    CommonProps<any>,\n    | 'identity'\n    | 'mode'\n    | 'layout'\n    | 'nodeSize'\n    | 'nodeColor'\n    | 'fixNodeColorAtDepth'\n    | 'linkCurve'\n    | 'linkThickness'\n    | 'linkColor'\n    | 'enableLabel'\n    | 'label'\n    | 'labelsPosition'\n    | 'orientLabel'\n    | 'labelOffset'\n    | 'isInteractive'\n    | 'useMesh'\n    | 'meshDetectionRadius'\n    | 'debugMesh'\n    | 'highlightAncestorNodes'\n    | 'highlightDescendantNodes'\n    | 'highlightAncestorLinks'\n    | 'highlightDescendantLinks'\n    | 'nodeTooltipPosition'\n    | 'nodeTooltipAnchor'\n    | 'role'\n    | 'animate'\n    | 'motionConfig'\n> = {\n    identity: 'id',\n    mode: 'dendogram',\n    layout: 'top-to-bottom',\n    nodeSize: 12,\n    nodeColor: { scheme: 'nivo' },\n    fixNodeColorAtDepth: Infinity,\n    linkCurve: 'bump',\n    linkThickness: 1,\n    linkColor: { from: 'source.color', modifiers: [['opacity', 0.4]] },\n    enableLabel: true,\n    label: 'id',\n    labelsPosition: 'outward',\n    orientLabel: true,\n    labelOffset: 6,\n    isInteractive: true,\n    useMesh: true,\n    meshDetectionRadius: Infinity,\n    debugMesh: false,\n    highlightAncestorNodes: true,\n    highlightDescendantNodes: false,\n    highlightAncestorLinks: true,\n    highlightDescendantLinks: false,\n    nodeTooltipPosition: 'fixed',\n    nodeTooltipAnchor: 'top',\n    role: 'img',\n    animate: true,\n    motionConfig: 'gentle',\n}\n\nexport const svgDefaultProps: typeof commonDefaultProps &\n    Required<\n        Pick<\n            TreeSvgProps<any>,\n            'layers' | 'nodeComponent' | 'linkComponent' | 'labelComponent' | 'linkTooltipAnchor'\n        >\n    > = {\n    ...commonDefaultProps,\n    layers: ['links', 'nodes', 'labels', 'mesh'],\n    nodeComponent: Node,\n    linkComponent: Link,\n    labelComponent: Label,\n    linkTooltipAnchor: 'top',\n}\n\nexport const canvasDefaultProps: typeof commonDefaultProps &\n    Required<\n        Pick<\n            TreeCanvasProps<any>,\n            'layers' | 'renderNode' | 'renderLink' | 'renderLabel' | 'pixelRatio'\n        >\n    > = {\n    ...commonDefaultProps,\n    layers: ['links', 'nodes', 'labels', 'mesh'],\n    renderNode,\n    renderLink,\n    renderLabel,\n    pixelRatio: typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1,\n}\n","import { animated } from '@react-spring/web'\nimport { NodeComponentProps } from './types'\nimport { useNodeMouseEventHandlers } from './hooks'\n\nexport const Node = <Datum,>({\n    node,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    onClick,\n    onDoubleClick,\n    setCurrentNode,\n    tooltip,\n    tooltipPosition,\n    tooltipAnchor,\n    margin,\n    animatedProps,\n}: NodeComponentProps<Datum>) => {\n    const eventHandlers = useNodeMouseEventHandlers<Datum>(node, {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onMouseDown,\n        onMouseUp,\n        onClick,\n        onDoubleClick,\n        setCurrentNode,\n        tooltip,\n        tooltipPosition,\n        tooltipAnchor,\n        margin,\n    })\n\n    return (\n        <animated.circle\n            data-testid={`node.${node.uid}`}\n            r={animatedProps.size.to(size => size / 2)}\n            fill={animatedProps.color}\n            cx={animatedProps.x}\n            cy={animatedProps.y}\n            {...eventHandlers}\n        />\n    )\n}\n","import { animated, to } from '@react-spring/web'\nimport { LinkComponentProps } from './types'\nimport { useLinkMouseEventHandlers } from './hooks'\n\nexport const Link = <Datum,>({\n    link,\n    linkGenerator,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    onClick,\n    onDoubleClick,\n    tooltip,\n    tooltipAnchor,\n    animatedProps,\n}: LinkComponentProps<Datum>) => {\n    const eventHandlers = useLinkMouseEventHandlers<Datum>(link, {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onMouseDown,\n        onMouseUp,\n        onClick,\n        onDoubleClick,\n        tooltip,\n        tooltipAnchor,\n    })\n\n    return (\n        <animated.path\n            data-testid={`link.${link.id}`}\n            d={to(\n                [\n                    animatedProps.sourceX,\n                    animatedProps.sourceY,\n                    animatedProps.targetX,\n                    animatedProps.targetY,\n                ],\n                (sourceX, sourceY, targetX, targetY) => {\n                    return linkGenerator({\n                        source: [sourceX, sourceY],\n                        target: [targetX, targetY],\n                    })\n                }\n            )}\n            fill=\"none\"\n            strokeWidth={animatedProps.thickness}\n            stroke={animatedProps.color}\n            {...eventHandlers}\n        />\n    )\n}\n","import { animated, to } from '@react-spring/web'\nimport { useTheme } from '@nivo/theming'\nimport { Text } from '@nivo/text'\nimport { LabelComponentProps } from './types'\n\nexport const Label = <Datum,>({ label, animatedProps }: LabelComponentProps<Datum>) => {\n    const theme = useTheme()\n\n    return (\n        <animated.g\n            data-testid={`label.${label.id}`}\n            transform={to([animatedProps.x, animatedProps.y], (x, y) => `translate(${x},${y})`)}\n        >\n            <animated.g transform={animatedProps.rotation.to(rotation => `rotate(${rotation})`)}>\n                <Text\n                    data-testid={`label.${label.id}.label`}\n                    style={theme.labels.text}\n                    textAnchor={label.textAnchor}\n                    dominantBaseline={label.baseline}\n                >\n                    {label.label}\n                </Text>\n            </animated.g>\n        </animated.g>\n    )\n}\n","import { degreesToRadians } from '@nivo/core'\nimport { drawCanvasText } from '@nivo/text'\nimport { LinkCanvasRendererProps, NodeCanvasRendererProps, LabelCanvasRendererProps } from './types'\n\nexport const renderNode = <Datum>(\n    ctx: CanvasRenderingContext2D,\n    { node }: NodeCanvasRendererProps<Datum>\n) => {\n    ctx.beginPath()\n    ctx.arc(node.x, node.y, node.size / 2, 0, 2 * Math.PI)\n    ctx.fillStyle = node.color\n    ctx.fill()\n}\n\nexport const renderLink = <Datum>(\n    ctx: CanvasRenderingContext2D,\n    { link, linkGenerator }: LinkCanvasRendererProps<Datum>\n) => {\n    ctx.strokeStyle = link.color\n    ctx.lineWidth = link.thickness\n    ctx.beginPath()\n    linkGenerator({\n        source: [link.source.x, link.source.y],\n        target: [link.target.x, link.target.y],\n    })\n    ctx.stroke()\n}\n\nexport const renderLabel = <Datum>(\n    ctx: CanvasRenderingContext2D,\n    { label, theme }: LabelCanvasRendererProps<Datum>\n) => {\n    ctx.save()\n\n    ctx.translate(label.x, label.y)\n    ctx.rotate(degreesToRadians(label.rotation))\n\n    ctx.textBaseline = 'middle'\n    ctx.textAlign = label.textAnchor === 'middle' ? 'center' : label.textAnchor\n    ctx.fillStyle = '#000'\n\n    drawCanvasText(ctx, theme.labels.text, label.label)\n\n    ctx.restore()\n}\n","import { createElement } from 'react'\nimport { useTransition } from '@react-spring/web'\nimport { useMotionConfig } from '@nivo/core'\nimport { TooltipAnchor } from '@nivo/tooltip'\nimport {\n    ComputedLink,\n    LinkComponent,\n    LinkMouseEventHandler,\n    LinkTooltip,\n    LinkAnimatedProps,\n    LinkGenerator,\n} from './types'\n\ninterface LinksProps<Datum> {\n    links: ComputedLink<Datum>[]\n    linkComponent: LinkComponent<Datum>\n    linkGenerator: LinkGenerator\n    isInteractive: boolean\n    onMouseEnter?: LinkMouseEventHandler<Datum>\n    onMouseMove?: LinkMouseEventHandler<Datum>\n    onMouseLeave?: LinkMouseEventHandler<Datum>\n    onMouseDown?: LinkMouseEventHandler<Datum>\n    onMouseUp?: LinkMouseEventHandler<Datum>\n    onClick?: LinkMouseEventHandler<Datum>\n    onDoubleClick?: LinkMouseEventHandler<Datum>\n    tooltip?: LinkTooltip<Datum>\n    tooltipAnchor: TooltipAnchor\n}\n\nconst regularTransition = <Datum,>(link: ComputedLink<Datum>): LinkAnimatedProps => ({\n    sourceX: link.source.x,\n    sourceY: link.source.y,\n    targetX: link.target.x,\n    targetY: link.target.y,\n    thickness: link.thickness,\n    color: link.color,\n})\nconst leaveTransition = <Datum,>(link: ComputedLink<Datum>): LinkAnimatedProps => ({\n    sourceX: link.source.x,\n    sourceY: link.source.y,\n    targetX: link.target.x,\n    targetY: link.target.y,\n    thickness: link.thickness,\n    color: link.color,\n})\n\nexport const Links = <Datum,>({\n    links,\n    linkComponent,\n    linkGenerator,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    onClick,\n    onDoubleClick,\n    tooltip,\n    tooltipAnchor,\n}: LinksProps<Datum>) => {\n    const { animate, config: springConfig } = useMotionConfig()\n\n    const transition = useTransition<ComputedLink<Datum>, LinkAnimatedProps>(links, {\n        keys: link => link.id,\n        from: regularTransition,\n        enter: regularTransition,\n        update: regularTransition,\n        leave: leaveTransition,\n        config: springConfig,\n        immediate: !animate,\n    })\n\n    return (\n        <>\n            {transition((animatedProps, link) =>\n                createElement(linkComponent, {\n                    link,\n                    linkGenerator,\n                    animatedProps,\n                    isInteractive,\n                    onMouseEnter,\n                    onMouseMove,\n                    onMouseLeave,\n                    onMouseDown,\n                    onMouseUp,\n                    onClick,\n                    onDoubleClick,\n                    tooltip,\n                    tooltipAnchor,\n                })\n            )}\n        </>\n    )\n}\n","import { createElement } from 'react'\nimport { useTransition } from '@react-spring/web'\nimport { Margin, useMotionConfig } from '@nivo/core'\nimport { TooltipAnchor, TooltipPosition } from '@nivo/tooltip'\nimport {\n    ComputedNode,\n    CurrentNodeSetter,\n    NodeComponent,\n    NodeMouseEventHandler,\n    NodeTooltip,\n    NodeAnimatedProps,\n} from './types'\n\ninterface NodesProps<Datum> {\n    nodes: ComputedNode<Datum>[]\n    nodeComponent: NodeComponent<Datum>\n    isInteractive: boolean\n    onMouseEnter?: NodeMouseEventHandler<Datum>\n    onMouseMove?: NodeMouseEventHandler<Datum>\n    onMouseLeave?: NodeMouseEventHandler<Datum>\n    onMouseDown?: NodeMouseEventHandler<Datum>\n    onMouseUp?: NodeMouseEventHandler<Datum>\n    onClick?: NodeMouseEventHandler<Datum>\n    onDoubleClick?: NodeMouseEventHandler<Datum>\n    setCurrentNode: CurrentNodeSetter<Datum>\n    tooltip?: NodeTooltip<Datum>\n    tooltipPosition: TooltipPosition\n    tooltipAnchor: TooltipAnchor\n    margin: Margin\n}\n\nconst regularTransition = <Datum,>(node: ComputedNode<Datum>): NodeAnimatedProps => ({\n    x: node.x,\n    y: node.y,\n    size: node.size,\n    color: node.color,\n})\nconst leaveTransition = <Datum,>(node: ComputedNode<Datum>): NodeAnimatedProps => ({\n    x: node.x,\n    y: node.y,\n    size: 0,\n    color: node.color,\n})\n\nexport const Nodes = <Datum,>({\n    nodes,\n    nodeComponent,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    onClick,\n    onDoubleClick,\n    setCurrentNode,\n    tooltip,\n    tooltipPosition,\n    tooltipAnchor,\n    margin,\n}: NodesProps<Datum>) => {\n    const { animate, config: springConfig } = useMotionConfig()\n\n    const transition = useTransition<ComputedNode<Datum>, NodeAnimatedProps>(nodes, {\n        keys: node => node.uid,\n        from: regularTransition,\n        enter: regularTransition,\n        update: regularTransition,\n        leave: leaveTransition,\n        config: springConfig,\n        immediate: !animate,\n    })\n\n    return (\n        <>\n            {transition((animatedProps, node) =>\n                createElement(nodeComponent, {\n                    node,\n                    isInteractive,\n                    onMouseEnter,\n                    onMouseMove,\n                    onMouseLeave,\n                    onMouseDown,\n                    onMouseUp,\n                    onClick,\n                    onDoubleClick,\n                    setCurrentNode,\n                    tooltip,\n                    tooltipPosition,\n                    tooltipAnchor,\n                    margin,\n                    animatedProps,\n                })\n            )}\n        </>\n    )\n}\n","import { useMemo } from 'react'\nimport { usePropertyAccessor } from '@nivo/core'\nimport {\n    CommonProps,\n    Layout,\n    ComputedNode,\n    ComputedLabel,\n    LabelsPosition,\n    LabelTextAnchor,\n    LabelBaseline,\n} from './types'\n\ninterface LabelPositionResult {\n    x: number\n    y: number\n    rotation: number\n    textAnchor: LabelTextAnchor\n    baseline: LabelBaseline\n}\n\ntype GetLabelPosition<Datum> = (node: ComputedNode<Datum>) => LabelPositionResult\n\ninterface LabelPositionFactoryProps {\n    orient: boolean\n    offset: number\n}\n\nconst horizontalLabelBefore = (x: number, y: number, offset: number): LabelPositionResult => ({\n    x: x - offset,\n    y: y,\n    rotation: 0,\n    textAnchor: 'end',\n    baseline: 'middle',\n})\n\nconst horizontalLabelAfter = (x: number, y: number, offset: number): LabelPositionResult => ({\n    x: x + offset,\n    y: y,\n    rotation: 0,\n    textAnchor: 'start',\n    baseline: 'middle',\n})\n\nconst verticalLabelBefore = (x: number, y: number, offset: number): LabelPositionResult => ({\n    x: x,\n    y: y - offset,\n    rotation: 0,\n    textAnchor: 'middle',\n    baseline: 'auto',\n})\n\nconst verticalLabelBeforeOriented = (\n    x: number,\n    y: number,\n    offset: number\n): LabelPositionResult => ({\n    x: x,\n    y: y - offset,\n    rotation: -90,\n    textAnchor: 'start',\n    baseline: 'middle',\n})\n\nconst verticalLabelAfter = (x: number, y: number, offset: number): LabelPositionResult => ({\n    x: x,\n    y: y + offset,\n    rotation: 0,\n    textAnchor: 'middle',\n    baseline: 'hanging',\n})\n\nconst verticalLabelAfterOriented = (x: number, y: number, offset: number): LabelPositionResult => ({\n    x: x,\n    y: y + offset,\n    rotation: -90,\n    textAnchor: 'end',\n    baseline: 'middle',\n})\n\nconst verticalLeavesBeforeOthersAfter =\n    <Datum>({ orient, offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (node.isLeaf) {\n            if (orient) return verticalLabelBeforeOriented(node.x, node.y, spacing)\n            else return verticalLabelBefore(node.x, node.y, spacing)\n        } else {\n            if (orient) return verticalLabelAfterOriented(node.x, node.y, spacing)\n            else return verticalLabelAfter(node.x, node.y, spacing)\n        }\n    }\n\nconst verticalLeavesAfterOthersBefore =\n    <Datum>({ orient, offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (node.isLeaf) {\n            if (orient) return verticalLabelAfterOriented(node.x, node.y, spacing)\n            else return verticalLabelAfter(node.x, node.y, spacing)\n        } else {\n            if (orient) return verticalLabelBeforeOriented(node.x, node.y, spacing)\n            else return verticalLabelBefore(node.x, node.y, spacing)\n        }\n    }\n\nconst verticalAllBefore =\n    <Datum>({ orient, offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (orient) return verticalLabelBeforeOriented(node.x, node.y, spacing)\n        else return verticalLabelBefore(node.x, node.y, spacing)\n    }\n\nconst verticalAllAfter =\n    <Datum>({ orient, offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (orient) return verticalLabelAfterOriented(node.x, node.y, spacing)\n        else return verticalLabelAfter(node.x, node.y, spacing)\n    }\n\nconst horizontalLeavesBeforeOthersAfter =\n    <Datum>({ offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (node.isLeaf) return horizontalLabelBefore(node.x, node.y, spacing)\n        else return horizontalLabelAfter(node.x, node.y, spacing)\n    }\n\nconst horizontalLeavesAfterOthersBefore =\n    <Datum>({ offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        const spacing = node.size / 2 + offset\n        if (node.isLeaf) return horizontalLabelAfter(node.x, node.y, spacing)\n        return horizontalLabelBefore(node.x, node.y, spacing)\n    }\n\nconst horizontalAllBefore =\n    <Datum>({ offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        return horizontalLabelBefore(node.x, node.y, node.size / 2 + offset)\n    }\n\nconst horizontalAllAfter =\n    <Datum>({ offset }: LabelPositionFactoryProps): GetLabelPosition<Datum> =>\n    (node: ComputedNode<Datum>) => {\n        return horizontalLabelAfter(node.x, node.y, node.size / 2 + offset)\n    }\n\nconst useGetLabelPosition = <Datum>({\n    layout,\n    labelsPosition,\n    orientLabel,\n    labelOffset,\n}: {\n    layout: Layout\n    labelsPosition: LabelsPosition\n    orientLabel: boolean\n    labelOffset: number\n}) =>\n    useMemo(() => {\n        const options: LabelPositionFactoryProps = {\n            orient: orientLabel,\n            offset: labelOffset,\n        }\n\n        if (layout === 'top-to-bottom') {\n            if (labelsPosition === 'outward') {\n                return verticalLeavesAfterOthersBefore<Datum>(options)\n            } else if (labelsPosition === 'inward') {\n                return verticalLeavesBeforeOthersAfter<Datum>(options)\n            } else if (labelsPosition === 'layout') {\n                return verticalAllAfter<Datum>(options)\n            } else if (labelsPosition === 'layout-opposite') {\n                return verticalAllBefore<Datum>(options)\n            }\n        }\n\n        if (layout === 'bottom-to-top') {\n            if (labelsPosition === 'outward') {\n                return verticalLeavesBeforeOthersAfter<Datum>(options)\n            } else if (labelsPosition === 'inward') {\n                return verticalLeavesAfterOthersBefore<Datum>(options)\n            } else if (labelsPosition === 'layout') {\n                return verticalAllBefore<Datum>(options)\n            } else if (labelsPosition === 'layout-opposite') {\n                return verticalAllAfter<Datum>(options)\n            }\n        }\n\n        if (layout === 'right-to-left') {\n            if (labelsPosition === 'outward') {\n                return horizontalLeavesBeforeOthersAfter<Datum>(options)\n            } else if (labelsPosition === 'inward') {\n                return horizontalLeavesAfterOthersBefore<Datum>(options)\n            } else if (labelsPosition === 'layout') {\n                return horizontalAllBefore<Datum>(options)\n            } else if (labelsPosition === 'layout-opposite') {\n                return horizontalAllAfter<Datum>(options)\n            }\n        }\n\n        if (layout === 'left-to-right') {\n            if (labelsPosition === 'outward') {\n                return horizontalLeavesAfterOthersBefore<Datum>(options)\n            } else if (labelsPosition === 'inward') {\n                return horizontalLeavesBeforeOthersAfter<Datum>(options)\n            } else if (labelsPosition === 'layout') {\n                return horizontalAllAfter<Datum>(options)\n            } else if (labelsPosition === 'layout-opposite') {\n                return horizontalAllBefore<Datum>(options)\n            }\n        }\n    }, [layout, labelsPosition, orientLabel, labelOffset])\n\nexport const useLabels = <Datum>({\n    nodes,\n    label,\n    layout,\n    labelsPosition,\n    orientLabel,\n    labelOffset,\n}: {\n    nodes: readonly ComputedNode<Datum>[]\n    label: Exclude<CommonProps<Datum>['label'], undefined>\n    layout: Layout\n    labelsPosition: LabelsPosition\n    orientLabel: boolean\n    labelOffset: number\n}) => {\n    const getLabel = usePropertyAccessor(label)\n    const getPosition = useGetLabelPosition<Datum>({\n        layout,\n        labelsPosition,\n        orientLabel,\n        labelOffset,\n    })\n\n    if (getPosition === undefined) {\n        throw new Error('Unable to determine the logic to compute labels position')\n    }\n\n    return useMemo(\n        () =>\n            nodes.map(\n                node =>\n                    ({\n                        id: node.uid,\n                        node: node,\n                        label: getLabel(node),\n                        ...getPosition(node),\n                    }) as ComputedLabel<Datum>\n            ),\n        [nodes, getLabel, getPosition]\n    )\n}\n","import { createElement } from 'react'\nimport { useTransition } from '@react-spring/web'\nimport { useMotionConfig } from '@nivo/core'\nimport {\n    CommonProps,\n    ComputedLabel,\n    ComputedNode,\n    LabelAnimatedProps,\n    LabelComponent,\n    LabelsPosition,\n    Layout,\n} from './types'\nimport { useLabels } from './labelsHooks'\n\ninterface LabelsProps<Datum> {\n    nodes: readonly ComputedNode<Datum>[]\n    label: Exclude<CommonProps<Datum>['label'], undefined>\n    layout: Layout\n    labelsPosition: LabelsPosition\n    orientLabel: boolean\n    labelOffset: number\n    labelComponent: LabelComponent<Datum>\n}\n\nconst regularTransition = <Datum,>(label: ComputedLabel<Datum>): LabelAnimatedProps => ({\n    x: label.x,\n    y: label.y,\n    rotation: label.rotation,\n})\nconst leaveTransition = <Datum,>(label: ComputedLabel<Datum>): LabelAnimatedProps => ({\n    x: label.x,\n    y: label.y,\n    rotation: label.rotation,\n})\n\nexport const Labels = <Datum,>({\n    nodes,\n    label,\n    layout,\n    labelsPosition,\n    orientLabel,\n    labelOffset,\n    labelComponent,\n}: LabelsProps<Datum>) => {\n    const labels = useLabels({ nodes, label, layout, labelsPosition, orientLabel, labelOffset })\n\n    const { animate, config: springConfig } = useMotionConfig()\n\n    const transition = useTransition<ComputedLabel<Datum>, LabelAnimatedProps>(labels, {\n        keys: label => label.id,\n        from: regularTransition,\n        enter: regularTransition,\n        update: regularTransition,\n        leave: leaveTransition,\n        config: springConfig,\n        immediate: !animate,\n    })\n\n    return (\n        <g\n            style={{\n                pointerEvents: 'none',\n            }}\n        >\n            {transition((animatedProps, label) =>\n                createElement(labelComponent, {\n                    label,\n                    animatedProps,\n                })\n            )}\n        </g>\n    )\n}\n","import { useMemo } from 'react'\nimport { createElement, memo } from 'react'\nimport { Margin } from '@nivo/core'\nimport { TooltipAnchor, TooltipPosition } from '@nivo/tooltip'\nimport { Mesh as BaseMesh } from '@nivo/voronoi'\nimport { ComputedNode, CurrentNodeSetter, NodeMouseEventHandler, NodeTooltip } from './types'\n\ninterface MeshProps<Datum> {\n    nodes: ComputedNode<Datum>[]\n    width: number\n    height: number\n    margin: Margin\n    onMouseEnter?: NodeMouseEventHandler<Datum>\n    onMouseMove?: NodeMouseEventHandler<Datum>\n    onMouseLeave?: NodeMouseEventHandler<Datum>\n    onMouseDown?: NodeMouseEventHandler<Datum>\n    onMouseUp?: NodeMouseEventHandler<Datum>\n    onClick?: NodeMouseEventHandler<Datum>\n    onDoubleClick?: NodeMouseEventHandler<Datum>\n    setCurrentNode: CurrentNodeSetter<Datum>\n    tooltip?: NodeTooltip<Datum>\n    tooltipPosition?: TooltipPosition\n    tooltipAnchor?: TooltipAnchor\n    detectionRadius: number\n    debug: boolean\n}\n\nconst NonMemoizedMesh = <Datum,>({\n    nodes,\n    width,\n    height,\n    margin,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    onClick,\n    onDoubleClick,\n    setCurrentNode,\n    tooltip,\n    tooltipPosition,\n    tooltipAnchor,\n    detectionRadius,\n    debug,\n}: MeshProps<Datum>) => {\n    const renderTooltip = useMemo(() => {\n        if (!tooltip) return undefined\n        return (node: ComputedNode<Datum>) => createElement(tooltip, { node })\n    }, [tooltip])\n\n    /*\n    const handleMouseEnter = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            setCurrentNode(node)\n            if (tooltip !== undefined) {\n                showTooltipAt(\n                    createElement(tooltip, { node }),\n                    [node.x + margin.left, node.y ?? 0 + margin.top],\n                    'top'\n                )\n            }\n            onMouseEnter && onMouseEnter(node, event)\n        },\n        [showTooltipAt, tooltip, margin.left, margin.top, setCurrentNode, onMouseEnter]\n    )\n\n    const handleMouseMove = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            setCurrentNode(node)\n            if (tooltip !== undefined) {\n                showTooltipAt(\n                    createElement(tooltip, { node }),\n                    [node.x + margin.left, node.y ?? 0 + margin.top],\n                    'top'\n                )\n            }\n            onMouseMove && onMouseMove(node, event)\n        },\n        [showTooltipAt, tooltip, margin.left, margin.top, setCurrentNode, onMouseMove]\n    )\n\n    const handleMouseLeave = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            setCurrentNode(null)\n            hideTooltip()\n            onMouseLeave && onMouseLeave(node, event)\n        },\n        [hideTooltip, setCurrentNode, onMouseLeave]\n    )\n\n    const handleClick = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            onClick && onClick(node, event)\n        },\n        [onClick]\n    )\n    */\n\n    return (\n        <BaseMesh<ComputedNode<Datum>>\n            nodes={nodes}\n            width={width}\n            height={height}\n            margin={margin}\n            detectionRadius={detectionRadius}\n            setCurrent={setCurrentNode}\n            onMouseEnter={onMouseEnter}\n            onMouseMove={onMouseMove}\n            onMouseLeave={onMouseLeave}\n            onMouseDown={onMouseDown}\n            onMouseUp={onMouseUp}\n            onClick={onClick}\n            onDoubleClick={onDoubleClick}\n            tooltip={renderTooltip}\n            tooltipPosition={tooltipPosition}\n            tooltipAnchor={tooltipAnchor}\n            debug={debug}\n        />\n    )\n}\n\nexport const Mesh = memo(NonMemoizedMesh) as typeof NonMemoizedMesh\n","import { createElement, Fragment, ReactNode, useMemo, forwardRef, Ref, ReactElement } from 'react'\nimport { Container, useDimensions, SvgWrapper, WithChartRef } from '@nivo/core'\nimport { DefaultDatum, LayerId, TreeSvgProps, CustomSvgLayerProps } from './types'\nimport { svgDefaultProps } from './defaults'\nimport { useTree } from './hooks'\nimport { Links } from './Links'\nimport { Nodes } from './Nodes'\nimport { Labels } from './Labels'\nimport { Mesh } from './Mesh'\n\ntype InnerTreeProps<Datum> = Omit<\n    TreeSvgProps<Datum>,\n    'animate' | 'motionConfig' | 'renderWrapper' | 'theme'\n> & {\n    forwardedRef: Ref<SVGSVGElement>\n}\n\nconst InnerTree = <Datum,>({\n    width,\n    height,\n    margin: partialMargin,\n    data,\n    identity,\n    mode = svgDefaultProps.mode,\n    layout = svgDefaultProps.layout,\n    nodeSize = svgDefaultProps.nodeSize,\n    activeNodeSize,\n    inactiveNodeSize,\n    nodeColor = svgDefaultProps.nodeColor,\n    fixNodeColorAtDepth = svgDefaultProps.fixNodeColorAtDepth,\n    nodeComponent = svgDefaultProps.nodeComponent,\n    linkCurve = svgDefaultProps.linkCurve,\n    linkThickness = svgDefaultProps.linkThickness,\n    activeLinkThickness,\n    inactiveLinkThickness,\n    linkColor = svgDefaultProps.linkColor,\n    linkComponent = svgDefaultProps.linkComponent,\n    enableLabel = svgDefaultProps.enableLabel,\n    label = svgDefaultProps.label,\n    labelsPosition = svgDefaultProps.labelsPosition,\n    orientLabel = svgDefaultProps.orientLabel,\n    labelOffset = svgDefaultProps.labelOffset,\n    labelComponent = svgDefaultProps.labelComponent,\n    layers = svgDefaultProps.layers,\n    isInteractive = svgDefaultProps.isInteractive,\n    useMesh = svgDefaultProps.useMesh,\n    meshDetectionRadius = svgDefaultProps.meshDetectionRadius,\n    debugMesh = svgDefaultProps.debugMesh,\n    highlightAncestorNodes = svgDefaultProps.highlightAncestorNodes,\n    highlightDescendantNodes = svgDefaultProps.highlightDescendantNodes,\n    highlightAncestorLinks = svgDefaultProps.highlightAncestorLinks,\n    highlightDescendantLinks = svgDefaultProps.highlightDescendantLinks,\n    onNodeMouseEnter,\n    onNodeMouseMove,\n    onNodeMouseLeave,\n    onNodeMouseDown,\n    onNodeMouseUp,\n    onNodeClick,\n    onNodeDoubleClick,\n    nodeTooltip,\n    nodeTooltipPosition = svgDefaultProps.nodeTooltipPosition,\n    nodeTooltipAnchor = svgDefaultProps.nodeTooltipAnchor,\n    onLinkMouseEnter,\n    onLinkMouseMove,\n    onLinkMouseLeave,\n    onLinkMouseDown,\n    onLinkMouseUp,\n    onLinkClick,\n    onLinkDoubleClick,\n    linkTooltip,\n    linkTooltipAnchor = svgDefaultProps.linkTooltipAnchor,\n    role = svgDefaultProps.role,\n    ariaLabel,\n    ariaLabelledBy,\n    ariaDescribedBy,\n    forwardedRef,\n}: InnerTreeProps<Datum>) => {\n    const { outerWidth, outerHeight, margin, innerWidth, innerHeight } = useDimensions(\n        width,\n        height,\n        partialMargin\n    )\n\n    const { nodes, nodeByUid, links, linkGenerator, setCurrentNode } = useTree<Datum>({\n        data,\n        identity,\n        layout,\n        mode,\n        width: innerWidth,\n        height: innerHeight,\n        nodeSize,\n        activeNodeSize,\n        inactiveNodeSize,\n        nodeColor,\n        fixNodeColorAtDepth,\n        highlightAncestorNodes,\n        highlightDescendantNodes,\n        linkCurve,\n        linkThickness,\n        activeLinkThickness,\n        inactiveLinkThickness,\n        linkColor,\n        highlightAncestorLinks,\n        highlightDescendantLinks,\n    })\n\n    const layerById: Record<LayerId, ReactNode> = {\n        links: null,\n        nodes: null,\n        labels: null,\n        mesh: null,\n    }\n\n    if (layers.includes('links')) {\n        layerById.links = (\n            <Links<Datum>\n                key=\"links\"\n                links={links}\n                linkComponent={linkComponent}\n                linkGenerator={linkGenerator}\n                isInteractive={isInteractive}\n                onMouseEnter={onLinkMouseEnter}\n                onMouseMove={onLinkMouseMove}\n                onMouseLeave={onLinkMouseLeave}\n                onMouseDown={onLinkMouseDown}\n                onMouseUp={onLinkMouseUp}\n                onClick={onLinkClick}\n                onDoubleClick={onLinkDoubleClick}\n                tooltip={linkTooltip}\n                tooltipAnchor={linkTooltipAnchor}\n            />\n        )\n    }\n\n    if (layers.includes('nodes')) {\n        layerById.nodes = (\n            <Nodes<Datum>\n                key=\"nodes\"\n                nodes={nodes}\n                nodeComponent={nodeComponent}\n                isInteractive={isInteractive}\n                onMouseEnter={onNodeMouseEnter}\n                onMouseMove={onNodeMouseMove}\n                onMouseLeave={onNodeMouseLeave}\n                onMouseDown={onNodeMouseDown}\n                onMouseUp={onNodeMouseUp}\n                onClick={onNodeClick}\n                onDoubleClick={onNodeDoubleClick}\n                setCurrentNode={setCurrentNode}\n                tooltip={nodeTooltip}\n                tooltipPosition={nodeTooltipPosition}\n                tooltipAnchor={nodeTooltipAnchor}\n                margin={margin}\n            />\n        )\n    }\n\n    if (layers.includes('labels') && enableLabel) {\n        layerById.labels = (\n            <Labels<Datum>\n                key=\"labels\"\n                label={label}\n                nodes={nodes}\n                layout={layout}\n                labelsPosition={labelsPosition}\n                orientLabel={orientLabel}\n                labelOffset={labelOffset}\n                labelComponent={labelComponent}\n            />\n        )\n    }\n\n    if (layers.includes('mesh') && isInteractive && useMesh) {\n        layerById.mesh = (\n            <Mesh<Datum>\n                key=\"mesh\"\n                nodes={nodes}\n                width={innerWidth}\n                height={innerHeight}\n                margin={margin}\n                detectionRadius={meshDetectionRadius}\n                debug={debugMesh}\n                onMouseEnter={onNodeMouseEnter}\n                onMouseMove={onNodeMouseMove}\n                onMouseLeave={onNodeMouseLeave}\n                onMouseDown={onNodeMouseDown}\n                onMouseUp={onNodeMouseUp}\n                onClick={onNodeClick}\n                onDoubleClick={onNodeDoubleClick}\n                tooltip={nodeTooltip}\n                tooltipPosition={nodeTooltipPosition}\n                tooltipAnchor={nodeTooltipAnchor}\n                setCurrentNode={setCurrentNode}\n            />\n        )\n    }\n\n    const customLayerProps: CustomSvgLayerProps<Datum> = useMemo(\n        () => ({\n            nodes,\n            nodeByUid,\n            links,\n            innerWidth,\n            innerHeight,\n            linkGenerator,\n            setCurrentNode,\n        }),\n        [nodes, nodeByUid, links, innerWidth, innerHeight, linkGenerator, setCurrentNode]\n    )\n\n    return (\n        <SvgWrapper\n            width={outerWidth}\n            height={outerHeight}\n            margin={margin}\n            role={role}\n            ariaLabel={ariaLabel}\n            ariaLabelledBy={ariaLabelledBy}\n            ariaDescribedBy={ariaDescribedBy}\n            ref={forwardedRef}\n        >\n            {layers.map((layer, i) => {\n                if (typeof layer === 'function') {\n                    return <Fragment key={i}>{createElement(layer, customLayerProps)}</Fragment>\n                }\n\n                return layerById?.[layer] ?? null\n            })}\n        </SvgWrapper>\n    )\n}\n\nexport const Tree = forwardRef(\n    <Datum = DefaultDatum,>(\n        {\n            isInteractive = svgDefaultProps.isInteractive,\n            animate = svgDefaultProps.animate,\n            motionConfig = svgDefaultProps.motionConfig,\n            theme,\n            renderWrapper,\n            ...props\n        }: TreeSvgProps<Datum>,\n        ref: Ref<SVGSVGElement>\n    ) => (\n        <Container\n            animate={animate}\n            isInteractive={isInteractive}\n            motionConfig={motionConfig}\n            renderWrapper={renderWrapper}\n            theme={theme}\n        >\n            <InnerTree<Datum> {...props} isInteractive={isInteractive} forwardedRef={ref} />\n        </Container>\n    )\n) as <Datum = DefaultDatum>(props: WithChartRef<TreeSvgProps<Datum>, SVGSVGElement>) => ReactElement\n","import { forwardRef, Ref, ReactElement } from 'react'\nimport { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core'\nimport { TreeSvgProps, DefaultDatum } from './types'\nimport { Tree } from './Tree'\n\nexport const ResponsiveTree = forwardRef(\n    <Datum = DefaultDatum,>(\n        {\n            defaultWidth,\n            defaultHeight,\n            onResize,\n            debounceResize,\n            ...props\n        }: ResponsiveProps<TreeSvgProps<Datum>>,\n        ref: Ref<SVGSVGElement>\n    ) => (\n        <ResponsiveWrapper\n            defaultWidth={defaultWidth}\n            defaultHeight={defaultHeight}\n            onResize={onResize}\n            debounceResize={debounceResize}\n        >\n            {({ width, height }) => (\n                <Tree<Datum> {...props} width={width} height={height} ref={ref} />\n            )}\n        </ResponsiveWrapper>\n    )\n) as <Datum = DefaultDatum>(\n    props: WithChartRef<ResponsiveProps<TreeSvgProps<Datum>>, SVGSVGElement>\n) => ReactElement\n","import { useEffect, useMemo, useRef, createElement, forwardRef, Ref, ReactElement } from 'react'\nimport { Container, useDimensions, WithChartRef, mergeRefs } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { setCanvasFont } from '@nivo/text'\nimport { useMesh, renderDebugToCanvas } from '@nivo/voronoi'\nimport { DefaultDatum, TreeCanvasProps, CustomCanvasLayerProps, ComputedNode } from './types'\nimport { canvasDefaultProps } from './defaults'\nimport { useTree } from './hooks'\nimport { useLabels } from './labelsHooks'\n\ntype InnerTreeCanvasProps<Datum> = Omit<\n    TreeCanvasProps<Datum>,\n    'animate' | 'motionConfig' | 'renderWrapper' | 'theme'\n> & {\n    forwardedRef: Ref<HTMLCanvasElement>\n}\n\nconst InnerTreeCanvas = <Datum,>({\n    width,\n    height,\n    pixelRatio = canvasDefaultProps.pixelRatio,\n    margin: partialMargin,\n    data,\n    identity,\n    mode = canvasDefaultProps.mode,\n    layout = canvasDefaultProps.layout,\n    nodeSize = canvasDefaultProps.nodeSize,\n    activeNodeSize,\n    inactiveNodeSize,\n    nodeColor = canvasDefaultProps.nodeColor,\n    fixNodeColorAtDepth = canvasDefaultProps.fixNodeColorAtDepth,\n    renderNode = canvasDefaultProps.renderNode,\n    linkCurve = canvasDefaultProps.linkCurve,\n    linkThickness = canvasDefaultProps.linkThickness,\n    activeLinkThickness,\n    inactiveLinkThickness,\n    linkColor = canvasDefaultProps.linkColor,\n    renderLink = canvasDefaultProps.renderLink,\n    enableLabel = canvasDefaultProps.enableLabel,\n    label = canvasDefaultProps.label,\n    labelsPosition = canvasDefaultProps.labelsPosition,\n    orientLabel = canvasDefaultProps.orientLabel,\n    labelOffset = canvasDefaultProps.labelOffset,\n    renderLabel = canvasDefaultProps.renderLabel,\n    layers = canvasDefaultProps.layers,\n    isInteractive = canvasDefaultProps.isInteractive,\n    meshDetectionRadius = canvasDefaultProps.meshDetectionRadius,\n    debugMesh = canvasDefaultProps.debugMesh,\n    highlightAncestorNodes = canvasDefaultProps.highlightAncestorNodes,\n    highlightDescendantNodes = canvasDefaultProps.highlightDescendantNodes,\n    highlightAncestorLinks = canvasDefaultProps.highlightAncestorLinks,\n    highlightDescendantLinks = canvasDefaultProps.highlightDescendantLinks,\n    onNodeMouseEnter,\n    onNodeMouseMove,\n    onNodeMouseLeave,\n    onNodeMouseDown,\n    onNodeMouseUp,\n    onNodeClick,\n    onNodeDoubleClick,\n    nodeTooltip,\n    nodeTooltipPosition = canvasDefaultProps.nodeTooltipPosition,\n    nodeTooltipAnchor = canvasDefaultProps.nodeTooltipAnchor,\n    role = canvasDefaultProps.role,\n    ariaLabel,\n    ariaLabelledBy,\n    ariaDescribedBy,\n    forwardedRef,\n}: InnerTreeCanvasProps<Datum>) => {\n    const canvasEl = useRef<HTMLCanvasElement | null>(null)\n\n    const { outerWidth, outerHeight, margin, innerWidth, innerHeight } = useDimensions(\n        width,\n        height,\n        partialMargin\n    )\n\n    const theme = useTheme()\n\n    const { nodes, nodeByUid, links, linkGenerator, setCurrentNode } = useTree<Datum>({\n        data,\n        identity,\n        layout,\n        mode,\n        width: innerWidth,\n        height: innerHeight,\n        nodeSize,\n        activeNodeSize,\n        inactiveNodeSize,\n        nodeColor,\n        fixNodeColorAtDepth,\n        highlightAncestorNodes,\n        highlightDescendantNodes,\n        linkCurve,\n        linkThickness,\n        activeLinkThickness,\n        inactiveLinkThickness,\n        linkColor,\n        highlightAncestorLinks,\n        highlightDescendantLinks,\n    })\n\n    const labels = useLabels<Datum>({\n        nodes,\n        label,\n        layout,\n        labelsPosition,\n        orientLabel,\n        labelOffset,\n    })\n\n    const renderTooltip = useMemo(() => {\n        if (!nodeTooltip) return undefined\n        return (node: ComputedNode<Datum>) => createElement(nodeTooltip, { node })\n    }, [nodeTooltip])\n\n    const {\n        delaunay,\n        voronoi,\n        handleMouseEnter,\n        handleMouseMove,\n        handleMouseLeave,\n        handleMouseDown,\n        handleMouseUp,\n        handleClick,\n        handleDoubleClick,\n        current,\n    } = useMesh<ComputedNode<Datum>, HTMLCanvasElement>({\n        elementRef: canvasEl,\n        nodes,\n        width: innerWidth,\n        height: innerHeight,\n        margin,\n        detectionRadius: meshDetectionRadius,\n        isInteractive,\n        setCurrent: setCurrentNode,\n        onMouseEnter: onNodeMouseEnter,\n        onMouseMove: onNodeMouseMove,\n        onMouseLeave: onNodeMouseLeave,\n        onMouseDown: onNodeMouseDown,\n        onMouseUp: onNodeMouseUp,\n        onClick: onNodeClick,\n        onDoubleClick: onNodeDoubleClick,\n        tooltip: renderTooltip,\n        tooltipPosition: nodeTooltipPosition,\n        tooltipAnchor: nodeTooltipAnchor,\n        debug: debugMesh,\n    })\n\n    const customLayerProps: CustomCanvasLayerProps<Datum> = useMemo(\n        () => ({\n            nodes,\n            nodeByUid,\n            links,\n            innerWidth,\n            innerHeight,\n            linkGenerator,\n        }),\n        [nodes, nodeByUid, links, innerWidth, innerHeight, linkGenerator]\n    )\n\n    useEffect(() => {\n        if (canvasEl.current === null) return\n\n        canvasEl.current.width = outerWidth * pixelRatio\n        canvasEl.current.height = outerHeight * pixelRatio\n\n        const ctx = canvasEl.current.getContext('2d')!\n\n        ctx.scale(pixelRatio, pixelRatio)\n\n        ctx.fillStyle = theme.background\n        ctx.fillRect(0, 0, outerWidth, outerHeight)\n\n        ctx.translate(margin.left, margin.top)\n\n        layers.forEach(layer => {\n            if (layer === 'links') {\n                linkGenerator.context(ctx)\n\n                links.forEach(link => {\n                    renderLink(ctx, { link, linkGenerator })\n                })\n            } else if (layer === 'nodes') {\n                nodes.forEach(node => {\n                    renderNode(ctx, { node })\n                })\n            } else if (layer === 'labels' && enableLabel) {\n                setCanvasFont(ctx, theme.labels.text)\n\n                labels.forEach(label => {\n                    renderLabel(ctx, { label, theme })\n                })\n            } else if (layer === 'mesh' && debugMesh && voronoi) {\n                ctx.save()\n                // The mesh should cover the whole chart, including margins.\n                ctx.translate(-margin.left, -margin.top)\n\n                renderDebugToCanvas(ctx, {\n                    delaunay,\n                    voronoi,\n                    detectionRadius: meshDetectionRadius,\n                    index: current !== null ? current[0] : null,\n                })\n\n                ctx.restore()\n            } else if (typeof layer === 'function') {\n                layer(ctx, customLayerProps)\n            }\n        })\n    }, [\n        canvasEl,\n        outerWidth,\n        outerHeight,\n        pixelRatio,\n        margin.left,\n        margin.top,\n        theme,\n        layers,\n        nodes,\n        nodeByUid,\n        renderNode,\n        links,\n        renderLink,\n        linkGenerator,\n        labels,\n        enableLabel,\n        renderLabel,\n        delaunay,\n        voronoi,\n        meshDetectionRadius,\n        debugMesh,\n        current,\n        customLayerProps,\n    ])\n\n    return (\n        <canvas\n            ref={mergeRefs(canvasEl, forwardedRef)}\n            width={outerWidth * pixelRatio}\n            height={outerHeight * pixelRatio}\n            style={{\n                width: outerWidth,\n                height: outerHeight,\n                cursor: isInteractive ? 'auto' : 'normal',\n            }}\n            onMouseEnter={handleMouseEnter}\n            onMouseMove={handleMouseMove}\n            onMouseLeave={handleMouseLeave}\n            onMouseDown={handleMouseDown}\n            onMouseUp={handleMouseUp}\n            onClick={handleClick}\n            onDoubleClick={handleDoubleClick}\n            role={role}\n            aria-label={ariaLabel}\n            aria-labelledby={ariaLabelledBy}\n            aria-describedby={ariaDescribedBy}\n        />\n    )\n}\n\nexport const TreeCanvas = forwardRef(\n    <Datum = DefaultDatum,>(\n        {\n            isInteractive = canvasDefaultProps.isInteractive,\n            animate = canvasDefaultProps.animate,\n            motionConfig = canvasDefaultProps.motionConfig,\n            theme,\n            renderWrapper,\n            ...props\n        }: TreeCanvasProps<Datum>,\n        ref: Ref<HTMLCanvasElement>\n    ) => (\n        <Container\n            animate={animate}\n            isInteractive={isInteractive}\n            motionConfig={motionConfig}\n            renderWrapper={renderWrapper}\n            theme={theme}\n        >\n            <InnerTreeCanvas<Datum> {...props} isInteractive={isInteractive} forwardedRef={ref} />\n        </Container>\n    )\n) as <Datum = DefaultDatum>(\n    props: WithChartRef<TreeCanvasProps<Datum>, HTMLCanvasElement>\n) => ReactElement\n","import { forwardRef, Ref, ReactElement } from 'react'\nimport { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core'\nimport { TreeCanvasProps, DefaultDatum } from './types'\nimport { TreeCanvas } from './TreeCanvas'\n\nexport const ResponsiveTreeCanvas = forwardRef(\n    <Datum = DefaultDatum,>(\n        {\n            defaultWidth,\n            defaultHeight,\n            onResize,\n            debounceResize,\n            ...props\n        }: ResponsiveProps<TreeCanvasProps<Datum>>,\n        ref: Ref<HTMLCanvasElement>\n    ) => (\n        <ResponsiveWrapper\n            defaultWidth={defaultWidth}\n            defaultHeight={defaultHeight}\n            onResize={onResize}\n            debounceResize={debounceResize}\n        >\n            {({ width, height }) => (\n                <TreeCanvas<Datum> {...props} width={width} height={height} ref={ref} />\n            )}\n        </ResponsiveWrapper>\n    )\n) as <Datum = DefaultDatum>(\n    props: WithChartRef<ResponsiveProps<TreeCanvasProps<Datum>>, HTMLCanvasElement>\n) => ReactElement\n"],"names":["useRoot","_ref","data","mode","getIdentity","useMemo","root","d3Hierarchy","cluster","d3Tree","d3Cluster","eachBefore","node","ancestors","filter","ancestor","reverse","ancestorIds","map","uid","concat","join","ancestorUids","each","descendantUids","descendants","descendant","useNodeSizeModifier","size","undefined","useNodes","_ref3","xScale","yScale","layout","nodeSize","activeNodeSize","inactiveNodeSize","nodeColor","fixNodeColorAtDepth","intermediateNodes","x","y","id","path","isRoot","depth","isLeaf","height","getNodeSize","getActiveNodeSize","getInactiveNodeSize","getNodeColorBase","useOrdinalColorScale","getNodeColor","Infinity","nodeByUid","length","parent","color","_useState","useState","activeNodeUids","setActiveNodeUids","computed","nodes","intermediateNode","computedNode","_extends","isActive","includes","useLinkThicknessModifier","thickness","link","useTree","_ref7","width","_ref7$identity","identity","commonDefaultProps","_ref7$mode","_ref7$layout","_ref7$nodeSize","_ref7$nodeColor","_ref7$fixNodeColorAtD","_ref7$highlightAncest","highlightAncestorNodes","_ref7$highlightDescen","highlightDescendantNodes","_ref7$linkCurve","linkCurve","_ref7$linkThickness","linkThickness","_ref7$linkColor","linkColor","activeLinkThickness","inactiveLinkThickness","_ref7$highlightAncest2","highlightAncestorLinks","_ref7$highlightDescen2","highlightDescendantLinks","usePropertyAccessor","_useCartesianScales","_ref2","scaleLinear","domain","range","useCartesianScales","_useNodes","linkGenerator","_ref5","curve","curveFactory","curveLinear","curveBumpY","curveBumpX","curveStep","curveStepBefore","curveStepAfter","d3Link","useLinkGenerator","_useLinks","_ref4","intermediateLinks","links","source","target","getLinkThickness","getActiveLinkThickness","getInactiveLinkThickness","theme","useTheme","getLinkColor","useInheritedColor","_useState2","activeLinkIds","setActiveLinkIds","intermediateLink","computedLink","useLinks","setCurrentNode","_ref6","useCallback","nodeUids","linkIds","forEach","push","useSetCurrentNode","useNodeMouseEventHandlers","_ref8","isInteractive","onMouseEnter","onMouseMove","onMouseLeave","onMouseDown","onMouseUp","onClick","onDoubleClick","tooltip","tooltipPosition","tooltipAnchor","margin","_useTooltip","useTooltip","showTooltipFromEvent","showTooltipAt","hideTooltip","showTooltip","createElement","left","top","event","handleMouseEnter","handleMouseMove","handleMouseLeave","handleMouseDown","handleMouseUp","handleClick","handleDoubleClick","useLinkMouseEventHandlers","_ref9","_useTooltip2","scheme","from","modifiers","enableLabel","label","labelsPosition","orientLabel","labelOffset","useMesh","meshDetectionRadius","debugMesh","nodeTooltipPosition","nodeTooltipAnchor","role","animate","motionConfig","svgDefaultProps","layers","nodeComponent","animatedProps","eventHandlers","_jsx","animated","circle","r","to","fill","cx","cy","linkComponent","d","sourceX","sourceY","targetX","targetY","strokeWidth","stroke","labelComponent","g","transform","children","rotation","Text","style","labels","text","textAnchor","dominantBaseline","baseline","linkTooltipAnchor","canvasDefaultProps","renderNode","ctx","beginPath","arc","Math","PI","fillStyle","renderLink","strokeStyle","lineWidth","renderLabel","save","translate","rotate","degreesToRadians","textBaseline","textAlign","drawCanvasText","restore","pixelRatio","window","devicePixelRatio","regularTransition","leaveTransition","Links","_useMotionConfig","useMotionConfig","springConfig","config","transition","useTransition","keys","enter","update","leave","immediate","_Fragment","Nodes","horizontalLabelBefore","offset","horizontalLabelAfter","verticalLabelBefore","verticalLabelBeforeOriented","verticalLabelAfter","verticalLabelAfterOriented","verticalLeavesBeforeOthersAfter","orient","spacing","verticalLeavesAfterOthersBefore","verticalAllBefore","verticalAllAfter","horizontalLeavesBeforeOthersAfter","horizontalLeavesAfterOthersBefore","horizontalAllBefore","horizontalAllAfter","useLabels","_ref10","getLabel","getPosition","options","useGetLabelPosition","Error","Labels","pointerEvents","Mesh","memo","detectionRadius","debug","renderTooltip","BaseMesh","setCurrent","InnerTree","partialMargin","_ref$mode","_ref$layout","_ref$nodeSize","_ref$nodeColor","_ref$fixNodeColorAtDe","_ref$nodeComponent","_ref$linkCurve","_ref$linkThickness","_ref$linkColor","_ref$linkComponent","_ref$enableLabel","_ref$label","_ref$labelsPosition","_ref$orientLabel","_ref$labelOffset","_ref$labelComponent","_ref$layers","_ref$isInteractive","_ref$useMesh","_ref$meshDetectionRad","_ref$debugMesh","_ref$highlightAncesto","_ref$highlightDescend","_ref$highlightAncesto2","_ref$highlightDescend2","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeMouseDown","onNodeMouseUp","onNodeClick","onNodeDoubleClick","nodeTooltip","_ref$nodeTooltipPosit","_ref$nodeTooltipAncho","onLinkMouseEnter","onLinkMouseMove","onLinkMouseLeave","onLinkMouseDown","onLinkMouseUp","onLinkClick","onLinkDoubleClick","linkTooltip","_ref$linkTooltipAncho","_ref$role","ariaLabel","ariaLabelledBy","ariaDescribedBy","forwardedRef","_useDimensions","useDimensions","outerWidth","outerHeight","innerWidth","innerHeight","_useTree","layerById","mesh","customLayerProps","SvgWrapper","ref","layer","i","_layerById$layer","Fragment","Tree","forwardRef","_ref2$isInteractive","_ref2$animate","_ref2$motionConfig","renderWrapper","props","_objectWithoutPropertiesLoose","_excluded","Container","ResponsiveTree","defaultWidth","defaultHeight","onResize","debounceResize","ResponsiveWrapper","InnerTreeCanvas","_ref$pixelRatio","_ref$renderNode","_ref$renderLink","_ref$renderLabel","canvasEl","useRef","_useMesh","elementRef","delaunay","voronoi","current","useEffect","getContext","scale","background","fillRect","context","setCanvasFont","renderDebugToCanvas","index","mergeRefs","cursor","TreeCanvas","ResponsiveTreeCanvas"],"mappings":"m1CAyCaA,EAAU,SAAHC,GAAA,IAChBC,EAAID,EAAJC,KACAC,EAAIF,EAAJE,KACAC,EAAWH,EAAXG,YAAW,OAMXC,GAAQ,WACJ,IAAMC,EAAOC,EAAmBL,GAC1BM,EAAmB,SAATL,EAAkBM,IAAkBC,IAuBpD,OArBAJ,EAAKK,YAAW,SAAAC,GACZ,IAAMC,EAAYD,EACbC,YACAC,QAAO,SAAAC,GAAQ,OAAIA,IAAaH,KAChCI,UACCC,EAAcJ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