{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "isochrone-rings",
  "type": "registry:component",
  "title": "Isochrone rings",
  "description": "How far you get from one point in set times. Sample data: stops around one depot in 15-minute rings, 48% under 30 min, 11 late stops.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-isochrone"
  ],
  "files": [
    {
      "path": "registry/chartory/components/isochrone-rings.tsx",
      "type": "registry:component",
      "target": "components/chartory/isochrone-rings.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Isochrone rings (Chartory chart 088): sizes xs | s | m | l, laid out again from the data at each\n// size; collection \"hearth\" (default) or \"signal\" (with @chartory/signal, Code and Complete). Data in the type's shape (default: the sample). Docs:\n// https://usechartory.com/docs/charts/isochrone-rings\nimport { ChartView, type ChartViewProps } from \"@/lib/chartory/charts/chart-view\"\nimport { registerChart } from \"@/lib/chartory/charts/defs\"\nimport { data as sample } from \"@/lib/chartory/charts/types/088-isochrone-rings/data\"\nimport { def } from \"@/lib/chartory/charts/types/088-isochrone-rings/layout\"\n\nregisterChart(def, sample)\n\nexport type IsochroneRingsData = typeof sample\nexport type IsochroneRingsProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: IsochroneRingsData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: IsochroneRingsData[]\n}\n\nexport function IsochroneRings(props: IsochroneRingsProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/088-isochrone-rings/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/088-isochrone-rings/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 088 Drive time zones · sample data (Figma chart/088-isochrone-depot).\nimport type { IsochroneData } from \"../../plots/isochrone\";\n\nexport const data: IsochroneData = {\n  rings: [15, 30, 45, 60],\n  pts: [[1.554, 18.2, false], [0.376, 13.7, false], [0.869, 34.8, false], [3.609, 16, false], [3.882, 31.1, false], [3.63, 27.9, false], [2.777, 55, true], [0.303, 54.8, true], [5.744, 42.5, false], [1.772, 51, true], [4.712, 41.8, false], [4.137, 15.9, false], [6.254, 53.1, true], [3.556, 25.7, false], [4.72, 15.8, false], [0.413, 49.8, true], [3.098, 54.9, true], [4.47, 51.9, false], [4.828, 42.5, false], [1.569, 10.9, false], [0.608, 27.3, false], [5.219, 8.5, false], [4.852, 22.2, false], [2.365, 29.8, false], [1.452, 57.5, true], [2.862, 39.2, false], [4.314, 50.4, false], [5.446, 41.3, false], [5.92, 45.2, false], [4.262, 26.4, false], [5.396, 14.5, false], [5.105, 56.4, true], [6.062, 42.3, false], [6.21, 56.6, false], [2.603, 38.1, false], [5.963, 27.9, false], [4.871, 31.7, false], [2.401, 8, false], [0.963, 26.7, false], [5.584, 25.6, false], [0.357, 38.2, false], [1.747, 19.3, false], [2.183, 52.9, true], [1.326, 21, false], [2.172, 22.4, false], [6.191, 39.5, false], [5.755, 21.3, false], [0.13, 49, true], [2.31, 27.6, false], [1.974, 53.3, true], [0.395, 42.4, false], [0.949, 28.2, false], [1.052, 20.9, false], [2.202, 35, false], [6.263, 29.4, false], [3.57, 11.9, false], [4.874, 23, false], [3.968, 33.7, false]],\n  rows: [{ label: \"Under 30 min\", text: \"48%\" }, { label: \"30–60 min\", text: \"52%\" }, { label: \"Late stops\", text: \"11\", tone: \"status/danger\" }],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/088-isochrone-rings/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/088-isochrone-rings/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 088 Isochrone rings (Figma chart/088-isochrone-depot): C.isochrone, today's stops round Depot North.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { isochrone } from \"../../plots/isochrone\";\nimport { data } from \"./data\";\n\nconst zone = (m: number) => data.rings.find((r) => m <= r)!;\nconst late = data.pts.filter((p) => p[2]).length;\n\n/** Tomorrow's stops: same stops and lateness, drive times move by up to 3 min; the side list counts again. */\nfunction update(d0: unknown, step: number): typeof data {\n  const d = d0 as typeof data;\n  const pts = d.pts.map(([a, m, late], k): [number, number, boolean] => [a, +Math.min(59, Math.max(5, m + 3 * Math.sin(k * 2.1 + step * 1.7 + 0.4))).toFixed(1), late]);\n  const under = Math.round((100 * pts.filter((p) => p[1] < 30).length) / pts.length);\n  return { ...d, pts, rows: [{ ...d.rows[0], text: under + \"%\" }, { ...d.rows[1], text: 100 - under + \"%\" }, { ...d.rows[2], text: String(pts.filter((p) => p[2]).length) }] };\n}\n\n/** Hover: one stop (its dot): drive time, ring and lateness. */\nfunction tip(d0: unknown, g: number): TooltipSpec | null {\n  const d = d0 as typeof data, q = d.pts[g];\n  if (!q) return null;\n  const k = Math.max(0, d.rings.findIndex((x) => q[1] <= x)), lo = k ? d.rings[k - 1] : 0;\n  return { kind: \"value\", text: `Stop ${g + 1} · ${q[1]} min · ${lo}–${d.rings[k]} min ring · ${q[2] ? \"late\" : \"on time\"}` };\n}\n\nexport const def: ChartDef = {\n  no: 88,\n  slug: \"isochrone-rings\",\n  legend: [[\"status/success\", \"On time\"], [\"status/danger\", \"Late\"], [\"text/strong\", \"Depot · rings 15 min\"]],\n  plot: (K, p, w, d) => isochrone(K, p, w, (d as typeof data | undefined) ?? data),\n  tip,\n  update,\n  describe: {\n    title: \"Drive time zones\",\n    summary: `${data.pts.length} stops by drive time from the depot in 15-minute rings: ${data.pts.filter((p) => p[1] < 30).length} under 30 minutes, ${late} late.`,\n    table: { head: [\"Ring (min)\", \"Stops\", \"Late\"], rows: data.rings.map((r) => [r, data.pts.filter((p) => zone(p[1]) === r).length, data.pts.filter((p) => zone(p[1]) === r && p[2]).length]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "space-and-place"
  ],
  "meta": {
    "access": "free",
    "no": 88,
    "family": "Space and place"
  }
}
