{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "choropleth-map",
  "type": "registry:ui",
  "title": "Choropleth Map",
  "description": "A value per area, shown as shades of one colour on a map: share of homes with solar panels by district, turnout by county, rainfall by region.",
  "author": "ofri-peretz <https://github.com/ofri-peretz>",
  "categories": [
    "data",
    "chart"
  ],
  "dependencies": [],
  "registryDependencies": [
    "https://ds.interlace.tools/r/interlace-base.json",
    "https://ds.interlace.tools/r/cn.json",
    "https://ds.interlace.tools/r/skeleton.json"
  ],
  "files": [
    {
      "path": "registry/interlace-ui/charts/choropleth-map.tsx",
      "target": "components/ui/charts/choropleth-map.tsx",
      "type": "registry:ui",
      "content": "'use client';\n\nimport * as React from 'react';\n\n// @interlace/choropleth-map v1.1.1 — Interlace design system.\n// Docs, props and live preview: https://ds.interlace.tools/c/choropleth-map\n// What changed since: https://ds.interlace.tools/c/choropleth-map#history\n// Generated banner — keep it, the upgrade diff reads this version.\n\n/**\n * @interlace/ui — ChoroplethMap\n *\n * A value per area, shown as shades of one colour on a map: share of homes\n * with solar panels by district, turnout by county, rainfall by region.\n *\n * ## Interlace ships no geography\n *\n * You pass the shapes as SVG path data already projected into `viewBox`\n * (export them once from your GIS tool or with d3-geo at build time). The\n * component never fetches a map, never bundles a boundary file and never\n * decides where a border runs: those are your data and your claims. It does\n * the parts every map gets wrong: the legend, the missing data, the keyboard\n * and the table.\n *\n * ## Classes, not a smooth ramp\n *\n * Values are put into a few classes (`bins`, 5 by default) and each class\n * gets one shade, light to dark, of a single tone. A reader can match five\n * shades to a legend; nobody can read a value off a continuous gradient.\n * The class breaks are quantiles by default (each class holds about the same\n * number of areas), `equal` intervals on request, or your own `breaks`.\n * `mapBins()` and `binOf()` are exported and pure.\n *\n * ## Missing is not zero\n *\n * An area without a value is hatched and the legend says \"No data\". Drawing\n * it in the lightest shade would tell the reader its value is the lowest.\n *\n * ## Every area is reachable without a mouse\n *\n * The map takes focus once. Arrow keys step through the areas in name order,\n * Home and End jump to the ends, Escape lets go, and the readout under the\n * map (`aria-live=\"polite\"`) says the area, its value and its class. The\n * pointer path runs through the same state, so the two cannot disagree. A\n * legend entry picks out its class. A table of every area and value sits\n * behind the picture (`showTable` shows it).\n *\n * ## Motion\n *\n * None on entry: a map is read by its colours, and fading them in only\n * delays that. Pointing at an area raises its outline; under reduced motion\n * the change is instant.\n *\n * ## MIN_VIEWPORT — 320\n *\n * The SVG scales to its box; the legend wraps.\n *\n * ## Anatomy\n *\n *   <figure data-slot=\"choropleth-map\">\n *     <figcaption data-slot=\"choropleth-map-label\">{label}</figcaption>\n *     <div data-slot=\"choropleth-map-legend\"> {legendLabel}\n *       <ul> <button data-slot=\"choropleth-map-legend-item\" aria-pressed /> × bins, No data </ul>\n *     </div>\n *     <svg data-slot=\"choropleth-map-plot\" role=\"img\" tabIndex=0 aria-label=\"{summary}\">\n *       <path data-slot=\"choropleth-map-area\" data-bin /> × areas\n *       <path data-slot=\"choropleth-map-active\" />          (the focused area's outline)\n *     </svg>\n *     <output data-slot=\"choropleth-map-readout\" aria-live=\"polite\" />\n *     <div data-slot=\"choropleth-map-table\" />              (sr-only unless showTable;\n *                                                            then a focusable scroll region)\n *   </figure>\n *\n * | Rule | Concept                    | Where in this file                                       |\n * | ---- | -------------------------- | -------------------------------------------------------- |\n * | R4   | Extends native el          | `React.ComponentProps<'figure'>`                          |\n * | R6   | data-slot on every part    | `choropleth-map` / `-label` / `-legend` / `-legend-item` / `-plot` / `-area` / `-active` / `-readout` / `-table` |\n * | R7   | className merged + ...rest | `cn(...)` + `{...props}`                                  |\n * | R8   | Enums, not booleans        | `binning: 'quantile' \\| 'equal'`, `tone`                  |\n * | R13  | Ecosystem first            | no map dep: your paths, `mapBins` + SVG                   |\n * | R14  | Declares min viewport      | `data-min-viewport={String(MIN_VIEWPORT)}`                |\n * | R18  | Tailwind only              | zero inline `style`                                       |\n * | R19  | Tokens only                | `--chart-1..5` mixed with `--background`, `--muted-foreground` |\n * | R23  | Loading reserves its box   | `loading` → `<Skeleton variant=\"chart\">`                  |\n * | R25  | Client component           | focus, pointer and the readout run in the browser         |\n * | R26  | A11y                       | `role=\"img\"` + sentence + keyboard + live readout + table |\n */\n\nimport { cn } from '@/lib/utils';\nimport { Skeleton } from '@/components/ui/skeleton';\n\nexport const MIN_VIEWPORT = 320 as const;\n\nexport type MapTone = 1 | 2 | 3 | 4 | 5;\n\nexport type MapArea = {\n  /** What `values` is keyed by. */\n  id: string;\n  /** The area's name. */\n  label: string;\n  /** SVG path data, already projected into the map's `viewBox`. */\n  d: string;\n};\n\nexport type MapBinning = 'quantile' | 'equal';\n\nexport type MapBins = {\n  /** The class edges, lowest first: `edges[0]` is the smallest value, the last edge the largest. */\n  edges: number[];\n};\n\n/** The tone the shades are mixed from. Written out so Tailwind sees them. */\nconst TONE: Record<MapTone, string> = {\n  1: '[--map-tone:var(--chart-1)]',\n  2: '[--map-tone:var(--chart-2)]',\n  3: '[--map-tone:var(--chart-3)]',\n  4: '[--map-tone:var(--chart-4)]',\n  5: '[--map-tone:var(--chart-5)]',\n};\n\n/** Seven shades, lightest first. A map with fewer classes takes evenly spaced steps from this ladder. */\nconst LADDER = [\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--background)_85%)]',\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--background)_70%)]',\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--background)_55%)]',\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--background)_40%)]',\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--background)_22%)]',\n  'fill-(--map-tone)',\n  'fill-[color-mix(in_oklab,var(--map-tone),var(--foreground)_35%)]',\n] as const;\n\n/** The most classes a reader can match to a legend. */\nexport const MAX_BINS = LADDER.length;\n\n// ─────────────────────────────────────────────────────────────────\n// Pure classing\n// ─────────────────────────────────────────────────────────────────\n\nconst finite = (v: number | null | undefined): v is number => typeof v === 'number' && Number.isFinite(v);\n\n/**\n * Class edges for a set of values. `bins` classes need `bins + 1` edges;\n * quantile edges that coincide (many equal values) are merged, so a map can\n * end up with fewer classes than asked for, never with an empty one.\n */\nexport function mapBins(\n  values: readonly (number | null | undefined)[],\n  options: { bins?: number; binning?: MapBinning; breaks?: readonly number[] } = {},\n): MapBins {\n  const sorted = values.filter(finite).sort((a, b) => a - b);\n  if (sorted.length === 0) return { edges: [] };\n  const min = sorted[0]!;\n  const max = sorted.at(-1)!;\n  let inner: number[];\n  if (options.breaks) {\n    inner = [...options.breaks].filter((b) => b > min && b < max).sort((a, b) => a - b);\n  } else {\n    const bins = Math.max(1, Math.min(MAX_BINS, Math.round(options.bins ?? 5)));\n    inner =\n      options.binning === 'equal'\n        ? Array.from({ length: bins - 1 }, (_, i) => min + ((max - min) * (i + 1)) / bins)\n        : Array.from({ length: bins - 1 }, (_, i) => sorted[Math.floor(((i + 1) * sorted.length) / bins)]!);\n  }\n  const edges = [min, ...inner, max].filter((edge, i, all) => i === 0 || edge > all[i - 1]!);\n  if (edges.length === 1) edges.push(max);\n  return { edges };\n}\n\n/** The class a value falls in: edges[i] ≤ v < edges[i + 1], the top class closed. -1 for no value. */\nexport function binOf(value: number | null | undefined, { edges }: MapBins): number {\n  if (!finite(value) || edges.length < 2) return -1;\n  const last = edges.length - 2;\n  for (let i = 0; i < last; i++) if (value < edges[i + 1]!) return i;\n  return last;\n}\n\n/**\n * Which ladder step each of `count` classes takes: spread evenly, farthest\n * from the page last. Up to six classes stop at the tone itself; the seventh\n * shade (the tone deepened) is used only when all seven are needed, so no two\n * classes ever share a shade.\n */\nexport function shadeSteps(count: number): number[] {\n  const top = count >= LADDER.length ? LADDER.length - 1 : LADDER.length - 2;\n  if (count <= 1) return [top];\n  return Array.from({ length: count }, (_, i) => Math.round((i * top) / (count - 1)));\n}\n\n/** What `describeMap` knows about a map, for a sentence in any language. */\nexport type MapSummary = {\n  /** How many areas the map has. */\n  count: number;\n  /** The highest and lowest area, with its value formatted. Absent when no area has a value. */\n  high?: { label: string; value: string };\n  low?: { label: string; value: string };\n  /** How many areas have no value. */\n  missing: number;\n};\n\n/**\n * The fixed words a reader meets, for a page in another language. Sentences are\n * functions, so each language can order and inflect them its own way.\n */\nexport type ChoroplethMapLabels = {\n  /** An area without a value, in the legend and the table. */\n  noData: string;\n  /** The table's first column. */\n  area: string;\n  /** The table's value column, when `legendLabel` is not given. */\n  value: string;\n  /** What the live line says before anything is picked out. */\n  hint: string;\n  /** Shown when there are no areas. */\n  empty: string;\n  /** The table's caption, given the chart's `label` when it is a string. */\n  tableCaption: (label?: string) => string;\n  /**\n   * The live line and the hover title for one area. `value` is null when the area has no data.\n   * `range` is null then too, and always in the hover title, which leaves the range out.\n   */\n  readout: (area: string, value: string | null, range: string | null) => string;\n  /** The map's one-sentence description. */\n  summary: (s: MapSummary) => string;\n};\n\nconst LABELS: ChoroplethMapLabels = {\n  noData: 'No data',\n  area: 'Area',\n  value: 'Value',\n  hint: 'Point at an area, or focus the map and use the arrow keys.',\n  empty: 'No areas to show yet.',\n  tableCaption: (label) => (label ? `${label}: by area` : 'Values by area'),\n  readout: (area, value, range) =>\n    value === null ? `${area}: no data` : range === null ? `${area}: ${value}` : `${area}: ${value} (${range})`,\n  summary: ({ count, high, low, missing }) =>\n    !high || !low\n      ? `Map of ${count} areas. No data.`\n      : `Map of ${count} areas. Highest: ${high.label}, ${high.value}. Lowest: ${low.label}, ${low.value}.` +\n        (missing > 0 ? ` No data for ${missing}.` : ''),\n};\n\n/** One sentence for the whole map: how many areas, the range, and the highest and lowest. */\nexport function describeMap(\n  areas: readonly MapArea[],\n  values: Readonly<Record<string, number | null | undefined>>,\n  format: (v: number) => string,\n  summary: ChoroplethMapLabels['summary'] = LABELS.summary,\n): string {\n  const known = areas.filter((a) => finite(values[a.id])).sort((a, b) => values[b.id]! - values[a.id]!);\n  const pick = (a: MapArea | undefined) => (a ? { label: a.label, value: format(values[a.id]!) } : undefined);\n  return summary({ count: areas.length, high: pick(known[0]), low: pick(known.at(-1)), missing: areas.length - known.length });\n}\n\n// ─────────────────────────────────────────────────────────────────\n// Component\n// ─────────────────────────────────────────────────────────────────\n\nexport interface ChoroplethMapProps extends Omit<React.ComponentProps<'figure'>, 'children'> {\n  /** The areas, as SVG paths in `viewBox` coordinates. */\n  areas: readonly MapArea[];\n  /** A value per area id. Missing or null is drawn as \"No data\", never as the lowest class. */\n  values: Readonly<Record<string, number | null | undefined>>;\n  /** The coordinate box the paths are drawn in, such as `'0 0 800 600'`. */\n  viewBox: string;\n  /** How many classes. @default 5, at most 7 */\n  bins?: number;\n  /** `quantile` (each class holds about as many areas) or `equal` intervals. @default 'quantile' */\n  binning?: MapBinning;\n  /** Your own class breaks, between the smallest and largest value. Overrides `bins` and `binning`. */\n  breaks?: readonly number[];\n  /** The chart hue the shades are mixed from. @default 1 */\n  tone?: MapTone;\n  /** How values print, as `Intl.NumberFormat` options. @default plain numbers */\n  format?: Intl.NumberFormatOptions;\n  /** A BCP 47 locale for the numbers. @default the reader's */\n  locale?: string;\n  /** The chart's title. */\n  label?: React.ReactNode;\n  /** What the legend's swatches mean, such as \"Homes with solar panels\". */\n  legendLabel?: string;\n  /** Show the table of areas, which otherwise is for screen readers only. */\n  showTable?: boolean;\n  /** Reserve the map's box while the data loads. */\n  loading?: boolean;\n  /** Fixed words, for pages in another language. */\n  labels?: Partial<ChoroplethMapLabels>;\n}\n\nexport const ChoroplethMap = React.forwardRef<HTMLElement, ChoroplethMapProps>(function ChoroplethMap(\n  {\n    areas,\n    values,\n    viewBox,\n    bins = 5,\n    binning = 'quantile',\n    breaks,\n    tone = 1,\n    format: formatOptions,\n    locale,\n    label,\n    legendLabel,\n    showTable = false,\n    loading = false,\n    labels: labelsProp,\n    className,\n    ...props\n  },\n  ref,\n) {\n  const labels = { ...LABELS, ...labelsProp };\n  const labelId = React.useId();\n  const hatchId = `${React.useId().replaceAll(':', '')}-hatch`;\n  const [hovered, setHovered] = React.useState<number | null>(null);\n  const [focused, setFocused] = React.useState<number | null>(null);\n  const [activeBin, setActiveBin] = React.useState<number | null>(null);\n  const [pinnedBin, setPinnedBin] = React.useState<number | null>(null);\n\n  const number = React.useMemo(() => new Intl.NumberFormat(locale, formatOptions), [locale, formatOptions]);\n  const format = (v: number) => number.format(v);\n\n  const classes = React.useMemo(\n    () => mapBins(areas.map((a) => values[a.id]), { bins, binning, breaks }),\n    [areas, values, bins, binning, breaks],\n  );\n  const classCount = Math.max(0, classes.edges.length - 1);\n  const tableCaption = labels.tableCaption(typeof label === 'string' ? label : undefined);\n  const steps = shadeSteps(classCount);\n  // Keyboard order: by name, so a reader who knows the area's name can find it.\n  const order = React.useMemo(\n    () => areas.map((a, i) => ({ a, i })).sort((x, y) => x.a.label.localeCompare(y.a.label, locale)).map((x) => x.i),\n    [areas, locale],\n  );\n\n  if (loading) {\n    return (\n      <figure\n        ref={ref}\n        data-slot=\"choropleth-map\"\n        data-state=\"loading\"\n        data-min-viewport={String(MIN_VIEWPORT)}\n        aria-busy=\"true\"\n        className={cn('m-0 w-full', className)}\n        {...props}\n      >\n        <Skeleton variant=\"chart\" />\n      </figure>\n    );\n  }\n\n  if (areas.length === 0) {\n    return (\n      <figure\n        ref={ref}\n        data-slot=\"choropleth-map\"\n        data-state=\"empty\"\n        data-min-viewport={String(MIN_VIEWPORT)}\n        className={cn('m-0 w-full rounded-xl border border-border p-6', className)}\n        {...props}\n      >\n        <p className=\"text-sm text-muted-foreground\">{labels.empty}</p>\n      </figure>\n    );\n  }\n\n  const binOfArea = (i: number) => binOf(values[areas[i]!.id], classes);\n  const active = hovered ?? focused;\n  const highlightBin = activeBin ?? pinnedBin;\n  const missing = areas.some((a) => !finite(values[a.id]));\n  const summary = describeMap(areas, values, format, labels.summary);\n  const range = (b: number) => `${format(classes.edges[b]!)}–${format(classes.edges[b + 1]!)}`;\n\n  const step = (delta: number | 'first' | 'last') => {\n    const at = focused === null ? -1 : order.indexOf(focused);\n    const next =\n      delta === 'first'\n        ? 0\n        : delta === 'last'\n          ? order.length - 1\n          : at === -1\n            ? delta > 0\n              ? 0\n              : order.length - 1\n            : (at + delta + order.length) % order.length;\n    setFocused(order[next]!);\n  };\n\n  const onKeyDown = (event: React.KeyboardEvent<SVGSVGElement>) => {\n    const keys: Record<string, () => void> = {\n      ArrowRight: () => step(1),\n      ArrowDown: () => step(1),\n      ArrowLeft: () => step(-1),\n      ArrowUp: () => step(-1),\n      Home: () => step('first'),\n      End: () => step('last'),\n      Escape: () => setFocused(null),\n    };\n    const run = keys[event.key];\n    // With nothing picked out, Escape belongs to the page (a dialog around the map, say).\n    if (!run || (event.key === 'Escape' && focused === null)) return;\n    event.preventDefault();\n    run();\n  };\n\n  const point = (event: React.PointerEvent<SVGSVGElement>) => {\n    const index = (event.target as Element).getAttribute('data-index');\n    setHovered(index === null ? null : Number(index));\n  };\n\n  const readout =\n    active === null\n      ? null\n      : (() => {\n          const area = areas[active]!;\n          const v = values[area.id];\n          const b = binOfArea(active);\n          return finite(v) ? labels.readout(area.label, format(v), range(b)) : labels.readout(area.label, null, null);\n        })();\n\n  // The hatch is a pattern, so missing areas take it as a `fill` attribute; classes cannot name an id made at render.\n  const hatch = `url(#${hatchId})`;\n  const fillOf = (b: number) => (b === -1 ? undefined : LADDER[steps[b]!]);\n\n  return (\n    <figure\n      ref={ref}\n      data-slot=\"choropleth-map\"\n      data-min-viewport={String(MIN_VIEWPORT)}\n      aria-labelledby={label ? labelId : undefined}\n      className={cn('m-0 flex w-full min-w-0 flex-col gap-3', TONE[tone], className)}\n      {...props}\n    >\n      {label ? (\n        <figcaption id={labelId} data-slot=\"choropleth-map-label\" className=\"text-foreground text-ui-sm font-medium\">\n          {label}\n        </figcaption>\n      ) : null}\n\n      <div data-slot=\"choropleth-map-legend\" className=\"flex flex-col gap-1\">\n        {legendLabel ? <p className=\"text-muted-foreground m-0 text-caption\">{legendLabel}</p> : null}\n        <ul className=\"m-0 flex list-none flex-wrap gap-x-3 gap-y-1 p-0 text-ui-sm tabular-nums\">\n          {Array.from({ length: classCount }, (_, b) => (\n            <li key={b}>\n              <button\n                type=\"button\"\n                aria-pressed={pinnedBin === b}\n                data-slot=\"choropleth-map-legend-item\"\n                data-active={highlightBin === b ? '' : undefined}\n                onPointerEnter={() => setActiveBin(b)}\n                onPointerLeave={() => setActiveBin(null)}\n                onFocus={() => setActiveBin(b)}\n                onBlur={() => setActiveBin(null)}\n                onClick={() => setPinnedBin((current) => (current === b ? null : b))}\n                className={cn(\n                  '-mx-1.5 flex min-h-target items-center gap-2 rounded-md px-1.5 py-0.5',\n                  'hover:bg-muted data-[active]:bg-muted aria-pressed:bg-muted',\n                  'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-hidden',\n                )}\n              >\n                <svg aria-hidden viewBox=\"0 0 12 12\" className=\"size-3 shrink-0 overflow-visible\">\n                  <rect width=\"12\" height=\"12\" rx=\"2\" strokeWidth={1} className={cn(LADDER[steps[b]!], 'stroke-border')} />\n                </svg>\n                <span className=\"text-foreground\">{range(b)}</span>\n              </button>\n            </li>\n          ))}\n          {missing ? (\n            <li className=\"flex min-h-target items-center gap-2 py-0.5\">\n              <svg aria-hidden viewBox=\"0 0 12 12\" className=\"size-3 shrink-0 overflow-visible\">\n                <rect width=\"12\" height=\"12\" rx=\"2\" strokeWidth={1} fill={hatch} className=\"stroke-border\" />\n              </svg>\n              <span className=\"text-muted-foreground\">{labels.noData}</span>\n            </li>\n          ) : null}\n        </ul>\n      </div>\n\n      <svg\n        data-slot=\"choropleth-map-plot\"\n        viewBox={viewBox}\n        role=\"img\"\n        aria-label={summary}\n        tabIndex={0}\n        onKeyDown={onKeyDown}\n        onBlur={() => setFocused(null)}\n        onPointerMove={point}\n        onPointerLeave={() => setHovered(null)}\n        className={cn(\n          'block h-auto w-full rounded-md',\n          'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden',\n        )}\n      >\n        <defs>\n          <pattern id={hatchId} width=\"6\" height=\"6\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\">\n            <rect width=\"6\" height=\"6\" className=\"fill-muted\" />\n            <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"6\" strokeWidth=\"2\" className=\"stroke-muted-foreground/50\" />\n          </pattern>\n        </defs>\n        {areas.map((area, i) => {\n          const b = binOfArea(i);\n          return (\n            <path\n              key={area.id}\n              data-slot=\"choropleth-map-area\"\n              data-index={i}\n              data-bin={b}\n              d={area.d}\n              fill={b === -1 ? hatch : undefined}\n              vectorEffect=\"non-scaling-stroke\"\n              strokeWidth={0.75}\n              strokeLinejoin=\"round\"\n              className={cn(\n                'stroke-background motion-safe:transition-opacity motion-safe:duration-(--duration-fast)',\n                fillOf(b),\n                highlightBin !== null && b !== highlightBin && 'opacity-25',\n              )}\n            >\n              <title>{labels.readout(area.label, finite(values[area.id]) ? format(values[area.id]!) : null, null)}</title>\n            </path>\n          );\n        })}\n        {active !== null ? (\n          <path\n            data-slot=\"choropleth-map-active\"\n            d={areas[active]!.d}\n            vectorEffect=\"non-scaling-stroke\"\n            strokeWidth={2}\n            strokeLinejoin=\"round\"\n            className=\"stroke-foreground pointer-events-none fill-none\"\n          />\n        ) : null}\n      </svg>\n\n      <output\n        data-slot=\"choropleth-map-readout\"\n        aria-live=\"polite\"\n        className=\"text-muted-foreground min-h-[1lh] text-caption tabular-nums\"\n      >\n        {readout ?? (classCount > 0 ? labels.hint : '')}\n      </output>\n\n      {/* Shown, the table scrolls, so it takes focus and a name: keyboard users can scroll it too. */}\n      <div\n        data-slot=\"choropleth-map-table\"\n        className={cn(\n          showTable\n            ? 'focus-visible:ring-ring max-h-96 overflow-auto rounded-md focus-visible:ring-2 focus-visible:outline-hidden'\n            : 'sr-only',\n        )}\n        {...(showTable ? { role: 'region', tabIndex: 0, 'aria-label': tableCaption } : {})}\n      >\n        <table className=\"w-full text-ui-sm tabular-nums\">\n          <caption className=\"text-muted-foreground pb-2 text-start text-caption\">{tableCaption}</caption>\n          <thead>\n            <tr className=\"border-border border-b\">\n              <th scope=\"col\" className=\"py-1.5 pe-4 text-start font-medium\">\n                {labels.area}\n              </th>\n              <th scope=\"col\" className=\"py-1.5 text-end font-medium\">\n                {legendLabel ?? labels.value}\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            {order.map((i) => {\n              const area = areas[i]!;\n              const v = values[area.id];\n              return (\n                <tr key={area.id} className=\"border-border border-b\">\n                  <th scope=\"row\" className=\"py-1.5 pe-4 text-start font-normal\">\n                    {area.label}\n                  </th>\n                  <td className=\"py-1.5 text-end\">{finite(v) ? format(v) : labels.noData}</td>\n                </tr>\n              );\n            })}\n          </tbody>\n        </table>\n      </div>\n    </figure>\n  );\n});\nChoroplethMap.displayName = 'ChoroplethMap';\n"
    }
  ],
  "meta": {
    "tier": "chart",
    "client": true,
    "minViewport": 320,
    "loading": true,
    "version": "1.1.1",
    "since": "2.0.0"
  },
  "docs": "## @interlace/choropleth-map\n\nInstalled to `components/ui/charts/choropleth-map.tsx`.\n\n```tsx\nimport { /* … */ } from '@/components/ui/charts/choropleth-map';\n```\n\nProps, a11y contract, live preview and source: https://ds.interlace.tools/c/choropleth-map\n\nRequires the `@interlace/interlace-base` CSS baseline (installed automatically as a registry dependency). For the Interlace look, also add `@interlace/theme`."
}
