{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "geo-map",
  "type": "registry:component",
  "title": "Geo Map",
  "description": "A map drawn from GeoJSON the project passes (no tiles, no hosted data), in any d3-geo projection fitted to its box, zoomed and panned by dragging, pinching, Ctrl and the wheel, a double click, buttons or keys, with parts for a graticule, plain shapes, a scale bar, and layers that are read item by item by arrow keys.",
  "categories": [
    "viz"
  ],
  "dependencies": [
    "d3-geo",
    "lucide-react"
  ],
  "devDependencies": [
    "@types/d3-geo"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/announce",
    "@rivier-ui/chart",
    "@rivier-ui/cn",
    "@rivier-ui/use-controllable-state",
    "@rivier-ui/use-size"
  ],
  "files": [
    {
      "path": "registry/viz/geo-map.tsx",
      "type": "registry:component",
      "target": "components/viz/geo-map.tsx",
      "content": "\"use client\";\n/**\n * @name geo-map\n * @category viz\n * @description A map drawn from GeoJSON the project passes (no tiles, no hosted data), in any d3-geo projection fitted to its box, zoomed and panned by dragging, pinching, Ctrl and the wheel, a double click, buttons or keys, with parts for a graticule, plain shapes, a scale bar, and layers that are read item by item by arrow keys.\n * @when Showing places, regions or routes from data the project holds: a choropleth, sites on a map, flows between cities. Add layers inside it: choropleth, geo-markers, geo-routes, geo-hexbin, geo-tiles. Inside layout/map-frame it loads only when asked. For a street map with search and directions, bring a map engine and put it in map-frame; for a spinning globe as decoration use three/globe.\n * @example\n * <GeoMap label=\"Regions of the study area\" fit={regions} projection=\"equal-earth\">\n *   <GeoGraticule />\n *   <GeoFeatures data={regions} />\n *   <GeoMarkers label=\"Sites\" points={[{ id: \"a\", name: \"Site A\", lon: 10.7, lat: 59.9 }]} />\n *   <GeoScaleBar />\n * </GeoMap>\n */\nimport {\n  geoAzimuthalEqualArea,\n  geoConicEqualArea,\n  geoDistance,\n  geoEqualEarth,\n  geoEquirectangular,\n  geoGraticule10,\n  geoMercator,\n  geoNaturalEarth1,\n  geoOrthographic,\n  geoPath,\n  geoTransverseMercator,\n  type ExtendedFeature,\n  type ExtendedFeatureCollection,\n  type GeoPath,\n  type GeoPermissibleObjects,\n  type GeoProjection,\n} from \"d3-geo\";\nimport { Minus, Plus, RotateCcw } from \"lucide-react\";\nimport { createContext, use, useEffect, useId, useRef, useState, type ComponentProps, type KeyboardEvent, type MouseEvent, type PointerEvent, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { announce } from \"@/lib/announce\";\nimport { cn } from \"@/lib/cn\";\nimport { useControllableState } from \"@/lib/use-controllable-state\";\nimport { useSize } from \"@/lib/use-size\";\nimport { ChartDataTable, ChartTooltip, formatNumber, type ChartTable, type ChartTooltipRow } from \"@/components/viz/chart\";\n\n/** The projections by name. Pass a function for any other d3-geo projection. */\nexport type GeoProjectionName = \"equal-earth\" | \"natural-earth\" | \"mercator\" | \"equirectangular\" | \"orthographic\" | \"conic-equal-area\" | \"azimuthal-equal-area\" | \"transverse-mercator\";\n\n/** Zoom and pan: `k` is the zoom (1 is the fitted map), `x` and `y` the shift in pixels. */\nexport type GeoView = { k: number; x: number; y: number };\n\nexport type GeoMapLabels = {\n  zoomIn: string;\n  zoomOut: string;\n  reset: string;\n  /** What the map is called as a kind of thing, for screen readers. */\n  map: string;\n  /** Said once when the map takes focus. */\n  help: string;\n  /** Said after a zoom: \"Zoom 2×\". */\n  zoom: (k: string) => string;\n};\n\nconst LABELS: GeoMapLabels = {\n  zoomIn: \"Zoom in\",\n  zoomOut: \"Zoom out\",\n  reset: \"Reset the view\",\n  map: \"map\",\n  help: \"Arrow keys move the map, plus and minus zoom, 0 resets. Tab reaches the layers.\",\n  zoom: (k) => `Zoom ${k}×`,\n};\n\nconst FACTORIES: Record<GeoProjectionName, () => GeoProjection> = {\n  \"equal-earth\": geoEqualEarth,\n  \"natural-earth\": geoNaturalEarth1,\n  mercator: geoMercator,\n  equirectangular: geoEquirectangular,\n  orthographic: geoOrthographic,\n  \"conic-equal-area\": geoConicEqualArea,\n  \"azimuthal-equal-area\": geoAzimuthalEqualArea,\n  \"transverse-mercator\": geoTransverseMercator,\n};\n\nconst SPHERE: GeoPermissibleObjects = { type: \"Sphere\" };\nconst HOME: GeoView = { k: 1, x: 0, y: 0 };\nconst PAN_STEP = 64;\n\ntype GeoMapContextValue = {\n  /** The projection with the zoom and pan applied: what every layer draws with. */\n  projection: GeoProjection;\n  path: GeoPath;\n  width: number;\n  height: number;\n  view: GeoView;\n  /** The projection's scale at zoom 1, so a layer can tell how far it is zoomed in pixels. */\n  baseScale: number;\n  /** Moves the view so the point at these pixels is in the middle. */\n  centreOn: (x: number, y: number) => void;\n  /** The HTML layer over the map where tooltips go. */\n  overlay: HTMLElement | null;\n  locale: string;\n};\n\nconst GeoMapContext = createContext<GeoMapContextValue | null>(null);\n\n/** The map a layer is inside: its projection, path, size and view. */\nexport function useGeoMap(part = \"A map layer\"): GeoMapContextValue {\n  const context = use(GeoMapContext);\n  if (!context) throw new Error(`${part} must be inside a GeoMap.`);\n  return context;\n}\n\nexport type GeoMapProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n  /** What the map shows, for assistive technology. */\n  label: string;\n  /** The GeoJSON the map is fitted to at zoom 1. Default: the whole sphere. */\n  fit?: GeoPermissibleObjects | ExtendedFeatureCollection;\n  projection?: GeoProjectionName | (() => GeoProjection);\n  /** Turns the globe before projecting: [longitude, latitude], as d3-geo's rotate. */\n  rotate?: [number, number] | [number, number, number];\n  /** Zoom and pan. Controlled with `onViewChange`. */\n  view?: GeoView;\n  defaultView?: GeoView;\n  onViewChange?: (view: GeoView) => void;\n  minZoom?: number;\n  maxZoom?: number;\n  /** When the wheel zooms: with Ctrl or ⌘ held (default, so the page still scrolls), always, or never. */\n  wheel?: \"modifier\" | \"always\" | \"never\";\n  /** Width / height. Default 16 / 10. */\n  aspect?: number;\n  /** A fixed height in pixels instead of a ratio. */\n  height?: number;\n  /** Space between the fitted shape and the edge, in pixels. Default 12. */\n  padding?: number;\n  /** The zoom buttons. Default true. */\n  showControls?: boolean;\n  labels?: Partial<GeoMapLabels>;\n  locale?: string;\n  /** Layers and parts: GeoGraticule, GeoFeatures, choropleth, markers, routes… */\n  children?: ReactNode;\n};\n\nexport function GeoMap({\n  label,\n  fit = SPHERE,\n  projection = \"equal-earth\",\n  rotate,\n  view: viewProp,\n  defaultView = HOME,\n  onViewChange,\n  minZoom = 1,\n  maxZoom = 16,\n  wheel = \"modifier\",\n  aspect = 16 / 10,\n  height,\n  padding = 12,\n  showControls = true,\n  labels: given,\n  locale = \"en-US\",\n  className,\n  style,\n  children,\n  ...props\n}: GeoMapProps) {\n  const labels = { ...LABELS, ...given };\n  const { ref, width, height: measured } = useSize<HTMLDivElement>();\n  const [view, setView] = useControllableState<GeoView>({ value: viewProp, defaultValue: defaultView, onChange: onViewChange });\n  const [overlay, setOverlay] = useState<HTMLDivElement | null>(null);\n  const helpId = useId();\n  const pointers = useRef(new Map<number, { x: number; y: number }>());\n  const gesture = useRef<{ view: GeoView; distance: number; centre: { x: number; y: number }; moved: boolean } | null>(null);\n\n  const clampView = (next: GeoView): GeoView => {\n    const k = Math.max(minZoom, Math.min(maxZoom, next.k));\n    // Keep at least a quarter of the map in the box.\n    const spareX = width * 0.75;\n    const spareY = measured * 0.75;\n    return { k, x: Math.max(width - width * k - spareX, Math.min(spareX, next.x)), y: Math.max(measured - measured * k - spareY, Math.min(spareY, next.y)) };\n  };\n  const zoomAt = (factor: number, px = width / 2, py = measured / 2, base = view): GeoView => {\n    const k = Math.max(minZoom, Math.min(maxZoom, base.k * factor));\n    return clampView({ k, x: px - ((px - base.x) * k) / base.k, y: py - ((py - base.y) * k) / base.k });\n  };\n  const zoomText = (k: number): string => formatNumber(k, locale, { maximumFractionDigits: 1 });\n  const zoomBy = (factor: number): void => {\n    const next = zoomAt(factor);\n    setView(next);\n    announce(labels.zoom(zoomText(next.k)));\n  };\n\n  const factory = typeof projection === \"function\" ? projection : FACTORIES[projection];\n  let context: GeoMapContextValue | null = null;\n  if (width > 0 && measured > 0) {\n    const base = factory();\n    if (rotate) base.rotate(rotate);\n    base.fitExtent(\n      [\n        [padding, padding],\n        [width - padding, measured - padding],\n      ],\n      fit as GeoPermissibleObjects,\n    );\n    const scale = base.scale();\n    const [tx, ty] = base.translate();\n    base.scale(scale * view.k).translate([tx * view.k + view.x, ty * view.k + view.y]);\n    base.clipExtent([\n      [0, 0],\n      [width, measured],\n    ]);\n    context = {\n      projection: base,\n      path: geoPath(base),\n      width,\n      height: measured,\n      view,\n      baseScale: scale,\n      centreOn: (x, y) => setView(clampView({ k: view.k, x: view.x + (width / 2 - x), y: view.y + (measured / 2 - y) })),\n      overlay,\n      locale,\n    };\n  }\n\n  const onKeyDown = (event: KeyboardEvent<SVGSVGElement>): void => {\n    if (event.target !== event.currentTarget) return;\n    const pans: Record<string, [number, number]> = { ArrowLeft: [PAN_STEP, 0], ArrowRight: [-PAN_STEP, 0], ArrowUp: [0, PAN_STEP], ArrowDown: [0, -PAN_STEP] };\n    const pan = pans[event.key];\n    if (pan) setView(clampView({ k: view.k, x: view.x + pan[0], y: view.y + pan[1] }));\n    else if (event.key === \"+\" || event.key === \"=\") zoomBy(1.5);\n    else if (event.key === \"-\" || event.key === \"_\") zoomBy(1 / 1.5);\n    else if (event.key === \"0\") {\n      setView(HOME);\n      announce(labels.zoom(zoomText(1)));\n    } else return;\n    event.preventDefault();\n  };\n  const local = (event: MouseEvent<SVGSVGElement>): { x: number; y: number } => {\n    const box = event.currentTarget.getBoundingClientRect();\n    return { x: event.clientX - box.left, y: event.clientY - box.top };\n  };\n  const startGesture = (): void => {\n    const points = [...pointers.current.values()];\n    const a = points[0];\n    const b = points[1] ?? a;\n    if (!a || !b) return;\n    gesture.current = { view, distance: Math.hypot(a.x - b.x, a.y - b.y), centre: { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }, moved: false };\n  };\n  const onPointerDown = (event: PointerEvent<SVGSVGElement>): void => {\n    if (event.button !== 0) return;\n    pointers.current.set(event.pointerId, local(event));\n    startGesture();\n  };\n  const onPointerMove = (event: PointerEvent<SVGSVGElement>): void => {\n    if (!pointers.current.has(event.pointerId) || !gesture.current) return;\n    pointers.current.set(event.pointerId, local(event));\n    const points = [...pointers.current.values()];\n    const a = points[0];\n    const b = points[1] ?? a;\n    if (!a || !b) return;\n    const start = gesture.current;\n    const centre = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };\n    if (!start.moved && Math.hypot(centre.x - start.centre.x, centre.y - start.centre.y) < 4 && points.length < 2) return;\n    if (!start.moved) {\n      start.moved = true;\n      event.currentTarget.setPointerCapture(event.pointerId);\n    }\n    const factor = points.length > 1 && start.distance > 0 ? Math.hypot(a.x - b.x, a.y - b.y) / start.distance : 1;\n    const zoomed = zoomAt(factor, start.centre.x, start.centre.y, start.view);\n    setView(clampView({ k: zoomed.k, x: zoomed.x + centre.x - start.centre.x, y: zoomed.y + centre.y - start.centre.y }));\n  };\n  const onPointerEnd = (event: PointerEvent<SVGSVGElement>): void => {\n    pointers.current.delete(event.pointerId);\n    if (pointers.current.size > 0) startGesture();\n    else gesture.current = null;\n  };\n  const onWheel = (event: globalThis.WheelEvent, node: SVGSVGElement): void => {\n    if (wheel === \"never\" || (wheel === \"modifier\" && !event.ctrlKey && !event.metaKey)) return;\n    event.preventDefault();\n    const box = node.getBoundingClientRect();\n    setView(zoomAt(Math.exp(-event.deltaY * 0.002), event.clientX - box.left, event.clientY - box.top));\n  };\n  // React listens to the wheel passively, where preventDefault is ignored: the newest handler is kept here\n  // and called from a listener of our own.\n  const wheelHandler = useRef(onWheel);\n  useEffect(() => {\n    wheelHandler.current = onWheel;\n  });\n  const attachWheel = (node: SVGSVGElement | null): (() => void) | undefined => {\n    if (!node) return undefined;\n    const listener = (event: globalThis.WheelEvent): void => wheelHandler.current(event, node);\n    node.addEventListener(\"wheel\", listener, { passive: false });\n    return () => node.removeEventListener(\"wheel\", listener);\n  };\n\n  return (\n    <div\n      ref={ref}\n      data-slot=\"geo-map\"\n      className={cn(\"relative w-full min-w-0 overflow-hidden rounded-surface border bg-card\", className)}\n      style={{ ...(height === undefined ? { aspectRatio: String(aspect) } : { height }), ...style }}\n      {...props}\n    >\n      {context ? (\n        <GeoMapContext value={context}>\n          <svg\n            ref={attachWheel}\n            data-slot=\"geo-map-svg\"\n            role=\"application\"\n            aria-roledescription={labels.map}\n            aria-label={label}\n            aria-describedby={helpId}\n            tabIndex={0}\n            width={width}\n            height={measured}\n            viewBox={`0 0 ${width} ${measured}`}\n            direction=\"ltr\"\n            className={cn(\"absolute inset-0 block select-none animate-in fade-in-0 motion-reduce:animate-none\", view.k > 1 ? \"touch-none cursor-grab\" : \"touch-pan-y\")}\n            onKeyDown={onKeyDown}\n            onPointerDown={onPointerDown}\n            onPointerMove={onPointerMove}\n            onPointerUp={onPointerEnd}\n            onPointerCancel={onPointerEnd}\n            onDoubleClick={(event) => {\n              const point = local(event);\n              setView(zoomAt(event.shiftKey ? 1 / 2 : 2, point.x, point.y));\n            }}\n          >\n            {children}\n          </svg>\n        </GeoMapContext>\n      ) : null}\n      <span id={helpId} className=\"sr-only\">\n        {labels.help}\n      </span>\n      <div ref={setOverlay} data-slot=\"geo-map-overlay\" className=\"pointer-events-none absolute inset-0\" />\n      {showControls ? (\n        <div data-slot=\"geo-map-controls\" className=\"absolute end-2 top-2 flex flex-col overflow-hidden rounded-control border bg-background\">\n          <GeoMapButton label={labels.zoomIn} onClick={() => zoomBy(1.5)} disabled={view.k >= maxZoom}>\n            <Plus aria-hidden=\"true\" />\n          </GeoMapButton>\n          <GeoMapButton label={labels.zoomOut} onClick={() => zoomBy(1 / 1.5)} disabled={view.k <= minZoom} className=\"border-y\">\n            <Minus aria-hidden=\"true\" />\n          </GeoMapButton>\n          <GeoMapButton\n            label={labels.reset}\n            onClick={() => {\n              setView(HOME);\n              announce(labels.zoom(zoomText(1)));\n            }}\n            disabled={view.k === 1 && view.x === 0 && view.y === 0}\n          >\n            <RotateCcw aria-hidden=\"true\" />\n          </GeoMapButton>\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\nfunction GeoMapButton({ label, className, children, ...props }: Omit<ComponentProps<\"button\">, \"type\"> & { label: string }) {\n  return (\n    <button\n      type=\"button\"\n      aria-label={label}\n      className={cn(\"flex size-9 items-center justify-center text-foreground hover:bg-accent disabled:opacity-40 pointer-coarse:size-11 [&_svg]:size-4\", className)}\n      {...props}\n    >\n      {children}\n    </button>\n  );\n}\n\n/** The lines of latitude and longitude every 10°, and the outline of the globe. */\nexport function GeoGraticule({ outline = true, className, ...props }: ComponentProps<\"g\"> & { outline?: boolean }) {\n  const { path } = useGeoMap(\"GeoGraticule\");\n  return (\n    <g data-slot=\"geo-graticule\" aria-hidden=\"true\" fill=\"none\" className={cn(\"stroke-border\", className)} {...props}>\n      <path d={path(geoGraticule10()) ?? \"\"} strokeWidth={0.75} />\n      {outline ? <path d={path(SPHERE) ?? \"\"} className=\"stroke-border-strong\" /> : null}\n    </g>\n  );\n}\n\nexport type GeoFeaturesProps = Omit<ComponentProps<\"g\">, \"fill\"> & {\n  /** Shapes to draw as they are: land, borders, the study area. */\n  data: ExtendedFeatureCollection | ExtendedFeature | GeoPermissibleObjects;\n  /** \"fill\" draws a muted ground with a hairline edge; \"line\" only the edges. */\n  variant?: \"fill\" | \"line\";\n};\n\n/** Plain shapes under or over the data: a base of land or regions. Decoration: hidden from screen readers. */\nexport function GeoFeatures({ data, variant = \"fill\", className, ...props }: GeoFeaturesProps) {\n  const { path } = useGeoMap(\"GeoFeatures\");\n  const features = (data as ExtendedFeatureCollection).type === \"FeatureCollection\" ? (data as ExtendedFeatureCollection).features : [data as ExtendedFeature];\n  return (\n    <g data-slot=\"geo-features\" aria-hidden=\"true\" className={cn(variant === \"fill\" ? \"fill-muted stroke-border-strong\" : \"fill-none stroke-border-strong\", className)} strokeWidth={0.75} {...props}>\n      {features.map((feature, index) => (\n        <path key={index} d={path(feature) ?? \"\"} />\n      ))}\n    </g>\n  );\n}\n\nexport type GeoScaleBarProps = ComponentProps<\"div\"> & {\n  /** Kilometres or miles. */\n  unit?: \"kilometer\" | \"mile\";\n  /** The longest the bar may be, in pixels. Default 120. */\n  maxWidth?: number;\n};\n\n/** A bar of a round distance at the middle of the map, which changes with the zoom. Rendered in the overlay. */\nexport function GeoScaleBar({ unit = \"kilometer\", maxWidth = 120, className, ...props }: GeoScaleBarProps) {\n  const { projection, width, height, overlay, locale } = useGeoMap(\"GeoScaleBar\");\n  const a = projection.invert?.([width / 2 - maxWidth / 2, height / 2]);\n  const b = projection.invert?.([width / 2 + maxWidth / 2, height / 2]);\n  if (!overlay || !a || !b || !Number.isFinite(a[0]) || !Number.isFinite(b[0])) return null;\n  const radius = unit === \"kilometer\" ? 6371 : 3958.8;\n  const across = geoDistance(a, b) * radius;\n  if (!(across > 0)) return null;\n  const magnitude = 10 ** Math.floor(Math.log10(across));\n  const nice = [5, 2, 1].map((step) => step * magnitude).find((value) => value <= across) ?? magnitude;\n  const pixels = (nice / across) * maxWidth;\n  const text = formatNumber(nice, locale, { style: \"unit\", unit, unitDisplay: \"short\", maximumFractionDigits: 2 });\n  return createPortal(\n    <div data-slot=\"geo-scale-bar\" className={cn(\"absolute bottom-2 start-2 rounded-control bg-background/85 px-1.5 py-1 text-xs tabular-nums text-foreground\", className)} {...props}>\n      <div className=\"h-1.5 border-x-2 border-b-2 border-foreground\" style={{ width: pixels }} aria-hidden=\"true\" />\n      <span>{text}</span>\n    </div>,\n    overlay,\n  );\n}\n\n/** One thing in a layer that can be read: where it is on screen and what it says. */\nexport type GeoReadable = { x: number; y: number; title: string; rows: readonly ChartTooltipRow[] };\n\nexport type GeoLayerProps = Omit<ComponentProps<\"g\">, \"children\"> & {\n  /** The layer's name, for screen readers: \"Sites\", \"Population by region\". */\n  label: string;\n  /** Its items in reading order, with where each is now. */\n  items: readonly GeoReadable[];\n  /** Draws the layer; told which item is being read. */\n  children: (active: number | null, point: (index: number | null) => void) => ReactNode;\n};\n\n/**\n * A layer that can be read: a focusable group whose items are reached by arrow keys (Home, End, Escape), said\n * aloud, shown in a tooltip, and brought into view when they are off screen. Every layer of the library is\n * built on it; use it for a layer of your own.\n */\nexport function GeoLayer({ label, items, children, className, ...props }: GeoLayerProps) {\n  const { overlay, width, height, centreOn } = useGeoMap(\"GeoLayer\");\n  const [active, setActive] = useState<number | null>(null);\n  const current = active !== null && active < items.length ? items[active] : undefined;\n  const say = (item: GeoReadable | undefined): void => {\n    if (item) announce(`${item.title}${item.rows.length > 0 ? \": \" : \"\"}${item.rows.map((row) => `${row.label} ${row.value}`.trim()).join(\", \")}`);\n  };\n  const go = (index: number | null): void => {\n    if (index === null || items.length === 0) {\n      setActive(null);\n      return;\n    }\n    const next = Math.max(0, Math.min(items.length - 1, index));\n    const item = items[next];\n    setActive(next);\n    say(item);\n    if (item && (item.x < 0 || item.y < 0 || item.x > width || item.y > height)) centreOn(item.x, item.y);\n  };\n  const onKeyDown = (event: KeyboardEvent<SVGGElement>): void => {\n    const steps: Record<string, number> = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };\n    if (event.key in steps) go(active === null ? 0 : active + (steps[event.key] ?? 0));\n    else if (event.key === \"Home\") go(0);\n    else if (event.key === \"End\") go(items.length - 1);\n    else if (event.key === \"Escape\") go(null);\n    else return;\n    event.preventDefault();\n    event.stopPropagation();\n  };\n  return (\n    <g\n      data-slot=\"geo-layer\"\n      role=\"group\"\n      aria-label={label}\n      tabIndex={0}\n      className={cn(\"rounded-control\", className)}\n      onKeyDown={onKeyDown}\n      onBlur={() => setActive(null)}\n      onPointerLeave={() => setActive(null)}\n      {...props}\n    >\n      {children(current ? active : null, (index) => setActive(index))}\n      {current && overlay ? createPortal(<ChartTooltip x={current.x} y={current.y} side={current.x > width / 2 ? \"left\" : \"right\"} title={current.title} rows={current.rows} />, overlay) : null}\n    </g>\n  );\n}\n\n/** A layer's data as a table for screen readers, placed in the map's HTML layer (a table cannot sit in SVG). */\nexport function GeoTable(props: ChartTable) {\n  const { overlay } = useGeoMap(\"GeoTable\");\n  return overlay ? createPortal(<ChartDataTable {...props} />, overlay) : null;\n}\n"
    }
  ],
  "meta": {
    "category": "viz",
    "when": "Showing places, regions or routes from data the project holds: a choropleth, sites on a map, flows between cities. Add layers inside it: choropleth, geo-markers, geo-routes, geo-hexbin, geo-tiles. Inside layout/map-frame it loads only when asked. For a street map with search and directions, bring a map engine and put it in map-frame; for a spinning globe as decoration use three/globe.",
    "example": "<GeoMap label=\"Regions of the study area\" fit={regions} projection=\"equal-earth\">\n  <GeoGraticule />\n  <GeoFeatures data={regions} />\n  <GeoMarkers label=\"Sites\" points={[{ id: \"a\", name: \"Site A\", lon: 10.7, lat: 59.9 }]} />\n  <GeoScaleBar />\n</GeoMap>",
    "client": true
  }
}
