{"version":3,"file":"nivo-treemap.mjs","sources":["../src/transitions.ts","../src/TreeMapNode.tsx","../src/TreeMapNodeTooltip.tsx","../src/TreeMapHtmlNode.tsx","../src/defaults.ts","../src/tiling.ts","../src/hooks.ts","../src/TreeMapNodes.tsx","../src/TreeMap.tsx","../src/ResponsiveTreeMap.tsx","../src/TreeMapHtml.tsx","../src/ResponsiveTreeMapHtml.tsx","../src/TreeMapCanvas.tsx","../src/ResponsiveTreeMapCanvas.tsx"],"sourcesContent":["import { to, SpringValue } from '@react-spring/web'\n\nexport const svgNodeTransform = (x: SpringValue<number>, y: SpringValue<number>) =>\n    to([x, y], (x, y) => `translate(${x},${y})`)\n\nexport const htmlNodeTransform = (x: SpringValue<number>, y: SpringValue<number>) =>\n    to([x, y], (x, y) => `translate(${x}px, ${y}px)`)\n\nexport const svgLabelTransform = (\n    x: SpringValue<number>,\n    y: SpringValue<number>,\n    rotation: SpringValue<number>\n) => to([x, y, rotation], (x, y, rotation) => `translate(${x},${y}) rotate(${rotation})`)\n\nexport const htmlLabelTransform = (\n    x: SpringValue<number>,\n    y: SpringValue<number>,\n    rotation: SpringValue<number>\n) => to([x, y, rotation], (x, y, rotation) => `translate(${x}px,${y}px) rotate(${rotation}deg)`)\n\nexport const htmlParentLabelTransform = (\n    x: SpringValue<number>,\n    y: SpringValue<number>,\n    rotation: SpringValue<number>\n) =>\n    to(\n        [x, y, rotation],\n        (x, y, rotation) =>\n            `translate(${x - (rotation === 0 ? 0 : 5)}px,${\n                y - (rotation === 0 ? 5 : 0)\n            }px) rotate(${rotation}deg)`\n    )\n","import { memo } from 'react'\nimport { animated, to } from '@react-spring/web'\nimport { useTheme } from '@nivo/theming'\nimport { Text } from '@nivo/text'\nimport { NodeProps } from './types'\nimport { svgNodeTransform, svgLabelTransform } from './transitions'\n\nconst NonMemoizedTreeMapNode = <Datum extends object>({\n    node,\n    animatedProps,\n    borderWidth,\n    enableLabel,\n    enableParentLabel,\n    labelSkipSize,\n}: NodeProps<Datum>) => {\n    const theme = useTheme()\n\n    const showLabel =\n        enableLabel &&\n        node.isLeaf &&\n        (labelSkipSize === 0 || Math.min(node.width, node.height) > labelSkipSize)\n\n    const showParentLabel = enableParentLabel && node.isParent\n\n    return (\n        <animated.g transform={svgNodeTransform(animatedProps.x, animatedProps.y)}>\n            <animated.rect\n                data-testid={`node.${node.id}`}\n                width={to(animatedProps.width, v => Math.max(v, 0))}\n                height={to(animatedProps.height, v => Math.max(v, 0))}\n                fill={node.fill ? node.fill : animatedProps.color}\n                strokeWidth={borderWidth}\n                stroke={node.borderColor}\n                fillOpacity={node.opacity}\n                onMouseEnter={node.onMouseEnter}\n                onMouseMove={node.onMouseMove}\n                onMouseLeave={node.onMouseLeave}\n                onClick={node.onClick}\n            />\n            {showLabel && (\n                <Text\n                    data-testid={`label.${node.id}`}\n                    textAnchor=\"middle\"\n                    dominantBaseline=\"central\"\n                    style={{\n                        ...theme.labels.text,\n                        fill: node.labelTextColor,\n                        pointerEvents: 'none',\n                    }}\n                    fillOpacity={animatedProps.labelOpacity}\n                    transform={svgLabelTransform(\n                        animatedProps.labelX,\n                        animatedProps.labelY,\n                        animatedProps.labelRotation\n                    )}\n                >\n                    {node.label}\n                </Text>\n            )}\n            {showParentLabel && (\n                <Text\n                    data-testid={`parentLabel.${node.id}`}\n                    dominantBaseline=\"central\"\n                    style={{\n                        ...theme.labels.text,\n                        fill: node.parentLabelTextColor,\n                        pointerEvents: 'none',\n                    }}\n                    fillOpacity={animatedProps.parentLabelOpacity}\n                    transform={svgLabelTransform(\n                        animatedProps.parentLabelX,\n                        animatedProps.parentLabelY,\n                        animatedProps.parentLabelRotation\n                    )}\n                >\n                    {node.parentLabel}\n                </Text>\n            )}\n        </animated.g>\n    )\n}\n\nexport const TreeMapNode = memo(NonMemoizedTreeMapNode) as typeof NonMemoizedTreeMapNode\n","import { memo } from 'react'\nimport { BasicTooltip } from '@nivo/tooltip'\nimport { TooltipProps } from './types'\n\nconst NonMemoizedTreeMapNodeTooltip = <Datum extends object>({ node }: TooltipProps<Datum>) => (\n    <BasicTooltip id={node.id} value={node.formattedValue} enableChip={true} color={node.color} />\n)\n\nexport const TreeMapNodeTooltip = memo(\n    NonMemoizedTreeMapNodeTooltip\n) as typeof NonMemoizedTreeMapNodeTooltip\n","import { memo } from 'react'\nimport { animated } from '@react-spring/web'\nimport { useTheme } from '@nivo/theming'\nimport { NodeProps } from './types'\nimport { htmlNodeTransform, htmlLabelTransform, htmlParentLabelTransform } from './transitions'\n\nconst NonMemoizedTreeMapHtmlNode = <Datum extends object>({\n    node,\n    animatedProps,\n    borderWidth,\n    enableLabel,\n    enableParentLabel,\n    labelSkipSize,\n}: NodeProps<Datum>) => {\n    const theme = useTheme()\n\n    const showLabel =\n        enableLabel &&\n        node.isLeaf &&\n        (labelSkipSize === 0 || Math.min(node.width, node.height) > labelSkipSize)\n\n    const showParentLabel = enableParentLabel && node.isParent\n\n    return (\n        <animated.div\n            data-testid={`node.${node.id}`}\n            id={node.path.replace(/[^\\w]/gi, '-')}\n            style={{\n                boxSizing: 'border-box',\n                position: 'absolute',\n                top: 0,\n                left: 0,\n                transform: htmlNodeTransform(animatedProps.x, animatedProps.y),\n                width: animatedProps.width,\n                height: animatedProps.height,\n                borderWidth,\n                borderStyle: 'solid',\n                borderColor: node.borderColor,\n                overflow: 'hidden',\n            }}\n        >\n            <animated.div\n                style={{\n                    boxSizing: 'border-box',\n                    position: 'absolute',\n                    top: 0,\n                    left: 0,\n                    opacity: node.opacity,\n                    width: animatedProps.width,\n                    height: animatedProps.height,\n                    background: animatedProps.color,\n                }}\n                onMouseEnter={node.onMouseEnter}\n                onMouseMove={node.onMouseMove}\n                onMouseLeave={node.onMouseLeave}\n                onClick={node.onClick}\n            />\n            {showLabel && (\n                <animated.span\n                    data-testid={`label.${node.id}`}\n                    style={{\n                        ...theme.labels.text,\n                        position: 'absolute',\n                        display: 'flex',\n                        top: -5,\n                        left: -5,\n                        width: 10,\n                        height: 10,\n                        justifyContent: 'center',\n                        alignItems: 'center',\n                        whiteSpace: 'nowrap',\n                        color: node.labelTextColor,\n                        transformOrigin: 'center center',\n                        transform: htmlLabelTransform(\n                            animatedProps.labelX,\n                            animatedProps.labelY,\n                            animatedProps.labelRotation\n                        ),\n                        opacity: animatedProps.labelOpacity,\n                        pointerEvents: 'none',\n                    }}\n                >\n                    {node.label}\n                </animated.span>\n            )}\n            {showParentLabel && (\n                <animated.span\n                    data-testid={`parentLabel.${node.id}`}\n                    style={{\n                        ...theme.labels.text,\n                        position: 'absolute',\n                        display: 'flex',\n                        justifyContent: 'flex-start',\n                        alignItems: 'center',\n                        whiteSpace: 'nowrap',\n                        width: 10,\n                        height: 10,\n                        color: node.parentLabelTextColor,\n                        transformOrigin: 'top left',\n                        transform: htmlParentLabelTransform(\n                            animatedProps.parentLabelX,\n                            animatedProps.parentLabelY,\n                            animatedProps.parentLabelRotation\n                        ),\n                        opacity: animatedProps.parentLabelOpacity,\n                        pointerEvents: 'none',\n                    }}\n                >\n                    {node.parentLabel}\n                </animated.span>\n            )}\n        </animated.div>\n    )\n}\n\nexport const TreeMapHtmlNode = memo(NonMemoizedTreeMapHtmlNode) as typeof NonMemoizedTreeMapHtmlNode\n","import { TreeMapCommonProps, DefaultTreeMapDatum, LayerId } from './types'\nimport { TreeMapNode } from './TreeMapNode'\nimport { TreeMapNodeTooltip } from './TreeMapNodeTooltip'\nimport { TreeMapHtmlNode } from './TreeMapHtmlNode'\n\nexport const commonDefaultProps: Omit<\n    TreeMapCommonProps<DefaultTreeMapDatum>,\n    | 'valueFormat'\n    | 'margin'\n    | 'theme'\n    | 'labelFormat'\n    | 'onMouseEnter'\n    | 'onMouseMove'\n    | 'onMouseLeave'\n    | 'onClick'\n    | 'renderWrapper'\n    | 'ariaLabel'\n    | 'ariaLabelledBy'\n    | 'ariaDescribedBy'\n> & {\n    layers: LayerId[]\n} = {\n    layers: ['nodes'],\n\n    identity: 'id',\n    value: 'value',\n\n    tile: 'squarify',\n    leavesOnly: false,\n    innerPadding: 0,\n    outerPadding: 0,\n\n    colors: { scheme: 'nivo' as const },\n    colorBy: 'pathComponents.1',\n    nodeOpacity: 0.33,\n\n    enableLabel: true,\n    label: 'formattedValue',\n    labelSkipSize: 0,\n    labelTextColor: { from: 'color', modifiers: [['darker', 1]] },\n    orientLabel: true,\n\n    enableParentLabel: true,\n    parentLabel: 'id',\n    parentLabelSize: 20,\n    parentLabelPosition: 'top',\n    parentLabelPadding: 6,\n    parentLabelTextColor: { from: 'color', modifiers: [['darker', 1]] },\n\n    borderWidth: 1,\n    borderColor: { from: 'color', modifiers: [['darker', 1]] },\n\n    isInteractive: true,\n    tooltip: TreeMapNodeTooltip,\n\n    role: 'img',\n\n    animate: true,\n    motionConfig: 'gentle',\n}\n\nexport const svgDefaultProps = {\n    ...commonDefaultProps,\n    nodeComponent: TreeMapNode,\n    defs: [],\n    fill: [],\n}\n\nexport const htmlDefaultProps = {\n    ...commonDefaultProps,\n    nodeComponent: TreeMapHtmlNode,\n}\n\nexport const canvasDefaultProps = {\n    ...commonDefaultProps,\n    pixelRatio: typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1,\n}\n","import {\n    treemapBinary,\n    treemapDice,\n    treemapSlice,\n    treemapSliceDice,\n    treemapSquarify,\n} from 'd3-hierarchy'\n\nexport const tileByType = {\n    binary: treemapBinary,\n    dice: treemapDice,\n    slice: treemapSlice,\n    sliceDice: treemapSliceDice,\n    squarify: treemapSquarify,\n} as const\n\nexport type TileType = keyof typeof tileByType\n","import { createElement, useCallback, useMemo, MouseEvent } from 'react'\nimport omit from 'lodash/omit.js'\nimport cloneDeep from 'lodash/cloneDeep.js'\nimport startCase from 'lodash/startCase.js'\nimport {\n    treemap as d3Treemap,\n    hierarchy,\n    HierarchyNode,\n    HierarchyRectangularNode,\n} from 'd3-hierarchy'\nimport { useValueFormatter, PropertyAccessor, usePropertyAccessor } from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { useOrdinalColorScale, useInheritedColor } from '@nivo/colors'\nimport { useTooltip } from '@nivo/tooltip'\nimport { commonDefaultProps } from './defaults'\nimport {\n    DefaultTreeMapDatum,\n    TreeMapCommonProps,\n    TreeMapDataProps,\n    ComputedNode,\n    ComputedNodeWithoutStyles,\n    ComputedNodeWithHandlers,\n    CustomLayerProps,\n} from './types'\nimport { tileByType } from './tiling'\n\nexport const useTreeMapLayout = <Datum extends object>({\n    width,\n    height,\n    tile,\n    innerPadding,\n    outerPadding,\n    enableParentLabel,\n    parentLabelSize,\n    parentLabelPosition,\n    leavesOnly,\n}: {\n    width: number\n    height: number\n    tile: TreeMapCommonProps<Datum>['tile']\n    innerPadding: TreeMapCommonProps<Datum>['innerPadding']\n    outerPadding: TreeMapCommonProps<Datum>['outerPadding']\n    enableParentLabel: TreeMapCommonProps<Datum>['enableParentLabel']\n    parentLabelSize: TreeMapCommonProps<Datum>['parentLabelSize']\n    parentLabelPosition: TreeMapCommonProps<Datum>['parentLabelPosition']\n    leavesOnly: TreeMapCommonProps<Datum>['leavesOnly']\n}) =>\n    useMemo(() => {\n        const treemap = d3Treemap<Datum>()\n            .size([width, height])\n            .tile(tileByType[tile])\n            .round(true)\n            .paddingInner(innerPadding)\n            .paddingOuter(outerPadding)\n\n        if (enableParentLabel && !leavesOnly) {\n            const parentLabelPadding = parentLabelSize + outerPadding * 2\n            // @ts-expect-error dynamic function call\n            treemap[`padding${startCase(parentLabelPosition)}`](parentLabelPadding)\n        }\n\n        return treemap\n    }, [\n        width,\n        height,\n        tile,\n        innerPadding,\n        outerPadding,\n        enableParentLabel,\n        parentLabelSize,\n        parentLabelPosition,\n        leavesOnly,\n    ])\n\nexport const useHierarchy = <Datum extends object>({\n    root,\n    getValue,\n}: {\n    root: Datum\n    getValue: (datum: Datum) => number\n}) => useMemo(() => hierarchy<Datum>(root).sum(getValue), [root, getValue])\n\nconst computeNodeIdAndPath = <Datum extends object>(\n    node: HierarchyNode<Datum>,\n    getIdentity: (node: Datum) => string\n) => {\n    const path = node\n        .ancestors()\n        .map(ancestor => getIdentity(ancestor.data))\n        .reverse()\n\n    return { path: path.join('.'), pathComponents: path }\n}\n\nexport const useTreeMap = <Datum extends object = DefaultTreeMapDatum>({\n    data,\n    width,\n    height,\n    identity = commonDefaultProps.identity as PropertyAccessor<Datum, string>,\n    value = commonDefaultProps.value as PropertyAccessor<Datum, number>,\n    valueFormat,\n    leavesOnly = commonDefaultProps.leavesOnly,\n    tile = commonDefaultProps.tile,\n    innerPadding = commonDefaultProps.innerPadding,\n    outerPadding = commonDefaultProps.outerPadding,\n    label = commonDefaultProps.label as TreeMapCommonProps<Datum>['label'],\n    orientLabel = commonDefaultProps.orientLabel,\n    enableParentLabel = commonDefaultProps.enableParentLabel,\n    parentLabel = commonDefaultProps.parentLabel as TreeMapCommonProps<Datum>['parentLabel'],\n    parentLabelSize = commonDefaultProps.parentLabelSize,\n    parentLabelPosition = commonDefaultProps.parentLabelPosition,\n    parentLabelPadding = commonDefaultProps.parentLabelPadding,\n    colors = commonDefaultProps.colors as TreeMapCommonProps<Datum>['colors'],\n    colorBy = commonDefaultProps.colorBy as TreeMapCommonProps<Datum>['colorBy'],\n    nodeOpacity = commonDefaultProps.nodeOpacity,\n    borderColor = commonDefaultProps.borderColor as TreeMapCommonProps<Datum>['borderColor'],\n    labelTextColor = commonDefaultProps.labelTextColor as TreeMapCommonProps<Datum>['labelTextColor'],\n    parentLabelTextColor = commonDefaultProps.parentLabelTextColor as TreeMapCommonProps<Datum>['parentLabelTextColor'],\n}: {\n    data: TreeMapDataProps<Datum>['data']\n    width: number\n    height: number\n    identity?: TreeMapCommonProps<Datum>['identity']\n    value?: TreeMapCommonProps<Datum>['value']\n    valueFormat?: TreeMapCommonProps<Datum>['valueFormat']\n    tile?: TreeMapCommonProps<Datum>['tile']\n    leavesOnly?: TreeMapCommonProps<Datum>['leavesOnly']\n    innerPadding?: TreeMapCommonProps<Datum>['innerPadding']\n    outerPadding?: TreeMapCommonProps<Datum>['outerPadding']\n    label?: TreeMapCommonProps<Datum>['label']\n    orientLabel?: TreeMapCommonProps<Datum>['orientLabel']\n    enableParentLabel?: TreeMapCommonProps<Datum>['enableParentLabel']\n    parentLabel?: TreeMapCommonProps<Datum>['parentLabel']\n    parentLabelSize?: TreeMapCommonProps<Datum>['parentLabelSize']\n    parentLabelPosition?: TreeMapCommonProps<Datum>['parentLabelPosition']\n    parentLabelPadding?: TreeMapCommonProps<Datum>['parentLabelPadding']\n    colors?: TreeMapCommonProps<Datum>['colors']\n    colorBy?: TreeMapCommonProps<Datum>['colorBy']\n    nodeOpacity?: TreeMapCommonProps<Datum>['nodeOpacity']\n    borderColor?: TreeMapCommonProps<Datum>['borderColor']\n    labelTextColor?: TreeMapCommonProps<Datum>['labelTextColor']\n    parentLabelTextColor?: TreeMapCommonProps<Datum>['parentLabelTextColor']\n}) => {\n    const getIdentity = usePropertyAccessor(identity)\n    const getValue = usePropertyAccessor(value)\n    const formatValue = useValueFormatter(valueFormat)\n    const getLabel = usePropertyAccessor(label)\n    const getParentLabel = usePropertyAccessor(parentLabel)\n\n    const layout = useTreeMapLayout<Datum>({\n        width,\n        height,\n        tile,\n        innerPadding,\n        outerPadding,\n        enableParentLabel,\n        parentLabelSize,\n        parentLabelPosition,\n        leavesOnly,\n    })\n\n    const hierarchy = useHierarchy<Datum>({ root: data, getValue })\n\n    const rawNodes = useMemo(() => {\n        // d3 treemap mutates the data, so we need to copy it\n        // to have proper behavior for subsequents useMemo()\n        const root = cloneDeep(hierarchy)\n        layout(root)\n\n        return (\n            leavesOnly ? root.leaves() : root.descendants()\n        ) as HierarchyRectangularNode<Datum>[]\n    }, [hierarchy, layout, leavesOnly])\n\n    const nodes = useMemo(\n        () =>\n            rawNodes.map(rawNode => {\n                const { path, pathComponents } = computeNodeIdAndPath(rawNode, getIdentity)\n\n                const node = {\n                    id: getIdentity(rawNode.data),\n                    path,\n                    pathComponents,\n                    data: omit(rawNode.data, 'children'),\n                    x: rawNode.x0,\n                    y: rawNode.y0,\n                    width: rawNode.x1 - rawNode.x0,\n                    height: rawNode.y1 - rawNode.y0,\n                    value: rawNode.value!,\n                    formattedValue: formatValue(rawNode.value!),\n                    treeDepth: rawNode.depth,\n                    treeHeight: rawNode.height,\n                    isParent: rawNode.height > 0,\n                    isLeaf: rawNode.height === 0,\n                    parentLabelX: 0,\n                    parentLabelY: 0,\n                    parentLabelRotation: 0,\n                } as ComputedNodeWithoutStyles<Datum>\n\n                node.labelRotation = orientLabel && node.height > node.width ? -90 : 0\n\n                if (parentLabelPosition === 'top') {\n                    node.parentLabelX = outerPadding + parentLabelPadding\n                    node.parentLabelY = outerPadding + parentLabelSize / 2\n                }\n                if (parentLabelPosition === 'right') {\n                    node.parentLabelX = node.width - outerPadding - parentLabelSize / 2\n                    node.parentLabelY = node.height - outerPadding - parentLabelPadding\n                    node.parentLabelRotation = -90\n                }\n                if (parentLabelPosition === 'bottom') {\n                    node.parentLabelX = outerPadding + parentLabelPadding\n                    node.parentLabelY = node.height - outerPadding - parentLabelSize / 2\n                }\n                if (parentLabelPosition === 'left') {\n                    node.parentLabelX = outerPadding + parentLabelSize / 2\n                    node.parentLabelY = node.height - outerPadding - parentLabelPadding\n                    node.parentLabelRotation = -90\n                }\n\n                node.label = getLabel(node)\n                node.parentLabel = getParentLabel(node)\n\n                return node\n            }),\n        [\n            rawNodes,\n            getIdentity,\n            formatValue,\n            getLabel,\n            orientLabel,\n            getParentLabel,\n            parentLabelSize,\n            parentLabelPosition,\n            parentLabelPadding,\n            outerPadding,\n        ]\n    )\n\n    const theme = useTheme()\n    const getColor = useOrdinalColorScale(colors, colorBy)\n    const getBorderColor = useInheritedColor(borderColor, theme)\n    const getLabelTextColor = useInheritedColor(labelTextColor, theme)\n    const getParentLabelTextColor = useInheritedColor(parentLabelTextColor, theme)\n\n    const nodesWithStyles = useMemo(\n        () =>\n            nodes.map(node => {\n                const nodeWithStyles = {\n                    ...node,\n                    color: getColor(node),\n                    opacity: nodeOpacity,\n                } as ComputedNode<Datum>\n\n                nodeWithStyles.borderColor = getBorderColor(nodeWithStyles)\n                nodeWithStyles.labelTextColor = getLabelTextColor(nodeWithStyles)\n                nodeWithStyles.parentLabelTextColor = getParentLabelTextColor(nodeWithStyles)\n\n                return nodeWithStyles\n            }),\n        [nodes, getColor, nodeOpacity, getBorderColor, getLabelTextColor, getParentLabelTextColor]\n    )\n\n    return {\n        hierarchy,\n        nodes: nodesWithStyles,\n        layout,\n    }\n}\n\nexport const useInteractiveTreeMapNodes = <Datum extends object>(\n    nodes: ComputedNode<Datum>[],\n    {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        tooltip,\n    }: {\n        isInteractive: TreeMapCommonProps<Datum>['isInteractive']\n        onMouseEnter?: TreeMapCommonProps<Datum>['onMouseEnter']\n        onMouseMove?: TreeMapCommonProps<Datum>['onMouseMove']\n        onMouseLeave?: TreeMapCommonProps<Datum>['onMouseLeave']\n        onClick?: TreeMapCommonProps<Datum>['onClick']\n        tooltip: TreeMapCommonProps<Datum>['tooltip']\n    }\n): ComputedNodeWithHandlers<Datum>[] => {\n    const { showTooltipFromEvent, hideTooltip } = useTooltip()\n\n    const showTooltip = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            showTooltipFromEvent(createElement(tooltip, { node }), event, 'left')\n        },\n        [showTooltipFromEvent, tooltip]\n    )\n\n    const handleMouseEnter = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            showTooltip(node, event)\n            onMouseEnter?.(node, event)\n        },\n        [onMouseEnter, showTooltip]\n    )\n\n    const handleMouseMove = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            showTooltip(node, event)\n            onMouseMove?.(node, event)\n        },\n        [onMouseMove, showTooltip]\n    )\n\n    const handleMouseLeave = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            hideTooltip()\n            onMouseLeave?.(node, event)\n        },\n        [onMouseLeave, hideTooltip]\n    )\n\n    const handleClick = useCallback(\n        (node: ComputedNode<Datum>, event: MouseEvent) => {\n            onClick?.(node, event)\n        },\n        [onClick]\n    )\n\n    return useMemo(\n        () =>\n            nodes.map(node => {\n                if (!isInteractive) return node\n\n                return {\n                    ...node,\n                    onMouseEnter: (event: MouseEvent) => handleMouseEnter(node, event),\n                    onMouseMove: (event: MouseEvent) => handleMouseMove(node, event),\n                    onMouseLeave: (event: MouseEvent) => handleMouseLeave(node, event),\n                    onClick: (event: MouseEvent) => handleClick(node, event),\n                }\n            }),\n        [isInteractive, nodes, handleMouseEnter, handleMouseMove, handleMouseLeave, handleClick]\n    )\n}\n\nexport const useCustomLayerProps = <Datum extends object>({\n    nodes,\n}: CustomLayerProps<Datum>): CustomLayerProps<Datum> =>\n    useMemo(\n        () => ({\n            nodes,\n        }),\n        [nodes]\n    )\n","import { createElement, memo } from 'react'\nimport { useTransition } from '@react-spring/web'\nimport { useMotionConfig } from '@nivo/core'\nimport { useInteractiveTreeMapNodes } from './hooks'\nimport {\n    ComputedNode,\n    TreeMapCommonProps,\n    NodeAnimatedProps,\n    NodeComponent,\n    ComputedNodeWithHandlers,\n} from './types'\n\nconst getAnimatedNodeProps = <Datum extends object>(\n    node: ComputedNodeWithHandlers<Datum>\n): NodeAnimatedProps => ({\n    x: node.x,\n    y: node.y,\n    width: node.width,\n    height: node.height,\n    color: node.color,\n    labelX: node.width / 2,\n    labelY: node.height / 2,\n    labelRotation: node.labelRotation,\n    labelOpacity: 1,\n    parentLabelX: node.parentLabelX,\n    parentLabelY: node.parentLabelY,\n    parentLabelRotation: node.parentLabelRotation,\n    parentLabelOpacity: 1,\n})\n\nconst getEndingAnimatedNodeProps = <Datum extends object>(\n    node: ComputedNodeWithHandlers<Datum>\n): NodeAnimatedProps => {\n    const x = node.x + node.width / 2\n    const y = node.y + node.height / 2\n\n    return {\n        x,\n        y,\n        width: 0,\n        height: 0,\n        color: node.color,\n        labelX: 0,\n        labelY: 0,\n        labelRotation: node.labelRotation,\n        labelOpacity: 0,\n        parentLabelX: 0,\n        parentLabelY: 0,\n        parentLabelRotation: node.parentLabelRotation,\n        parentLabelOpacity: 0,\n    }\n}\n\ninterface TreeMapNodesProps<Datum extends object> {\n    nodes: ComputedNode<Datum>[]\n    nodeComponent: NodeComponent<Datum>\n    borderWidth: TreeMapCommonProps<Datum>['borderWidth']\n    enableLabel: TreeMapCommonProps<Datum>['enableLabel']\n    labelSkipSize: TreeMapCommonProps<Datum>['labelSkipSize']\n    enableParentLabel: TreeMapCommonProps<Datum>['enableParentLabel']\n    isInteractive: TreeMapCommonProps<Datum>['isInteractive']\n    onMouseEnter?: TreeMapCommonProps<Datum>['onMouseEnter']\n    onMouseMove?: TreeMapCommonProps<Datum>['onMouseMove']\n    onMouseLeave?: TreeMapCommonProps<Datum>['onMouseLeave']\n    onClick?: TreeMapCommonProps<Datum>['onClick']\n    tooltip: TreeMapCommonProps<Datum>['tooltip']\n}\n\nconst NonMemoizedTreeMapNodes = <Datum extends object>({\n    nodes,\n    nodeComponent,\n    borderWidth,\n    enableLabel,\n    labelSkipSize,\n    enableParentLabel,\n    isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onClick,\n    tooltip,\n}: TreeMapNodesProps<Datum>) => {\n    const nodesWithHandlers = useInteractiveTreeMapNodes<Datum>(nodes, {\n        isInteractive,\n        onMouseEnter,\n        onMouseMove,\n        onMouseLeave,\n        onClick,\n        tooltip,\n    })\n\n    const { animate, config: springConfig } = useMotionConfig()\n    const transition = useTransition<ComputedNodeWithHandlers<Datum>, NodeAnimatedProps>(\n        nodesWithHandlers,\n        {\n            keys: node => node.path,\n            initial: getAnimatedNodeProps,\n            from: getEndingAnimatedNodeProps,\n            enter: getAnimatedNodeProps,\n            update: getAnimatedNodeProps,\n            leave: getEndingAnimatedNodeProps,\n            config: springConfig,\n            immediate: !animate,\n        }\n    )\n\n    return (\n        <>\n            {transition((animatedProps, node) =>\n                createElement(nodeComponent, {\n                    key: node.path,\n                    node,\n                    animatedProps,\n                    borderWidth,\n                    enableLabel,\n                    labelSkipSize,\n                    enableParentLabel,\n                })\n            )}\n        </>\n    )\n}\n\nexport const TreeMapNodes = memo(NonMemoizedTreeMapNodes) as typeof NonMemoizedTreeMapNodes\n","import { createElement, Fragment, ReactNode, forwardRef, Ref, ReactElement } from 'react'\nimport {\n    SvgWrapper,\n    Container,\n    useDimensions,\n    // @ts-expect-error no types\n    bindDefs,\n    WithChartRef,\n} from '@nivo/core'\nimport { useTreeMap, useCustomLayerProps } from './hooks'\nimport { TreeMapNodes } from './TreeMapNodes'\nimport {\n    DefaultTreeMapDatum,\n    NodeComponent,\n    TreeMapCommonProps,\n    TreeMapSvgProps,\n    LayerId,\n} from './types'\nimport { svgDefaultProps } from './defaults'\n\ntype InnerTreeMapProps<Datum extends object> = Omit<\n    TreeMapSvgProps<Datum>,\n    'animate' | 'motionConfig' | 'renderWrapper' | 'theme'\n> & {\n    forwardedRef: Ref<SVGSVGElement>\n}\n\nconst InnerTreeMap = <Datum extends object>({\n    data,\n    identity = svgDefaultProps.identity as TreeMapCommonProps<Datum>['identity'],\n    value = svgDefaultProps.value as TreeMapCommonProps<Datum>['value'],\n    valueFormat,\n    tile = svgDefaultProps.tile,\n    nodeComponent = svgDefaultProps.nodeComponent as NodeComponent<Datum>,\n    innerPadding = svgDefaultProps.innerPadding,\n    outerPadding = svgDefaultProps.outerPadding,\n    leavesOnly = svgDefaultProps.leavesOnly,\n    width,\n    height,\n    margin: partialMargin,\n    layers = svgDefaultProps.layers as NonNullable<TreeMapSvgProps<Datum>['layers']>,\n    colors = svgDefaultProps.colors as TreeMapCommonProps<Datum>['colors'],\n    colorBy = svgDefaultProps.colorBy as TreeMapCommonProps<Datum>['colorBy'],\n    nodeOpacity = svgDefaultProps.nodeOpacity,\n    borderWidth = svgDefaultProps.borderWidth,\n    borderColor = svgDefaultProps.borderColor as TreeMapCommonProps<Datum>['borderColor'],\n    defs = svgDefaultProps.defs,\n    fill = svgDefaultProps.fill,\n    enableLabel = svgDefaultProps.enableLabel,\n    label = svgDefaultProps.label as TreeMapCommonProps<Datum>['label'],\n    labelTextColor = svgDefaultProps.labelTextColor as TreeMapCommonProps<Datum>['labelTextColor'],\n    orientLabel = svgDefaultProps.orientLabel,\n    labelSkipSize = svgDefaultProps.labelSkipSize,\n    enableParentLabel = svgDefaultProps.enableParentLabel,\n    parentLabel = svgDefaultProps.parentLabel as TreeMapCommonProps<Datum>['parentLabel'],\n    parentLabelSize = svgDefaultProps.parentLabelSize,\n    parentLabelPosition = svgDefaultProps.parentLabelPosition,\n    parentLabelPadding = svgDefaultProps.parentLabelPadding,\n    parentLabelTextColor = svgDefaultProps.parentLabelTextColor as TreeMapCommonProps<Datum>['parentLabelTextColor'],\n    isInteractive = svgDefaultProps.isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onClick,\n    tooltip = svgDefaultProps.tooltip as TreeMapCommonProps<Datum>['tooltip'],\n    role,\n    ariaLabel,\n    ariaLabelledBy,\n    ariaDescribedBy,\n    forwardedRef,\n}: InnerTreeMapProps<Datum>) => {\n    const { margin, innerWidth, innerHeight, outerWidth, outerHeight } = useDimensions(\n        width,\n        height,\n        partialMargin\n    )\n\n    const { nodes } = useTreeMap<Datum>({\n        data,\n        identity,\n        value,\n        valueFormat,\n        leavesOnly,\n        width: innerWidth,\n        height: innerHeight,\n        tile,\n        innerPadding,\n        outerPadding,\n        colors,\n        colorBy,\n        nodeOpacity,\n        borderColor,\n        label,\n        labelTextColor,\n        orientLabel,\n        enableParentLabel,\n        parentLabel,\n        parentLabelSize,\n        parentLabelPosition,\n        parentLabelPadding,\n        parentLabelTextColor,\n    })\n\n    const layerById: Record<LayerId, ReactNode> = {\n        nodes: null,\n    }\n\n    if (layers.includes('nodes')) {\n        layerById.nodes = (\n            <TreeMapNodes<Datum>\n                key=\"nodes\"\n                nodes={nodes}\n                nodeComponent={nodeComponent}\n                borderWidth={borderWidth}\n                enableLabel={enableLabel}\n                labelSkipSize={labelSkipSize}\n                enableParentLabel={enableParentLabel}\n                isInteractive={isInteractive}\n                onMouseEnter={onMouseEnter}\n                onMouseMove={onMouseMove}\n                onMouseLeave={onMouseLeave}\n                onClick={onClick}\n                tooltip={tooltip}\n            />\n        )\n    }\n\n    const customLayerProps = useCustomLayerProps<Datum>({ nodes })\n\n    const boundDefs = bindDefs(defs, nodes, fill)\n\n    return (\n        <SvgWrapper\n            width={outerWidth}\n            height={outerHeight}\n            margin={margin}\n            defs={boundDefs}\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 TreeMap = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            isInteractive = svgDefaultProps.isInteractive,\n            animate = svgDefaultProps.animate,\n            motionConfig = svgDefaultProps.motionConfig,\n            theme,\n            renderWrapper,\n            ...props\n        }: TreeMapSvgProps<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            <InnerTreeMap<Datum> {...props} isInteractive={isInteractive} forwardedRef={ref} />\n        </Container>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<TreeMapSvgProps<Datum>, SVGSVGElement>\n) => ReactElement\n","import { forwardRef, Ref, ReactElement } from 'react'\nimport { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core'\nimport { DefaultTreeMapDatum, TreeMapSvgProps } from './types'\nimport { TreeMap } from './TreeMap'\n\nexport const ResponsiveTreeMap = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            defaultWidth,\n            defaultHeight,\n            onResize,\n            debounceResize,\n            ...props\n        }: ResponsiveProps<TreeMapSvgProps<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                <TreeMap<Datum> {...props} width={width} height={height} ref={ref} />\n            )}\n        </ResponsiveWrapper>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<ResponsiveProps<TreeMapSvgProps<Datum>>, SVGSVGElement>\n) => ReactElement\n","import { createElement, Fragment, ReactNode, forwardRef, Ref, ReactElement } from 'react'\nimport { Container, useDimensions, WithChartRef } from '@nivo/core'\nimport { useCustomLayerProps, useTreeMap } from './hooks'\nimport { TreeMapNodes } from './TreeMapNodes'\nimport { DefaultTreeMapDatum, TreeMapCommonProps, TreeMapHtmlProps, LayerId } from './types'\nimport { htmlDefaultProps, svgDefaultProps } from './defaults'\n\ntype InnerTreeMapHtmlProps<Datum extends object> = Omit<\n    TreeMapHtmlProps<Datum>,\n    'animate' | 'motionConfig' | 'renderWrapper' | 'theme'\n> & {\n    forwardedRef: Ref<HTMLDivElement>\n}\n\nconst InnerTreeMapHtml = <Datum extends object>({\n    data,\n    identity = htmlDefaultProps.identity as TreeMapCommonProps<Datum>['identity'],\n    value = htmlDefaultProps.value as TreeMapCommonProps<Datum>['value'],\n    tile = htmlDefaultProps.tile,\n    nodeComponent = htmlDefaultProps.nodeComponent,\n    valueFormat,\n    innerPadding = htmlDefaultProps.innerPadding,\n    outerPadding = htmlDefaultProps.outerPadding,\n    leavesOnly = htmlDefaultProps.leavesOnly,\n    width,\n    height,\n    margin: partialMargin,\n    layers = svgDefaultProps.layers as NonNullable<TreeMapHtmlProps<Datum>['layers']>,\n    colors = htmlDefaultProps.colors as TreeMapCommonProps<Datum>['colors'],\n    colorBy = htmlDefaultProps.colorBy as TreeMapCommonProps<Datum>['colorBy'],\n    nodeOpacity = htmlDefaultProps.nodeOpacity,\n    borderWidth = htmlDefaultProps.borderWidth,\n    borderColor = htmlDefaultProps.borderColor as TreeMapCommonProps<Datum>['borderColor'],\n    enableLabel = htmlDefaultProps.enableLabel,\n    label = htmlDefaultProps.label as TreeMapCommonProps<Datum>['label'],\n    labelTextColor = htmlDefaultProps.labelTextColor as TreeMapCommonProps<Datum>['labelTextColor'],\n    orientLabel = htmlDefaultProps.orientLabel,\n    labelSkipSize = htmlDefaultProps.labelSkipSize,\n    enableParentLabel = htmlDefaultProps.enableParentLabel,\n    parentLabel = htmlDefaultProps.parentLabel as TreeMapCommonProps<Datum>['parentLabel'],\n    parentLabelSize = htmlDefaultProps.parentLabelSize,\n    parentLabelPosition = htmlDefaultProps.parentLabelPosition,\n    parentLabelPadding = htmlDefaultProps.parentLabelPadding,\n    parentLabelTextColor = htmlDefaultProps.parentLabelTextColor as TreeMapCommonProps<Datum>['parentLabelTextColor'],\n    isInteractive = htmlDefaultProps.isInteractive,\n    onMouseEnter,\n    onMouseMove,\n    onMouseLeave,\n    onClick,\n    tooltip = htmlDefaultProps.tooltip as TreeMapCommonProps<Datum>['tooltip'],\n    role,\n    ariaLabel,\n    ariaLabelledBy,\n    ariaDescribedBy,\n    forwardedRef,\n}: InnerTreeMapHtmlProps<Datum>) => {\n    const { margin, innerWidth, innerHeight, outerWidth, outerHeight } = useDimensions(\n        width,\n        height,\n        partialMargin\n    )\n\n    const { nodes } = useTreeMap<Datum>({\n        data,\n        identity,\n        value,\n        valueFormat,\n        leavesOnly,\n        width: innerWidth,\n        height: innerHeight,\n        tile,\n        innerPadding,\n        outerPadding,\n        colors,\n        colorBy,\n        nodeOpacity,\n        borderColor,\n        label,\n        labelTextColor,\n        orientLabel,\n        enableParentLabel,\n        parentLabel,\n        parentLabelSize,\n        parentLabelPosition,\n        parentLabelPadding,\n        parentLabelTextColor,\n    })\n\n    const layerById: Record<LayerId, ReactNode> = {\n        nodes: null,\n    }\n\n    if (layers.includes('nodes')) {\n        layerById.nodes = (\n            <TreeMapNodes<Datum>\n                key=\"nodes\"\n                nodes={nodes}\n                nodeComponent={nodeComponent}\n                borderWidth={borderWidth}\n                enableLabel={enableLabel}\n                labelSkipSize={labelSkipSize}\n                enableParentLabel={enableParentLabel}\n                isInteractive={isInteractive}\n                onMouseEnter={onMouseEnter}\n                onMouseMove={onMouseMove}\n                onMouseLeave={onMouseLeave}\n                onClick={onClick}\n                tooltip={tooltip}\n            />\n        )\n    }\n\n    const customLayerProps = useCustomLayerProps<Datum>({ nodes })\n\n    return (\n        <div\n            role={role}\n            aria-label={ariaLabel}\n            aria-labelledby={ariaLabelledBy}\n            aria-describedby={ariaDescribedBy}\n            style={{\n                position: 'relative',\n                width: outerWidth,\n                height: outerHeight,\n            }}\n            ref={forwardedRef}\n        >\n            <div style={{ position: 'absolute', top: margin.top, left: margin.left }}>\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            </div>\n        </div>\n    )\n}\n\nexport const TreeMapHtml = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            isInteractive = htmlDefaultProps.isInteractive,\n            animate = htmlDefaultProps.animate,\n            motionConfig = htmlDefaultProps.motionConfig,\n            theme,\n            renderWrapper,\n            ...props\n        }: TreeMapHtmlProps<Datum>,\n        ref: Ref<HTMLDivElement>\n    ) => (\n        <Container\n            animate={animate}\n            isInteractive={isInteractive}\n            motionConfig={motionConfig}\n            renderWrapper={renderWrapper}\n            theme={theme}\n        >\n            <InnerTreeMapHtml<Datum> {...props} isInteractive={isInteractive} forwardedRef={ref} />\n        </Container>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<TreeMapHtmlProps<Datum>, HTMLDivElement>\n) => ReactElement\n","import { forwardRef, Ref, ReactElement } from 'react'\nimport { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core'\nimport { DefaultTreeMapDatum, TreeMapHtmlProps } from './types'\nimport { TreeMapHtml } from './TreeMapHtml'\n\nexport const ResponsiveTreeMapHtml = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            defaultWidth,\n            defaultHeight,\n            onResize,\n            debounceResize,\n            ...props\n        }: ResponsiveProps<TreeMapHtmlProps<Datum>>,\n        ref: Ref<HTMLDivElement>\n    ) => (\n        <ResponsiveWrapper\n            defaultWidth={defaultWidth}\n            defaultHeight={defaultHeight}\n            onResize={onResize}\n            debounceResize={debounceResize}\n        >\n            {({ width, height }) => (\n                <TreeMapHtml<Datum> {...props} width={width} height={height} ref={ref} />\n            )}\n        </ResponsiveWrapper>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<ResponsiveProps<TreeMapHtmlProps<Datum>>, HTMLDivElement>\n) => ReactElement\n","import {\n    createElement,\n    useCallback,\n    useEffect,\n    useRef,\n    MouseEvent,\n    forwardRef,\n    Ref,\n    ReactElement,\n} from 'react'\nimport {\n    degreesToRadians,\n    getRelativeCursor,\n    isCursorInRect,\n    Container,\n    useDimensions,\n    Margin,\n    WithChartRef,\n    mergeRefs,\n} from '@nivo/core'\nimport { useTheme } from '@nivo/theming'\nimport { useTooltip } from '@nivo/tooltip'\nimport { setCanvasFont, drawCanvasText } from '@nivo/text'\nimport { useTreeMap } from './hooks'\nimport { ComputedNode, DefaultTreeMapDatum, TreeMapCanvasProps, TreeMapCommonProps } from './types'\nimport { canvasDefaultProps } from './defaults'\n\nconst findNodeUnderCursor = <Datum extends object>(\n    nodes: ComputedNode<Datum>[],\n    margin: Margin,\n    x: number,\n    y: number\n) =>\n    nodes.find(node =>\n        isCursorInRect(node.x + margin.left, node.y + margin.top, node.width, node.height, x, y)\n    )\n\ntype InnerTreeMapCanvasProps<Datum extends object> = Omit<\n    TreeMapCanvasProps<Datum>,\n    'renderWrapper' | 'theme'\n> & {\n    forwardedRef: Ref<HTMLCanvasElement>\n}\n\nconst InnerTreeMapCanvas = <Datum extends object>({\n    data,\n    identity = canvasDefaultProps.identity as TreeMapCommonProps<Datum>['identity'],\n    value = canvasDefaultProps.identity as TreeMapCommonProps<Datum>['value'],\n    tile = canvasDefaultProps.tile,\n    valueFormat,\n    innerPadding = canvasDefaultProps.innerPadding,\n    outerPadding = canvasDefaultProps.outerPadding,\n    leavesOnly = canvasDefaultProps.leavesOnly,\n    width,\n    height,\n    margin: partialMargin,\n    colors = canvasDefaultProps.colors as TreeMapCommonProps<Datum>['colors'],\n    colorBy = canvasDefaultProps.colorBy as TreeMapCommonProps<Datum>['colorBy'],\n    nodeOpacity = canvasDefaultProps.nodeOpacity,\n    borderWidth = canvasDefaultProps.borderWidth,\n    borderColor = canvasDefaultProps.borderColor as TreeMapCommonProps<Datum>['borderColor'],\n    enableLabel = canvasDefaultProps.enableLabel,\n    label = canvasDefaultProps.label as TreeMapCommonProps<Datum>['label'],\n    labelTextColor = canvasDefaultProps.labelTextColor as TreeMapCommonProps<Datum>['labelTextColor'],\n    orientLabel = canvasDefaultProps.orientLabel,\n    labelSkipSize = canvasDefaultProps.labelSkipSize,\n    isInteractive = canvasDefaultProps.isInteractive,\n    onMouseMove,\n    onClick,\n    tooltip = canvasDefaultProps.tooltip as TreeMapCommonProps<Datum>['tooltip'],\n    pixelRatio = canvasDefaultProps.pixelRatio,\n    role,\n    ariaLabel,\n    ariaLabelledBy,\n    ariaDescribedBy,\n    forwardedRef,\n}: InnerTreeMapCanvasProps<Datum>) => {\n    const canvasEl = useRef<HTMLCanvasElement | null>(null)\n\n    const { margin, innerWidth, innerHeight, outerWidth, outerHeight } = useDimensions(\n        width,\n        height,\n        partialMargin\n    )\n\n    const { nodes } = useTreeMap<Datum>({\n        data,\n        identity,\n        value,\n        valueFormat,\n        leavesOnly,\n        width: innerWidth,\n        height: innerHeight,\n        tile,\n        innerPadding,\n        outerPadding,\n        colors,\n        colorBy,\n        nodeOpacity,\n        borderColor,\n        label,\n        labelTextColor,\n        orientLabel,\n        enableParentLabel: false,\n    })\n\n    const theme = useTheme()\n\n    useEffect(() => {\n        if (canvasEl.current === null) return\n\n        const ctx = canvasEl.current.getContext('2d')\n        if (ctx === null) return\n\n        canvasEl.current.width = outerWidth * pixelRatio\n        canvasEl.current.height = outerHeight * pixelRatio\n\n        ctx.scale(pixelRatio, pixelRatio)\n\n        ctx.fillStyle = theme.background\n        ctx.fillRect(0, 0, outerWidth, outerHeight)\n        ctx.translate(margin.left, margin.top)\n\n        nodes.forEach(node => {\n            ctx.fillStyle = node.color\n            ctx.fillRect(node.x, node.y, node.width, node.height)\n\n            if (borderWidth > 0) {\n                ctx.strokeStyle = node.borderColor\n                ctx.lineWidth = borderWidth\n                ctx.strokeRect(node.x, node.y, node.width, node.height)\n            }\n        })\n\n        if (enableLabel) {\n            ctx.textAlign = 'center'\n            ctx.textBaseline = 'middle'\n            setCanvasFont(ctx, theme.labels.text)\n\n            nodes.forEach(node => {\n                const showLabel =\n                    node.isLeaf &&\n                    (labelSkipSize === 0 || Math.min(node.width, node.height) > labelSkipSize)\n\n                if (!showLabel) return\n\n                const rotate = orientLabel && node.height > node.width\n\n                ctx.save()\n                ctx.translate(node.x + node.width / 2, node.y + node.height / 2)\n                ctx.rotate(degreesToRadians(rotate ? -90 : 0))\n\n                drawCanvasText(\n                    ctx,\n                    {\n                        ...theme.labels.text,\n                        fill: node.labelTextColor,\n                    },\n                    String(node.label)\n                )\n\n                ctx.restore()\n            })\n        }\n    }, [\n        canvasEl,\n        nodes,\n        outerWidth,\n        outerHeight,\n        innerWidth,\n        innerHeight,\n        margin,\n        borderWidth,\n        enableLabel,\n        orientLabel,\n        labelSkipSize,\n        theme,\n        pixelRatio,\n    ])\n\n    const { showTooltipFromEvent, hideTooltip } = useTooltip()\n\n    const handleMouseHover = useCallback(\n        (event: MouseEvent<HTMLCanvasElement>) => {\n            if (canvasEl.current === null) return\n\n            const [x, y] = getRelativeCursor(canvasEl.current, event)\n            const node = findNodeUnderCursor(nodes, margin, x, y)\n\n            if (node !== undefined) {\n                showTooltipFromEvent(createElement(tooltip, { node }), event, 'left')\n                onMouseMove?.(node, event)\n            } else {\n                hideTooltip()\n            }\n        },\n        [canvasEl, nodes, margin, showTooltipFromEvent, hideTooltip, tooltip, onMouseMove]\n    )\n\n    const handleMouseLeave = useCallback(() => {\n        hideTooltip()\n    }, [hideTooltip])\n\n    const handleClick = useCallback(\n        (event: MouseEvent<HTMLCanvasElement>) => {\n            if (canvasEl.current === null) return\n\n            const [x, y] = getRelativeCursor(canvasEl.current, event)\n            const node = findNodeUnderCursor(nodes, margin, x, y)\n\n            if (node === undefined) return\n\n            onClick?.(node, event)\n        },\n        [canvasEl, nodes, margin, onClick]\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            }}\n            onMouseEnter={isInteractive ? handleMouseHover : undefined}\n            onMouseMove={isInteractive ? handleMouseHover : undefined}\n            onMouseLeave={isInteractive ? handleMouseLeave : undefined}\n            onClick={isInteractive ? handleClick : undefined}\n            role={role}\n            aria-label={ariaLabel}\n            aria-labelledby={ariaLabelledBy}\n            aria-describedby={ariaDescribedBy}\n        />\n    )\n}\n\nexport const TreeMapCanvas = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            theme,\n            isInteractive = canvasDefaultProps.isInteractive,\n            animate = canvasDefaultProps.animate,\n            motionConfig = canvasDefaultProps.motionConfig,\n            renderWrapper,\n            ...props\n        }: TreeMapCanvasProps<Datum>,\n        ref: Ref<HTMLCanvasElement>\n    ) => (\n        <Container\n            isInteractive={isInteractive}\n            animate={animate}\n            motionConfig={motionConfig}\n            theme={theme}\n            renderWrapper={renderWrapper}\n        >\n            <InnerTreeMapCanvas<Datum>\n                {...props}\n                isInteractive={isInteractive}\n                forwardedRef={ref}\n            />\n        </Container>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<TreeMapCanvasProps<Datum>, HTMLCanvasElement>\n) => ReactElement\n","import { forwardRef, Ref, ReactElement } from 'react'\nimport { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core'\nimport { DefaultTreeMapDatum, TreeMapCanvasProps } from './types'\nimport { TreeMapCanvas } from './TreeMapCanvas'\n\nexport const ResponsiveTreeMapCanvas = forwardRef(\n    <Datum extends object = DefaultTreeMapDatum>(\n        {\n            defaultWidth,\n            defaultHeight,\n            onResize,\n            debounceResize,\n            ...props\n        }: ResponsiveProps<TreeMapCanvasProps<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                <TreeMapCanvas<Datum> {...props} width={width} height={height} ref={ref} />\n            )}\n        </ResponsiveWrapper>\n    )\n) as <Datum extends object = DefaultTreeMapDatum>(\n    props: WithChartRef<ResponsiveProps<TreeMapCanvasProps<Datum>>, HTMLCanvasElement>\n) => ReactElement\n"],"names":["svgNodeTransform","x","y","to","htmlNodeTransform","svgLabelTransform","rotation","htmlLabelTransform","htmlParentLabelTransform","TreeMapNode","memo","_ref","node","animatedProps","borderWidth","enableLabel","enableParentLabel","labelSkipSize","theme","useTheme","showLabel","isLeaf","Math","min","width","height","showParentLabel","isParent","_jsxs","animated","g","transform","children","_jsx","rect","id","v","max","fill","color","strokeWidth","stroke","borderColor","fillOpacity","opacity","onMouseEnter","onMouseMove","onMouseLeave","onClick","Text","textAnchor","dominantBaseline","style","_extends","labels","text","labelTextColor","pointerEvents","labelOpacity","labelX","labelY","labelRotation","label","parentLabelTextColor","parentLabelOpacity","parentLabelX","parentLabelY","parentLabelRotation","parentLabel","TreeMapNodeTooltip","BasicTooltip","value","formattedValue","enableChip","TreeMapHtmlNode","div","path","replace","boxSizing","position","top","left","borderStyle","overflow","background","span","display","justifyContent","alignItems","whiteSpace","transformOrigin","commonDefaultProps","layers","identity","tile","leavesOnly","innerPadding","outerPadding","colors","scheme","colorBy","nodeOpacity","from","modifiers","orientLabel","parentLabelSize","parentLabelPosition","parentLabelPadding","isInteractive","tooltip","role","animate","motionConfig","svgDefaultProps","nodeComponent","defs","htmlDefaultProps","canvasDefaultProps","pixelRatio","window","devicePixelRatio","tileByType","binary","treemapBinary","dice","treemapDice","slice","treemapSlice","sliceDice","treemapSliceDice","squarify","treemapSquarify","useHierarchy","_ref2","root","getValue","useMemo","hierarchy","sum","useTreeMap","_ref3","data","_ref3$identity","_ref3$value","valueFormat","_ref3$leavesOnly","_ref3$tile","_ref3$innerPadding","_ref3$outerPadding","_ref3$label","_ref3$orientLabel","_ref3$enableParentLab","_ref3$parentLabel","_ref3$parentLabelSize","_ref3$parentLabelPosi","_ref3$parentLabelPadd","_ref3$colors","_ref3$colorBy","_ref3$nodeOpacity","_ref3$borderColor","_ref3$labelTextColor","_ref3$parentLabelText","getIdentity","usePropertyAccessor","formatValue","useValueFormatter","getLabel","getParentLabel","layout","treemap","d3Treemap","size","round","paddingInner","paddingOuter","startCase","useTreeMapLayout","rawNodes","cloneDeep","leaves","descendants","nodes","map","rawNode","_computeNodeIdAndPath","ancestors","ancestor","reverse","join","pathComponents","computeNodeIdAndPath","omit","x0","y0","x1","y1","treeDepth","depth","treeHeight","getColor","useOrdinalColorScale","getBorderColor","useInheritedColor","getLabelTextColor","getParentLabelTextColor","nodesWithStyles","nodeWithStyles","useCustomLayerProps","_ref5","getAnimatedNodeProps","getEndingAnimatedNodeProps","TreeMapNodes","nodesWithHandlers","_ref4","_useTooltip","useTooltip","showTooltipFromEvent","hideTooltip","showTooltip","useCallback","event","createElement","handleMouseEnter","handleMouseMove","handleMouseLeave","handleClick","useInteractiveTreeMapNodes","_useMotionConfig","useMotionConfig","springConfig","config","transition","useTransition","keys","initial","enter","update","leave","immediate","_Fragment","key","InnerTreeMap","_ref$identity","_ref$value","_ref$tile","_ref$nodeComponent","_ref$innerPadding","_ref$outerPadding","_ref$leavesOnly","partialMargin","margin","_ref$layers","_ref$colors","_ref$colorBy","_ref$nodeOpacity","_ref$borderWidth","_ref$borderColor","_ref$defs","_ref$fill","_ref$enableLabel","_ref$label","_ref$labelTextColor","_ref$orientLabel","_ref$labelSkipSize","_ref$enableParentLabe","_ref$parentLabel","_ref$parentLabelSize","_ref$parentLabelPosit","_ref$parentLabelPaddi","_ref$parentLabelTextC","_ref$isInteractive","_ref$tooltip","ariaLabel","ariaLabelledBy","ariaDescribedBy","forwardedRef","_useDimensions","useDimensions","innerWidth","innerHeight","outerWidth","outerHeight","layerById","includes","customLayerProps","boundDefs","bindDefs","SvgWrapper","ref","layer","i","_layerById$layer","Fragment","TreeMap","forwardRef","_ref2$isInteractive","_ref2$animate","_ref2$motionConfig","renderWrapper","props","_objectWithoutPropertiesLoose","_excluded","Container","ResponsiveTreeMap","defaultWidth","defaultHeight","onResize","debounceResize","ResponsiveWrapper","InnerTreeMapHtml","TreeMapHtml","ResponsiveTreeMapHtml","findNodeUnderCursor","find","isCursorInRect","InnerTreeMapCanvas","_ref$pixelRatio","canvasEl","useRef","useEffect","current","ctx","getContext","scale","fillStyle","fillRect","translate","forEach","strokeStyle","lineWidth","strokeRect","textAlign","textBaseline","setCanvasFont","rotate","save","degreesToRadians","drawCanvasText","String","restore","handleMouseHover","_getRelativeCursor","getRelativeCursor","undefined","_getRelativeCursor2","mergeRefs","TreeMapCanvas","ResponsiveTreeMapCanvas"],"mappings":"62CAEO,IAAMA,EAAmB,SAACC,EAAwBC,GAAsB,OAC3EC,EAAG,CAACF,EAAGC,IAAI,SAACD,EAAGC,GAAC,MAAkBD,aAAAA,MAAKC,EAAC,GAAA,GAAI,EAEnCE,EAAoB,SAACH,EAAwBC,GAAsB,OAC5EC,EAAG,CAACF,EAAGC,IAAI,SAACD,EAAGC,GAAC,MAAkBD,aAAAA,SAAQC,EAAC,KAAA,GAAM,EAExCG,EAAoB,SAC7BJ,E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