{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radial-hour-heatmap",
  "type": "registry:component",
  "title": "Radial hour heatmap",
  "description": "A week of hours around a clock. Sample data: deliveries over 4 weeks by weekday and hour, peak slot Thu 18:00.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-radial-heat"
  ],
  "files": [
    {
      "path": "registry/chartory/components/radial-hour-heatmap.tsx",
      "type": "registry:component",
      "target": "components/chartory/radial-hour-heatmap.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Radial hour heatmap (Chartory chart 052): 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/radial-hour-heatmap\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/052-radial-hour-heatmap/data\"\nimport { def } from \"@/lib/chartory/charts/types/052-radial-hour-heatmap/layout\"\n\nregisterChart(def, sample)\n\nexport type RadialHourHeatmapData = typeof sample\nexport type RadialHourHeatmapProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: RadialHourHeatmapData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: RadialHourHeatmapData[]\n}\n\nexport function RadialHourHeatmap(props: RadialHourHeatmapProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/052-radial-hour-heatmap/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/052-radial-hour-heatmap/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 052 Deliveries by hour · sample data (Figma chart/052, from the Figma definition, seeded values expanded).\nimport type { RadialHeatData } from \"../../plots/radial-heat\";\n\nexport const data: RadialHeatData = {\n  vals: [\n    [0.01, 0.08, 0.05, 0.01, 0.08, 0.12, 0.21, 0.4, 0.54, 0.64, 0.66, 0.66, 0.64, 0.63, 0.63, 0.66, 0.83, 0.9, 0.83, 0.8, 0.49, 0.29, 0.16, 0.04],\n    [0.02, 0.01, 0.07, 0.03, 0.01, 0.01, 0.16, 0.33, 0.58, 0.66, 0.8, 0.65, 0.66, 0.6, 0.71, 0.75, 0.77, 0.83, 0.9, 0.83, 0.62, 0.33, 0.19, 0.06],\n    [0.11, 0.02, 0.08, 0.01, 0.01, 0.11, 0.16, 0.41, 0.64, 0.77, 0.78, 0.79, 0.63, 0.65, 0.79, 0.77, 0.89, 0.83, 0.93, 0.83, 0.56, 0.43, 0.16, 0.05],\n    [0.01, 0.06, 0.01, 0.01, 0.03, 0.07, 0.26, 0.37, 0.57, 0.76, 0.83, 0.71, 0.74, 0.76, 0.81, 0.83, 0.83, 0.96, 0.97, 0.92, 0.63, 0.41, 0.19, 0.06],\n    [0.01, 0.01, 0.01, 0.07, 0.01, 0.15, 0.22, 0.4, 0.61, 0.74, 0.88, 0.78, 0.75, 0.66, 0.74, 0.82, 0.9, 0.96, 0.96, 0.89, 0.66, 0.44, 0.21, 0.15],\n    [0.01, 0.06, 0.03, 0.01, 0.01, 0.06, 0.1, 0.17, 0.29, 0.27, 0.35, 0.34, 0.22, 0.25, 0.28, 0.35, 0.34, 0.42, 0.42, 0.34, 0.19, 0.14, 0.08, 0.09],\n    [0.01, 0.03, 0.01, 0, 0.01, 0.01, 0.13, 0.14, 0.2, 0.26, 0.37, 0.27, 0.24, 0.24, 0.26, 0.28, 0.34, 0.36, 0.4, 0.34, 0.2, 0.17, 0.06, 0.04]\n  ],\n  center: [\n    [\"Label/Caps\", \"MON\", \"label\"],\n    [\"Label/Caps\", \"INSIDE\", \"label\"]\n  ],\n  rows: [\n    { label: \"Peak slot\", text: \"Thu 18:00\" },\n    { label: \"Quietest\", text: \"Sun 03:00\" },\n    { label: \"Weekend\", text: \"14%\", pct: \"OF VOLUME\" }\n  ]\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/052-radial-hour-heatmap/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/052-radial-hour-heatmap/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 052 Radial hour heatmap (Figma chart/052, \"Deliveries by hour\"): C.radialHeat, 7 day rings (Monday inside) × 24 hours.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { radialHeat } from \"../../plots/radial-heat\";\nimport { data } from \"./data\";\nimport { seq } from \"../../core/kit\";\n\nconst days = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\nconst hh = (h: number) => String(h).padStart(2, \"0\") + \":00\";\n\nconst r2 = (v: number) => Math.round(v * 100) / 100;\nconst sum = (a: number[]) => a.reduce((x, y) => x + y, 0);\n\n// tooltip: one day × hour cell (group = day * 24 + hour); share = the slot's part of the week's volume\nconst tip = (o: typeof data, g: number): TooltipSpec | null => {\n  const d = Math.floor(g / 24), h = g % 24, v = o.vals[d]?.[h];\n  if (v == null) return null;\n  const all = sum(o.vals.map(sum));\n  return { kind: \"cell\", caps: days[d].toUpperCase() + \" · \" + hh(h), value: Math.round(v * 100) + \"%\", unit: \"of peak\", swatch: seq(v), share: (all ? (v / all) * 100 : 0).toFixed(1) + \"% OF WEEK\" };\n};\n\nexport const def: ChartDef = {\n  no: 52,\n  slug: \"radial-hour-heatmap\",\n  legend: [[\"data/seq-2\", \"Low\"], [\"data/seq-4\", \"Medium\"], [\"data/seq-6\", \"Peak\"]],\n  flatXs: true,\n  plot: (K, p, w, d) => radialHeat(K, p, w, (d as typeof data | undefined) ?? data),\n  tip: (d, g) => tip(d as typeof data, g),\n  // a later 4 weeks: every slot moves up to ±10 %, the weekend as a whole by −10 … +14 %; the peak slot stays the\n  // busiest, the side list's peak and weekend share are recomputed from the new values\n  update: (d, step) => {\n    const o = d as typeof data;\n    const [pd, ph] = (() => { let b = [0, 0]; o.vals.forEach((r, di) => r.forEach((v, h) => { if (v > o.vals[b[0]][b[1]]) b = [di, h]; })); return b; })();\n    const wk = [0.9, 1.08, 1.14][(step - 1) % 3];\n    const vals = o.vals.map((r, di) => r.map((v, h) => (di === pd && h === ph ? v : Math.min(o.vals[pd][ph] - 0.02, r2(v * (1 + 0.1 * Math.sin(h * 0.7 + di * 1.3 + step * 2.1)) * (di >= 5 ? wk : 1))))));\n    const share = (vs: number[][]) => sum(vs.slice(5).map(sum)) / sum(vs.map(sum));\n    const old = o.rows.find((r) => r.label === \"Weekend\")!;\n    const pct = Math.round((parseFloat(old.text) * share(vals)) / share(o.vals)) + \"%\";\n    return { ...o, vals, rows: o.rows.map((r) => (r.label === \"Peak slot\" ? { ...r, text: days[pd] + \" \" + hh(ph) } : r.label === \"Weekend\" ? { ...r, text: pct } : r)) };\n  },\n  describe: {\n    title: \"Delivery rhythm\",\n    summary: \"Deliveries over the last 4 weeks by weekday and hour, as a share of the busiest slot: the peak is Thursday 18:00, the quietest slot Sunday 03:00, and the weekend carries 14% of the volume.\",\n    table: { head: [\"Day\", ...Array.from({ length: 24 }, (_, h) => hh(h))], rows: data.vals.map((r, d) => [days[d], ...r.map((v) => Math.round(v * 100) + \"%\")]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "schedule-and-status"
  ],
  "meta": {
    "access": "free",
    "no": 52,
    "family": "Schedule and status"
  }
}
