{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "treemap",
  "type": "registry:component",
  "title": "Treemap",
  "description": "A squarified treemap for hierarchical totals that zooms into any group with an animated layout tween and a breadcrumb back out.",
  "categories": [
    "charts"
  ],
  "dependencies": [
    "@tabler/icons-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/overtrue/treemap.tsx",
      "type": "registry:component",
      "target": "components/overtrue/treemap.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { IconArrowUp, IconChevronRight } from \"@tabler/icons-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface TreemapNode<TMeta = unknown> {\n  /** Unique across the whole tree. Used for the path, keys and transitions. */\n  id: string;\n  label: string;\n  /** Amount for a leaf. Nodes with children always show the sum of their children. */\n  value?: number;\n  children?: TreemapNode<TMeta>[];\n  /** Any CSS color. Applies to this node and everything under it. */\n  color?: string;\n  /** Anything else your labels or handlers need, such as a file count or an owner. */\n  meta?: TMeta;\n}\n\n/** Label tier picked from the tile's size: lg shows label, value and share; xs shows nothing. */\nexport type TreemapLabelSize = \"lg\" | \"md\" | \"sm\" | \"xs\";\n\n/** Where a formatted value is shown: dense tile labels, or the breadcrumb, readout and labels for assistive tech. */\nexport type TreemapFormatContext = \"tile\" | \"detail\";\n\n/** Everything known about a tile, passed to `renderLabel`. */\nexport interface TreemapTileInfo<TMeta = unknown> {\n  value: number;\n  /** The value run through `valueFormatter` for a tile. */\n  formattedValue: string;\n  /** Share of the parent node, 0–1. */\n  share: number;\n  /** Share of the whole map, 0–1. */\n  shareOfTotal: number;\n  /** Depth below the top level: 0 for a top-level node. */\n  depth: number;\n  /** Nodes from the top level down to and including this one. */\n  path: TreemapNode<TMeta>[];\n  /** Tile size in CSS pixels, and the label tier picked for it. */\n  width: number;\n  height: number;\n  size: TreemapLabelSize;\n  /** Resolved fill and a readable text color for it. */\n  fill: string;\n  ink: string;\n  /** Leaves under this node, or 1 for a leaf. */\n  leafCount: number;\n  /** Whether activating the tile zooms into it. */\n  drillable: boolean;\n  /** Whether the tile is hovered or focused. */\n  active: boolean;\n}\n\nexport interface TreemapProps<TMeta = unknown> extends Omit<\n  React.ComponentProps<\"div\">,\n  \"title\" | \"onSelect\" | \"children\"\n> {\n  /** Top-level nodes. Leaves carry values; parents sum their children. */\n  data: TreemapNode<TMeta>[];\n  /**\n   * Formats values. `context` is \"tile\" for tile labels and \"detail\" for the\n   * breadcrumb, readout and accessible labels. Defaults to compact numbers on tiles\n   * and grouped digits elsewhere.\n   */\n  valueFormatter?: (value: number, context: TreemapFormatContext) => string;\n  title?: React.ReactNode;\n  description?: React.ReactNode;\n  /** Controls placed at the top right, such as a period picker. */\n  actions?: React.ReactNode;\n  /**\n   * Height of the map: pixels, or any CSS length. The card is a size container, so\n   * container units work, e.g. \"clamp(240px, 56cqw, 420px)\". Defaults to 360.\n   */\n  height?: number | string;\n  /** Levels drawn at once. Deeper levels appear as outlined groups. Defaults to 1. */\n  maxDepth?: number;\n  /** Colors for top-level groups, cycled in data order. Defaults to chart-1 … chart-5. */\n  colors?: string[];\n  /** Name of the top of the hierarchy in the breadcrumb. Defaults to \"All\". */\n  rootLabel?: string;\n  /** Controlled drill-down path: ids from the top level to the node being shown. */\n  path?: string[];\n  /** Initial path when uncontrolled. */\n  defaultPath?: string[];\n  /** Called with the new path and its nodes whenever the view zooms in or out. */\n  onPathChange?: (path: string[], nodes: TreemapNode<TMeta>[]) => void;\n  /** Called when a tile is clicked or activated with Enter, before any zoom. */\n  onSelect?: (node: TreemapNode<TMeta>, path: TreemapNode<TMeta>[]) => void;\n  /** Replace the content of every tile. Return null to leave a tile blank. */\n  renderLabel?: (\n    node: TreemapNode<TMeta>,\n    info: TreemapTileInfo<TMeta>,\n  ) => React.ReactNode;\n}\n\ntype Rect = { x: number; y: number; w: number; h: number };\n\ninterface Item<TMeta> {\n  id: string;\n  node: TreemapNode<TMeta> | null;\n  label: string;\n  value: number;\n  /** -1 for the root, 0 for top-level nodes. */\n  depth: number;\n  color: string;\n  parent: Item<TMeta> | null;\n  children: Item<TMeta>[];\n  leafCount: number;\n  /** Value relative to the largest sibling, 0–1. */\n  rank: number;\n}\n\ninterface Placement<TMeta> {\n  key: string;\n  item: Item<TMeta>;\n  rect: Rect;\n  kind: \"tile\" | \"group\" | \"hidden\";\n  header: number;\n}\n\ninterface Frame {\n  rect: Rect;\n  opacity: number;\n}\n\ninterface Zoom {\n  key: number;\n  from: string;\n  phase: \"start\" | \"run\";\n}\n\nconst ROOT_ID = \"\\u0000treemap-root\";\nconst GAP = 2;\nconst GROUP_HEADER = 22;\nconst GROUP_PAD = 3;\nconst DURATION = 560;\nconst EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\nconst FALLBACK_WIDTH = 640;\n\nconst defaultColors = [\n  \"var(--color-chart-1)\",\n  \"var(--color-chart-2)\",\n  \"var(--color-chart-3)\",\n  \"var(--color-chart-4)\",\n  \"var(--color-chart-5)\",\n];\n\nconst compactNumber = new Intl.NumberFormat(\"en-US\", {\n  notation: \"compact\",\n  maximumFractionDigits: 1,\n});\nconst exactNumber = new Intl.NumberFormat(\"en-US\", {\n  maximumFractionDigits: 2,\n});\n\nfunction defaultFormatter(value: number, context: TreemapFormatContext) {\n  return context === \"tile\"\n    ? compactNumber.format(value)\n    : exactNumber.format(value);\n}\n\nfunction percent(share: number) {\n  const pct = share * 100;\n  if (!(pct > 0)) return \"0%\";\n  if (pct < 0.1) return \"<0.1%\";\n  if (pct >= 99.95) return \"100%\";\n  return `${pct.toFixed(1)}%`;\n}\n\nconst useIsomorphicLayoutEffect =\n  typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\nfunction useReducedMotion() {\n  return React.useSyncExternalStore(\n    (onChange) => {\n      const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n      query.addEventListener(\"change\", onChange);\n      return () => query.removeEventListener(\"change\", onChange);\n    },\n    () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n    () => false,\n  );\n}\n\n/** Normalise the data: sum parents, drop empty nodes, sort by size and resolve colors. */\nfunction buildTree<TMeta>(\n  data: TreemapNode<TMeta>[],\n  colors: string[],\n  rootLabel: string,\n) {\n  const palette = colors.length ? colors : defaultColors;\n  const index = new Map<string, Item<TMeta>>();\n  const root: Item<TMeta> = {\n    id: ROOT_ID,\n    node: null,\n    label: rootLabel,\n    value: 0,\n    depth: -1,\n    color: \"var(--color-muted-foreground)\",\n    parent: null,\n    children: [],\n    leafCount: 0,\n    rank: 1,\n  };\n  index.set(ROOT_ID, root);\n\n  const visit = (\n    nodes: TreemapNode<TMeta>[],\n    parent: Item<TMeta>,\n    depth: number,\n  ): Item<TMeta>[] => {\n    const items: Item<TMeta>[] = [];\n    nodes.forEach((node, position) => {\n      const item: Item<TMeta> = {\n        id: node.id,\n        node,\n        label: node.label,\n        value: 0,\n        depth,\n        // Colors follow data order, so they stay put when values change.\n        color:\n          node.color ??\n          (depth === 0 ? palette[position % palette.length] : parent.color),\n        parent,\n        children: [],\n        leafCount: 1,\n        rank: 1,\n      };\n      if (node.children?.length) {\n        item.children = visit(node.children, item, depth + 1);\n        item.value = item.children.reduce((sum, child) => sum + child.value, 0);\n        item.leafCount = item.children.reduce(\n          (sum, child) => sum + child.leafCount,\n          0,\n        );\n      } else {\n        const value = Number(node.value);\n        item.value = Number.isFinite(value) && value > 0 ? value : 0;\n      }\n      if (item.value > 0) {\n        items.push(item);\n        index.set(item.id, item);\n      }\n    });\n    items.sort((a, b) => b.value - a.value);\n    const largest = items[0]?.value || 1;\n    for (const item of items) item.rank = item.value / largest;\n    return items;\n  };\n\n  root.children = visit(data, root, 0);\n  root.value = root.children.reduce((sum, child) => sum + child.value, 0);\n  root.leafCount = root.children.reduce(\n    (sum, child) => sum + child.leafCount,\n    0,\n  );\n  return { root, index };\n}\n\n/** Bruls, Huizing and van Wijk's squarified layout. Values must be sorted, largest first. */\nfunction squarify(values: number[], area: Rect): Rect[] {\n  const total = values.reduce((sum, value) => sum + value, 0);\n  if (!(total > 0) || area.w <= 0 || area.h <= 0)\n    return values.map(() => ({ x: area.x, y: area.y, w: 0, h: 0 }));\n  const scale = (area.w * area.h) / total;\n  const sizes = values.map((value) => value * scale);\n  const out: Rect[] = new Array(values.length);\n  let { x, y, w, h } = area;\n  let start = 0;\n  while (start < sizes.length) {\n    const side = Math.min(w, h);\n    let end = start;\n    let sum = 0;\n    let min = Infinity;\n    let max = 0;\n    let worst = Infinity;\n    while (end < sizes.length) {\n      const size = sizes[end];\n      const nextSum = sum + size;\n      const nextMin = Math.min(min, size);\n      const nextMax = Math.max(max, size);\n      const ratio = Math.max(\n        (side * side * nextMax) / (nextSum * nextSum),\n        (nextSum * nextSum) / (side * side * nextMin),\n      );\n      if (end > start && ratio > worst) break;\n      worst = ratio;\n      sum = nextSum;\n      min = nextMin;\n      max = nextMax;\n      end++;\n    }\n    const last = end >= sizes.length;\n    if (w >= h) {\n      // A column along the left edge.\n      const columnWidth = last ? w : sum / h;\n      let cursor = y;\n      for (let i = start; i < end; i++) {\n        const tall = i === end - 1 ? y + h - cursor : sizes[i] / columnWidth;\n        out[i] = { x, y: cursor, w: columnWidth, h: tall };\n        cursor += tall;\n      }\n      x += columnWidth;\n      w -= columnWidth;\n    } else {\n      // A row along the top edge.\n      const rowHeight = last ? h : sum / w;\n      let cursor = x;\n      for (let i = start; i < end; i++) {\n        const wide = i === end - 1 ? x + w - cursor : sizes[i] / rowHeight;\n        out[i] = { x: cursor, y, w: wide, h: rowHeight };\n        cursor += wide;\n      }\n      y += rowHeight;\n      h -= rowHeight;\n    }\n    start = end;\n  }\n  return out;\n}\n\n/**\n * Lay out everything under `focus` in a width × height frame. Levels within\n * `maxDepth` are drawn; deeper levels are still placed (hidden) so zooms can start\n * from where a node would sit.\n */\nfunction layoutView<TMeta>(\n  focus: Item<TMeta>,\n  width: number,\n  height: number,\n  maxDepth: number,\n) {\n  const map = new Map<string, Placement<TMeta>>();\n  const place = (\n    parent: Item<TMeta>,\n    area: Rect,\n    level: number,\n    visible: boolean,\n  ) => {\n    if (!parent.children.length) return;\n    const rects = squarify(\n      parent.children.map((child) => child.value),\n      area,\n    );\n    parent.children.forEach((child, i) => {\n      const rect = rects[i];\n      let kind: Placement<TMeta>[\"kind\"] = \"hidden\";\n      let header = 0;\n      if (visible) {\n        const group =\n          child.children.length > 0 &&\n          level < maxDepth &&\n          rect.w >= 48 &&\n          rect.h >= 40;\n        kind = group ? \"group\" : \"tile\";\n        if (group && rect.w >= 72 && rect.h >= 64) header = GROUP_HEADER;\n      }\n      map.set(child.id, {\n        key: kind === \"group\" ? `${child.id}\\u0000group` : child.id,\n        item: child,\n        rect,\n        kind,\n        header,\n      });\n      if (!child.children.length) return;\n      const inner =\n        kind === \"group\"\n          ? {\n              x: rect.x + GROUP_PAD,\n              y: rect.y + (header || GROUP_PAD),\n              w: Math.max(0, rect.w - GROUP_PAD * 2),\n              h: Math.max(0, rect.h - (header || GROUP_PAD) - GROUP_PAD),\n            }\n          : rect;\n      place(child, inner, level + 1, kind === \"group\");\n    });\n  };\n  place(focus, { x: 0, y: 0, w: width, h: height }, 1, true);\n  return map;\n}\n\n/** Map a rect so that `frame` fills the whole view: the geometry of a camera zoom. */\nfunction zoomRect(\n  rect: Rect,\n  frame: Rect,\n  width: number,\n  height: number,\n): Rect {\n  const sx = width / (frame.w || 1);\n  const sy = height / (frame.h || 1);\n  return {\n    x: (rect.x - frame.x) * sx,\n    y: (rect.y - frame.y) * sy,\n    w: rect.w * sx,\n    h: rect.h * sy,\n  };\n}\n\n/** The inverse of zoomRect: squeeze a full-view rect into `frame`. */\nfunction unzoomRect(\n  rect: Rect,\n  frame: Rect,\n  width: number,\n  height: number,\n): Rect {\n  const sx = frame.w / (width || 1);\n  const sy = frame.h / (height || 1);\n  return {\n    x: frame.x + rect.x * sx,\n    y: frame.y + rect.y * sy,\n    w: rect.w * sx,\n    h: rect.h * sy,\n  };\n}\n\nfunction isWithin<TMeta>(item: Item<TMeta>, ancestor: Item<TMeta>) {\n  for (\n    let current: Item<TMeta> | null = item;\n    current;\n    current = current.parent\n  )\n    if (current === ancestor) return true;\n  return false;\n}\n\nfunction lineage<TMeta>(item: Item<TMeta>) {\n  const chain: Item<TMeta>[] = [];\n  for (\n    let current: Item<TMeta> | null = item;\n    current && current.depth >= 0;\n    current = current.parent\n  )\n    chain.unshift(current);\n  return chain;\n}\n\n/** Deeper levels and smaller siblings get lighter, so neighbors of one hue stay distinct. */\nfunction fillFor<TMeta>(item: Item<TMeta>) {\n  const base = [0.9, 0.82, 0.72, 0.64][Math.min(Math.max(item.depth, 0), 3)];\n  const strength = base * (0.42 + 0.58 * Math.pow(item.rank, 0.7));\n  return `color-mix(in oklab, ${item.color} ${Math.round(strength * 100)}%, var(--color-card))`;\n}\n\n/**\n * Light or dark text picked from the fill's own lightness and tinted with its hue.\n * Browsers without relative color syntax keep the inherited foreground.\n */\nfunction inkFor(fill: string) {\n  return `oklch(from ${fill} clamp(0.2, (0.64 - l) * 1000, 0.985) min(c, 0.04) h)`;\n}\n\nfunction labelSize(width: number, height: number): TreemapLabelSize {\n  if (width >= 104 && height >= 70) return \"lg\";\n  if (width >= 64 && height >= 38) return \"md\";\n  if (width >= 34 && height >= 20) return \"sm\";\n  return \"xs\";\n}\n\nfunction boxStyle(rect: Rect, width: number, height: number, inset: number) {\n  const ix = rect.w > inset * 2 ? inset : 0;\n  const iy = rect.h > inset * 2 ? inset : 0;\n  return {\n    left: `calc(${(rect.x / width) * 100}% + ${ix}px)`,\n    top: `calc(${(rect.y / height) * 100}% + ${iy}px)`,\n    width: `calc(${(rect.w / width) * 100}% - ${ix * 2}px)`,\n    height: `calc(${(rect.h / height) * 100}% - ${iy * 2}px)`,\n  };\n}\n\nfunction DefaultLabel({\n  label,\n  info,\n  childCount,\n}: {\n  label: string;\n  info: TreemapTileInfo;\n  childCount: number;\n}) {\n  if (info.size === \"xs\") return null;\n  // A label cut to a couple of letters is noise; drop it and let the readout name the tile.\n  const fits = (font: number) =>\n    label.length <= Math.floor((info.width - 16) / (font * 0.56)) ||\n    (info.width - 16) / (font * 0.56) >= 6;\n  if (info.size === \"sm\")\n    return fits(11) ? (\n      <span className=\"block truncate px-1.5 pt-1 text-[11px] leading-4 font-medium\">\n        {label}\n      </span>\n    ) : null;\n  if (info.size === \"md\")\n    return (\n      <span className=\"flex min-w-0 flex-col px-2 pt-1.5\">\n        {fits(12) ? (\n          <span className=\"truncate text-xs leading-4 font-medium\">\n            {label}\n          </span>\n        ) : null}\n        <span className=\"truncate text-[11px] leading-4 tabular-nums opacity-80\">\n          {info.formattedValue}\n        </span>\n      </span>\n    );\n  const big = info.width >= 176 && info.height >= 120;\n  return (\n    <span className=\"flex h-full min-w-0 flex-col justify-between gap-1 p-2.5\">\n      <span\n        className={cn(\n          \"min-w-0 text-xs leading-4 font-medium\",\n          info.height >= 84 ? \"line-clamp-2 break-words\" : \"truncate\",\n        )}\n      >\n        {label}\n      </span>\n      <span className=\"flex min-w-0 items-end justify-between gap-2\">\n        <span className=\"flex min-w-0 items-baseline gap-1.5\">\n          <span\n            className={cn(\n              \"truncate leading-none font-semibold tracking-tight\",\n              big ? \"text-[22px]\" : \"text-[15px]\",\n            )}\n          >\n            {info.formattedValue}\n          </span>\n          {info.width >= 132 ? (\n            <span className=\"shrink-0 font-mono text-[10.5px] leading-none tabular-nums opacity-70\">\n              {percent(info.share)}\n            </span>\n          ) : null}\n        </span>\n        {info.drillable && info.width >= 150 ? (\n          <span className=\"flex shrink-0 items-center gap-0.5 font-mono text-[10.5px] leading-none tabular-nums opacity-70\">\n            {childCount}\n            <IconChevronRight aria-hidden=\"true\" size={11} stroke={2.25} />\n          </span>\n        ) : null}\n      </span>\n    </span>\n  );\n}\n\n/** Pick the tile whose center lies closest in the arrow's direction. */\nfunction neighborIn<TMeta>(\n  tiles: Placement<TMeta>[],\n  from: Placement<TMeta>,\n  key: string,\n) {\n  const cx = from.rect.x + from.rect.w / 2;\n  const cy = from.rect.y + from.rect.h / 2;\n  let best: Placement<TMeta> | null = null;\n  let bestScore = Infinity;\n  for (const tile of tiles) {\n    if (tile === from) continue;\n    const r = tile.rect;\n    const tx = r.x + r.w / 2;\n    const ty = r.y + r.h / 2;\n    let along: number;\n    let across: number;\n    if (key === \"ArrowRight\") {\n      if (r.x < from.rect.x + from.rect.w - 1) continue;\n      along = r.x - (from.rect.x + from.rect.w);\n      across = Math.abs(ty - cy);\n    } else if (key === \"ArrowLeft\") {\n      if (r.x + r.w > from.rect.x + 1) continue;\n      along = from.rect.x - (r.x + r.w);\n      across = Math.abs(ty - cy);\n    } else if (key === \"ArrowDown\") {\n      if (r.y < from.rect.y + from.rect.h - 1) continue;\n      along = r.y - (from.rect.y + from.rect.h);\n      across = Math.abs(tx - cx);\n    } else {\n      if (r.y + r.h > from.rect.y + 1) continue;\n      along = from.rect.y - (r.y + r.h);\n      across = Math.abs(tx - cx);\n    }\n    const score = Math.max(0, along) + across * 2;\n    if (score < bestScore) {\n      best = tile;\n      bestScore = score;\n    }\n  }\n  return best;\n}\n\n/**\n * A squarified treemap for hierarchical totals. Click or press Enter on a tile to\n * zoom into it with an animated layout tween; the breadcrumb, Backspace or Escape\n * zoom back out. Hover or focus a tile to read its share of the parent and the total.\n */\nfunction Treemap<TMeta = unknown>({\n  data,\n  valueFormatter = defaultFormatter,\n  title,\n  description,\n  actions,\n  height = 360,\n  maxDepth = 1,\n  colors = defaultColors,\n  rootLabel = \"All\",\n  path: pathProp,\n  defaultPath,\n  onPathChange,\n  onSelect,\n  renderLabel,\n  className,\n  ...props\n}: TreemapProps<TMeta>) {\n  const id = React.useId();\n  const reduced = useReducedMotion();\n  const canvasRef = React.useRef<HTMLDivElement>(null);\n  const pendingFocus = React.useRef<string | null>(null);\n  const [measured, setMeasured] = React.useState<{\n    w: number;\n    h: number;\n  } | null>(null);\n  const [instant, setInstant] = React.useState(true);\n  const [revealed, setRevealed] = React.useState(false);\n  const [internalPath, setInternalPath] = React.useState<string[]>(\n    defaultPath ?? [],\n  );\n  const [hoveredId, setHoveredId] = React.useState<string | null>(null);\n  const [focusedId, setFocusedId] = React.useState<string | null>(null);\n  const [tabStopId, setTabStopId] = React.useState<string | null>(null);\n  const [zoom, setZoom] = React.useState<Zoom | null>(null);\n\n  const colorKey = colors.join(\"|\");\n  const tree = React.useMemo(\n    () => buildTree(data, colorKey ? colorKey.split(\"|\") : [], rootLabel),\n    // colorKey stands in for `colors`, so inline arrays do not rebuild the tree.\n    [data, colorKey, rootLabel],\n  );\n  const { root, index } = tree;\n  const depthLimit = Math.max(1, Math.floor(maxDepth));\n\n  const requestedPath = pathProp ?? internalPath;\n  const chain = React.useMemo(() => {\n    const result = [root];\n    let current = root;\n    for (const step of requestedPath) {\n      const next = current.children.find((child) => child.id === step);\n      if (!next || !next.children.length) break;\n      result.push(next);\n      current = next;\n    }\n    return result;\n  }, [root, requestedPath]);\n  const focus = chain[chain.length - 1];\n\n  const width = measured?.w ?? FALLBACK_WIDTH;\n  const frameHeight =\n    measured?.h ??\n    (typeof height === \"number\" ? height : FALLBACK_WIDTH * 0.5625);\n  const layout = React.useMemo(\n    () => layoutView(focus, width, frameHeight, depthLimit),\n    [focus, width, frameHeight, depthLimit],\n  );\n  const placements = React.useMemo(\n    () => [...layout.values()].filter((p) => p.kind !== \"hidden\"),\n    [layout],\n  );\n  const tiles = React.useMemo(\n    () => placements.filter((p) => p.kind === \"tile\"),\n    [placements],\n  );\n\n  // Start a zoom whenever the focused node changes; the previous layout is derived\n  // from the node we are leaving, so nothing has to be cached between renders.\n  const [shownFocus, setShownFocus] = React.useState(focus.id);\n  if (shownFocus !== focus.id) {\n    setShownFocus(focus.id);\n    setHoveredId(null);\n    setFocusedId(null);\n    setZoom(\n      reduced || !measured\n        ? null\n        : { key: (zoom?.key ?? 0) + 1, from: shownFocus, phase: \"start\" },\n    );\n  }\n\n  // Every tile moves under one camera transform, so nothing crosses paths: the old\n  // arrangement zooms away and fades while the new one zooms in from the same place.\n  const transition = React.useMemo(() => {\n    if (!zoom) return null;\n    const previous = index.get(zoom.from);\n    if (!previous || !(previous.children.length > 0)) return null;\n    const before = layoutView(previous, width, frameHeight, depthLimit);\n    const frameIn = isWithin(focus, previous)\n      ? before.get(focus.id)?.rect\n      : undefined;\n    const frameOut =\n      !frameIn && isWithin(previous, focus)\n        ? layout.get(previous.id)?.rect\n        : undefined;\n    const start = new Map<string, Frame>();\n    for (const p of placements) {\n      start.set(p.key, {\n        rect: frameIn\n          ? unzoomRect(p.rect, frameIn, width, frameHeight)\n          : frameOut\n            ? zoomRect(p.rect, frameOut, width, frameHeight)\n            : p.rect,\n        opacity: 0,\n      });\n    }\n    const exits: { placement: Placement<TMeta>; to: Rect }[] = [];\n    for (const p of before.values()) {\n      if (p.kind === \"hidden\") continue;\n      exits.push({\n        placement: p,\n        to: frameIn\n          ? zoomRect(p.rect, frameIn, width, frameHeight)\n          : frameOut\n            ? unzoomRect(p.rect, frameOut, width, frameHeight)\n            : p.rect,\n      });\n    }\n    return { start, exits };\n    // Recompute per zoom, not per phase.\n  }, [\n    zoom?.key,\n    zoom?.from,\n    layout,\n    placements,\n    index,\n    width,\n    frameHeight,\n    depthLimit,\n  ]);\n\n  useIsomorphicLayoutEffect(() => {\n    const element = canvasRef.current;\n    if (!element) return;\n    let frame = 0;\n    let last: { w: number; h: number } | null = null;\n    const measure = () => {\n      const w = element.clientWidth;\n      const h = element.clientHeight;\n      if (!w || !h) return;\n      if (last && last.w === w && last.h === h) return;\n      last = { w, h };\n      // Re-layout on resize without tweening every tile after the pointer.\n      setInstant(true);\n      setMeasured({ w, h });\n      cancelAnimationFrame(frame);\n      frame = requestAnimationFrame(() => {\n        frame = requestAnimationFrame(() => setInstant(false));\n      });\n    };\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(element);\n    return () => {\n      observer.disconnect();\n      cancelAnimationFrame(frame);\n    };\n  }, []);\n\n  useIsomorphicLayoutEffect(() => {\n    if (zoom?.phase !== \"start\") return;\n    // Commit the start frame so moving to the end frame is a CSS transition.\n    canvasRef.current?.getBoundingClientRect();\n    const key = zoom.key;\n    const frame = requestAnimationFrame(() =>\n      setZoom((current) =>\n        current && current.key === key ? { ...current, phase: \"run\" } : current,\n      ),\n    );\n    return () => cancelAnimationFrame(frame);\n  }, [zoom?.key, zoom?.phase]);\n\n  React.useEffect(() => {\n    if (zoom?.phase !== \"run\") return;\n    const key = zoom.key;\n    const timer = window.setTimeout(\n      () =>\n        setZoom((current) => (current && current.key === key ? null : current)),\n      DURATION + 40,\n    );\n    return () => window.clearTimeout(timer);\n  }, [zoom?.key, zoom?.phase]);\n\n  React.useEffect(() => {\n    const timer = window.setTimeout(() => setRevealed(true), 1200);\n    return () => window.clearTimeout(timer);\n  }, []);\n\n  // After a keyboard zoom, keep focus in the map.\n  React.useEffect(() => {\n    const target = pendingFocus.current;\n    const canvas = canvasRef.current;\n    if (!target || !canvas) return;\n    pendingFocus.current = null;\n    const live = Array.from(\n      canvas.querySelectorAll<HTMLElement>(\n        '[data-slot=\"treemap-tile\"]:not([data-exiting])',\n      ),\n    );\n    const previous = index.get(target);\n    const match =\n      live.find((element) => element.dataset.id === target) ??\n      (previous\n        ? live.find((element) => {\n            const item = index.get(element.dataset.id ?? \"\");\n            return item ? isWithin(item, previous) : false;\n          })\n        : undefined) ??\n      live[0];\n    match?.focus({ preventScroll: true });\n  }, [focus.id, index]);\n\n  const format = valueFormatter;\n  const activeId = zoom ? null : (hoveredId ?? focusedId);\n  const activeItem = activeId ? (index.get(activeId) ?? null) : null;\n  const stopId =\n    tabStopId && tiles.some((p) => p.item.id === tabStopId)\n      ? tabStopId\n      : (tiles[0]?.item.id ?? null);\n\n  const commitPath = (target: Item<TMeta>) => {\n    const nodes = lineage(target);\n    const next = nodes.map((item) => item.id);\n    if (pathProp === undefined) setInternalPath(next);\n    onPathChange?.(\n      next,\n      nodes.map((item) => item.node!),\n    );\n  };\n\n  const activate = (item: Item<TMeta>, fromKeyboard: boolean) => {\n    const nodes = lineage(item);\n    onSelect?.(\n      item.node!,\n      nodes.map((entry) => entry.node!),\n    );\n    // Zoom into the tile, or into its group when it is a leaf drawn inside one.\n    const target = item.children.length\n      ? item\n      : item.parent && item.parent !== focus\n        ? item.parent\n        : null;\n    if (!target || target === focus) return;\n    if (fromKeyboard) pendingFocus.current = \"first\";\n    commitPath(target);\n  };\n\n  const goUp = (fromKeyboard: boolean) => {\n    if (!focus.parent) return;\n    if (fromKeyboard) pendingFocus.current = focus.id;\n    commitPath(focus.parent);\n  };\n\n  const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    const target = event.target as HTMLElement;\n    if (target.dataset.slot !== \"treemap-tile\") return;\n    const current = tiles.find((p) => p.item.id === target.dataset.id);\n    if (!current) return;\n    if (event.key === \"Enter\" || event.key === \" \") {\n      event.preventDefault();\n      activate(current.item, true);\n      return;\n    }\n    if (event.key === \"Backspace\" || event.key === \"Escape\") {\n      if (!focus.parent) return;\n      event.preventDefault();\n      goUp(true);\n      return;\n    }\n    let next: Placement<TMeta> | null | undefined = null;\n    if (event.key.startsWith(\"Arrow\"))\n      next = neighborIn(tiles, current, event.key);\n    else if (event.key === \"Home\") next = tiles[0];\n    else if (event.key === \"End\") next = tiles[tiles.length - 1];\n    else return;\n    event.preventDefault();\n    if (!next) return;\n    setTabStopId(next.item.id);\n    canvasRef.current\n      ?.querySelector<HTMLElement>(\n        `[data-slot=\"treemap-tile\"][data-id=\"${CSS.escape(next.item.id)}\"]:not([data-exiting])`,\n      )\n      ?.focus({ preventScroll: true });\n  };\n\n  const hasHeader = title != null || description != null || actions != null;\n  const mapLabel = typeof title === \"string\" ? title : \"Treemap\";\n  const shareOfParent = (item: Item<TMeta>) =>\n    item.parent && item.parent.value > 0 ? item.value / item.parent.value : 1;\n  const shareOfTotal = (item: Item<TMeta>) =>\n    root.value > 0 ? item.value / root.value : 0;\n\n  const describe = (item: Item<TMeta>) => {\n    const parts = [\n      item.label,\n      format(item.value, \"detail\"),\n      `${percent(shareOfParent(item))} of ${item.parent?.label ?? rootLabel}`,\n    ];\n    if (item.depth > 0) parts.push(`${percent(shareOfTotal(item))} of total`);\n    if (item.children.length)\n      parts.push(`${item.children.length} items, press Enter to zoom in`);\n    return parts.join(\", \");\n  };\n\n  const phase = zoom && transition ? zoom.phase : null;\n  const labelsHidden = zoom != null;\n  const motion = !reduced && !instant;\n  const moveTransition = (fade: number, fadeDelay = 0) =>\n    [\n      `left ${DURATION}ms ${EASE}`,\n      `top ${DURATION}ms ${EASE}`,\n      `width ${DURATION}ms ${EASE}`,\n      `height ${DURATION}ms ${EASE}`,\n      `opacity ${fade}ms ${fadeDelay}ms ease-out`,\n    ].join(\", \");\n\n  const frameFor = (\n    p: Placement<TMeta>,\n    exitTo: Rect | null,\n  ): { style: React.CSSProperties; exiting: boolean } => {\n    let rect = p.rect;\n    let opacity: number | undefined;\n    if (transition && phase === \"start\") {\n      const from = exitTo ? null : transition.start.get(p.key);\n      rect = from?.rect ?? p.rect;\n      opacity = from ? from.opacity : 1;\n    } else if (transition && phase === \"run\") {\n      rect = exitTo ?? p.rect;\n      opacity = exitTo ? 0 : 1;\n    }\n    let css = \"none\";\n    if (motion && phase !== \"start\")\n      css =\n        phase === \"run\"\n          ? exitTo\n            ? moveTransition(\n                Math.round(DURATION * 0.5),\n                Math.round(DURATION * 0.1),\n              )\n            : moveTransition(Math.round(DURATION * 0.55))\n          : moveTransition(240);\n    return {\n      exiting: exitTo != null,\n      style: {\n        ...boxStyle(rect, width, frameHeight, GAP / 2),\n        opacity,\n        transition: css,\n      },\n    };\n  };\n\n  const revealDelay = (rect: Rect) =>\n    `${Math.round(((rect.x + rect.w / 2) / width + (rect.y + rect.h / 2) / frameHeight) * 210)}ms`;\n\n  const renderGroup = (p: Placement<TMeta>, exitTo: Rect | null) => {\n    const { style, exiting } = frameFor(p, exitTo);\n    const { item } = p;\n    const groupActive = activeItem != null && isWithin(activeItem, item);\n    return (\n      <div\n        key={exiting ? `${p.key}\\u0000exit` : p.key}\n        data-slot=\"treemap-group\"\n        data-id={item.id}\n        data-depth={item.depth}\n        data-active={groupActive || undefined}\n        data-exiting={exiting || undefined}\n        aria-hidden=\"true\"\n        className={cn(\n          \"absolute overflow-hidden rounded-[5px] border\",\n          exiting && \"pointer-events-none\",\n          !revealed &&\n            \"motion-safe:animate-[treemap-tile-in_600ms_cubic-bezier(0.22,1,0.36,1)_backwards]\",\n        )}\n        style={{\n          ...style,\n          borderColor: `color-mix(in oklab, ${item.color} ${groupActive ? 55 : 30}%, var(--color-border))`,\n          backgroundColor: `color-mix(in oklab, ${item.color} 7%, var(--color-card))`,\n          animationDelay: revealed ? undefined : revealDelay(p.rect),\n        }}\n      >\n        {p.header ? (\n          <div\n            className=\"flex h-[19px] w-full cursor-pointer items-center gap-1.5 px-1.5 text-[11px] leading-none transition-opacity duration-200 motion-reduce:transition-none\"\n            style={{ opacity: labelsHidden ? 0 : 1 }}\n            onPointerEnter={() => setHoveredId(item.id)}\n            onClick={exiting ? undefined : () => activate(item, false)}\n          >\n            <span\n              aria-hidden=\"true\"\n              className=\"size-1.5 shrink-0 rounded-full\"\n              style={{ backgroundColor: item.color }}\n            />\n            <span className=\"min-w-0 truncate font-medium text-foreground\">\n              {item.label}\n            </span>\n            {p.rect.w >= 128 ? (\n              <span className=\"ml-auto shrink-0 text-muted-foreground tabular-nums\">\n                {format(item.value, \"tile\")}\n              </span>\n            ) : null}\n          </div>\n        ) : null}\n      </div>\n    );\n  };\n\n  const renderTile = (p: Placement<TMeta>, exitTo: Rect | null) => {\n    const { style, exiting } = frameFor(p, exitTo);\n    const { item } = p;\n    const fill = fillFor(item);\n    const ink = inkFor(fill);\n    const tileWidth = Math.max(0, p.rect.w - GAP);\n    const tileHeight = Math.max(0, p.rect.h - GAP);\n    const active = !exiting && activeItem === item;\n    const dimmed =\n      !exiting &&\n      activeItem != null &&\n      activeItem !== root &&\n      !isWithin(item, activeItem);\n    const drillable = item.children.length > 0;\n    const info: TreemapTileInfo<TMeta> = {\n      value: item.value,\n      formattedValue: format(item.value, \"tile\"),\n      share: shareOfParent(item),\n      shareOfTotal: shareOfTotal(item),\n      depth: item.depth,\n      path: lineage(item).map((entry) => entry.node!),\n      width: tileWidth,\n      height: tileHeight,\n      size: labelSize(tileWidth, tileHeight),\n      fill,\n      ink,\n      leafCount: item.leafCount,\n      drillable,\n      active,\n    };\n    const content = renderLabel ? (\n      renderLabel(item.node!, info)\n    ) : (\n      <DefaultLabel\n        label={item.label}\n        info={info as TreemapTileInfo}\n        childCount={item.children.length}\n      />\n    );\n    return (\n      <button\n        key={exiting ? `${p.key}\\u0000exit` : p.key}\n        type=\"button\"\n        data-slot=\"treemap-tile\"\n        data-id={item.id}\n        data-depth={item.depth}\n        data-size={info.size}\n        data-active={active || undefined}\n        data-exiting={exiting || undefined}\n        aria-hidden={exiting || undefined}\n        aria-label={exiting ? undefined : describe(item)}\n        tabIndex={!exiting && item.id === stopId ? 0 : -1}\n        onPointerEnter={exiting ? undefined : () => setHoveredId(item.id)}\n        onFocus={\n          exiting\n            ? undefined\n            : () => {\n                setFocusedId(item.id);\n                setTabStopId(item.id);\n              }\n        }\n        onClick={exiting ? undefined : () => activate(item, false)}\n        className={cn(\n          \"absolute overflow-hidden rounded-[4px] p-0 text-left outline-none select-none\",\n          drillable\n            ? \"cursor-zoom-in\"\n            : onSelect\n              ? \"cursor-pointer\"\n              : \"cursor-default\",\n          exiting && \"pointer-events-none\",\n          \"data-[active]:z-10 focus-visible:z-20\",\n          // Inset rings so they are not clipped at the edge of the map.\n          \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-0 after:transition-opacity after:duration-150 motion-reduce:after:transition-none\",\n          \"after:shadow-[inset_0_0_0_1.5px_color-mix(in_oklab,var(--color-foreground)_78%,transparent)] data-[active]:after:opacity-100\",\n          \"focus-visible:after:opacity-100 focus-visible:after:shadow-[inset_0_0_0_2px_var(--color-ring),inset_0_0_0_3.5px_var(--color-card)]\",\n          !revealed &&\n            \"motion-safe:animate-[treemap-tile-in_600ms_cubic-bezier(0.22,1,0.36,1)_backwards]\",\n        )}\n        style={{\n          ...style,\n          animationDelay: revealed ? undefined : revealDelay(p.rect),\n        }}\n      >\n        <span\n          aria-hidden=\"true\"\n          data-slot=\"treemap-tile-fill\"\n          className=\"absolute inset-0 transition-opacity duration-200 motion-reduce:transition-none\"\n          style={{\n            backgroundColor: fill,\n            opacity: dimmed ? 0.42 : 1,\n          }}\n        />\n        <span\n          aria-hidden=\"true\"\n          data-slot=\"treemap-tile-label\"\n          className=\"relative block h-full min-w-0\"\n          style={{\n            color: ink,\n            opacity: labelsHidden ? 0 : dimmed ? 0.55 : 1,\n            transition: reduced\n              ? \"none\"\n              : `opacity ${labelsHidden ? 100 : 260}ms ${EASE}`,\n          }}\n        >\n          {content}\n        </span>\n      </button>\n    );\n  };\n\n  const renderPlacement = (p: Placement<TMeta>, exitTo: Rect | null) =>\n    p.kind === \"group\" ? renderGroup(p, exitTo) : renderTile(p, exitTo);\n\n  const atRoot = focus === root;\n  const activePath = activeItem ? lineage(activeItem) : [];\n\n  return (\n    <div\n      data-slot=\"treemap\"\n      data-depth={chain.length - 1}\n      className={cn(\n        \"@container/treemap flex min-w-0 flex-col rounded-xl border bg-card text-card-foreground shadow-xs\",\n        className,\n      )}\n      {...props}\n    >\n      <style href=\"overtrue-treemap\" precedence=\"default\">\n        {`@keyframes treemap-tile-in{from{opacity:0;transform:scale(.92)}}`}\n      </style>\n\n      {hasHeader ? (\n        <div className=\"flex flex-wrap items-start justify-between gap-x-6 gap-y-3 px-4 pt-4\">\n          <div className=\"min-w-0 space-y-1\">\n            {title != null ? (\n              <h3 className=\"text-sm leading-5 font-semibold tracking-tight\">\n                {title}\n              </h3>\n            ) : null}\n            {description != null ? (\n              <p\n                id={`${id}-description`}\n                className=\"text-xs text-muted-foreground\"\n              >\n                {description}\n              </p>\n            ) : null}\n          </div>\n          {actions != null ? (\n            <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>\n          ) : null}\n        </div>\n      ) : null}\n\n      <div\n        className={cn(\n          \"flex min-w-0 items-center gap-2 px-4 pb-2.5\",\n          hasHeader ? \"pt-3\" : \"pt-4\",\n        )}\n      >\n        {!atRoot ? (\n          <button\n            type=\"button\"\n            data-slot=\"treemap-up\"\n            aria-label={`Zoom out to ${focus.parent?.label}`}\n            onClick={() => goUp(false)}\n            className=\"grid size-6 shrink-0 place-items-center rounded-md border text-muted-foreground outline-none transition-[color,background-color,opacity,scale] hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 motion-reduce:transition-none motion-safe:starting:scale-75 motion-safe:starting:opacity-0\"\n          >\n            <IconArrowUp aria-hidden=\"true\" size={13} stroke={2} />\n          </button>\n        ) : null}\n        <nav\n          aria-label=\"Treemap level\"\n          data-slot=\"treemap-breadcrumb\"\n          className=\"min-w-0 flex-1\"\n        >\n          <ol className=\"flex min-w-0 items-center gap-0.5 text-xs\">\n            {chain.map((item, position) => {\n              const last = position === chain.length - 1;\n              return (\n                <li\n                  key={item.id}\n                  className={cn(\n                    \"flex min-w-0 items-center gap-0.5\",\n                    last ? \"shrink-0\" : \"shrink\",\n                  )}\n                >\n                  {position > 0 ? (\n                    <IconChevronRight\n                      aria-hidden=\"true\"\n                      size={12}\n                      className=\"shrink-0 text-muted-foreground/60\"\n                    />\n                  ) : null}\n                  {last ? (\n                    <span\n                      aria-current=\"location\"\n                      className=\"flex min-w-0 items-center gap-1.5 px-1 font-medium text-foreground motion-safe:transition-[opacity,translate] motion-safe:duration-300 motion-safe:starting:-translate-x-1 motion-safe:starting:opacity-0\"\n                    >\n                      {item.depth >= 0 ? (\n                        <span\n                          aria-hidden=\"true\"\n                          className=\"size-2 shrink-0 rounded-[2px]\"\n                          style={{ backgroundColor: fillFor(item) }}\n                        />\n                      ) : null}\n                      <span className=\"max-w-[14rem] truncate\">\n                        {item.label}\n                      </span>\n                    </span>\n                  ) : (\n                    <button\n                      type=\"button\"\n                      onClick={() => commitPath(item)}\n                      className=\"max-w-[9rem] truncate rounded-sm px-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 motion-reduce:transition-none\"\n                    >\n                      {item.label}\n                    </button>\n                  )}\n                </li>\n              );\n            })}\n          </ol>\n        </nav>\n        <p className=\"flex shrink-0 items-baseline gap-1.5 tabular-nums\">\n          {!atRoot ? (\n            <span className=\"font-mono text-[10.5px] text-muted-foreground\">\n              {percent(shareOfTotal(focus))}\n            </span>\n          ) : null}\n          <span className=\"text-sm font-semibold tracking-tight\">\n            {format(focus.value, \"detail\")}\n          </span>\n        </p>\n      </div>\n\n      <div className=\"px-4\">\n        <div\n          ref={canvasRef}\n          role=\"group\"\n          aria-roledescription=\"treemap\"\n          aria-label={`${mapLabel}: ${focus.label}, ${focus.children.length} items. Arrow keys move between tiles, Enter zooms in, Backspace zooms out.`}\n          aria-describedby={\n            description != null ? `${id}-description` : undefined\n          }\n          data-slot=\"treemap-canvas\"\n          data-zooming={zoom ? zoom.phase : undefined}\n          onKeyDown={onKeyDown}\n          onPointerLeave={() => setHoveredId(null)}\n          onBlur={(event) => {\n            if (!event.currentTarget.contains(event.relatedTarget as Node))\n              setFocusedId(null);\n          }}\n          className=\"relative w-full overflow-hidden rounded-md\"\n          style={{ height }}\n        >\n          {root.value <= 0 ? (\n            <p className=\"grid h-full place-items-center rounded-md border border-dashed text-xs text-muted-foreground\">\n              Nothing to show.\n            </p>\n          ) : null}\n          {transition && phase\n            ? transition.exits.map(({ placement, to }) =>\n                renderPlacement(placement, to),\n              )\n            : null}\n          {placements.map((p) => renderPlacement(p, null))}\n        </div>\n      </div>\n\n      <div\n        aria-hidden=\"true\"\n        data-slot=\"treemap-readout\"\n        className=\"mt-3 flex min-h-11 min-w-0 flex-wrap items-center gap-x-3 gap-y-1 border-t px-4 py-2.5 text-xs\"\n      >\n        {activeItem && activeItem !== root ? (\n          <>\n            <span className=\"flex min-w-0 items-center gap-1.5\">\n              <span\n                className=\"size-2.5 shrink-0 rounded-[3px]\"\n                style={{ backgroundColor: fillFor(activeItem) }}\n              />\n              {activePath.map((item, position) => (\n                <React.Fragment key={item.id}>\n                  {position > 0 ? (\n                    <IconChevronRight\n                      size={11}\n                      className=\"shrink-0 text-muted-foreground/60\"\n                    />\n                  ) : null}\n                  <span\n                    className={cn(\n                      \"truncate\",\n                      position === activePath.length - 1\n                        ? \"font-medium text-foreground\"\n                        : \"text-muted-foreground\",\n                    )}\n                  >\n                    {item.label}\n                  </span>\n                </React.Fragment>\n              ))}\n            </span>\n            <span className=\"ml-auto flex flex-wrap items-baseline gap-x-3 gap-y-0.5 tabular-nums\">\n              <span className=\"text-sm font-semibold tracking-tight\">\n                {format(activeItem.value, \"detail\")}\n              </span>\n              <span className=\"text-muted-foreground\">\n                <span className=\"font-medium text-foreground\">\n                  {percent(shareOfParent(activeItem))}\n                </span>{\" \"}\n                of {activeItem.parent?.label ?? rootLabel}\n              </span>\n              {activeItem.depth > 0 ? (\n                <span className=\"text-muted-foreground\">\n                  <span className=\"font-medium text-foreground\">\n                    {percent(shareOfTotal(activeItem))}\n                  </span>{\" \"}\n                  of total\n                </span>\n              ) : null}\n            </span>\n          </>\n        ) : (\n          <span className=\"text-muted-foreground\">\n            <span className=\"font-medium text-foreground tabular-nums\">\n              {focus.children.length}\n            </span>{\" \"}\n            {focus.children.length === 1 ? \"item\" : \"items\"}\n            {focus.leafCount !== focus.children.length ? (\n              <>\n                {\" · \"}\n                <span className=\"font-medium text-foreground tabular-nums\">\n                  {focus.leafCount}\n                </span>{\" \"}\n                leaves\n              </>\n            ) : null}\n            <span\n              className={cn(\"hidden\", focus.children.length > 0 && \"sm:inline\")}\n            >\n              {\" · \"}\n              {atRoot\n                ? \"Select a tile to zoom in\"\n                : \"Esc or Backspace to zoom out\"}\n            </span>\n          </span>\n        )}\n      </div>\n\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {atRoot\n          ? \"\"\n          : `${focus.label}: ${format(focus.value, \"detail\")}, ${focus.children.length} items`}\n      </p>\n    </div>\n  );\n}\n\nexport { Treemap };\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/treemap. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
