{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rate-dot-plot",
  "type": "registry:component",
  "title": "Rate dot plot",
  "description": "Each member's view, year by year. Sample data: member views of the rate for 2026, 2027, 2028 and the longer run, between 2.0% and 4.5%.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-rate-dots"
  ],
  "files": [
    {
      "path": "registry/chartory/components/rate-dot-plot.tsx",
      "type": "registry:component",
      "target": "components/chartory/rate-dot-plot.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Rate dot plot (Chartory chart 062): 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/rate-dot-plot\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/062-rate-dot-plot/data\"\nimport { def } from \"@/lib/chartory/charts/types/062-rate-dot-plot/layout\"\n\nregisterChart(def, sample)\n\nexport type RateDotPlotData = typeof sample\nexport type RateDotPlotProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: RateDotPlotData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: RateDotPlotData[]\n}\n\nexport function RateDotPlot(props: RateDotPlotProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/062-rate-dot-plot/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/062-rate-dot-plot/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 062 Rate dot plot · sample data (Figma chart/062, policy rate projections per member, September round).\nimport type { RateDotsData } from \"../../plots/rate-dots\";\n\nexport const data: RateDotsData = {\n  min: 2.0, max: 4.5,\n  ticks: [\"4.5%\", \"3.67%\", \"2.83%\", \"2.0%\"],\n  cols: [\n    { label: \"2026\", dots: [3.875, 3.875, 3.875, 3.625, 3.625, 3.625, 3.625, 3.625, 3.375, 3.375, 3.375, 3.125, 3.875, 4.125, 3.625] },\n    { label: \"2027\", dots: [3.375, 3.375, 3.125, 3.125, 3.375, 3.625, 3.375, 2.875, 3.125, 3.375, 3.625, 3.875, 3.375, 2.875, 3.125] },\n    { label: \"2028\", dots: [3.125, 2.875, 2.875, 3.125, 3.375, 2.625, 3.125, 2.875, 3.125, 3.375, 2.875, 3.625, 3.125, 2.625, 2.875] },\n    { label: \"LONGER RUN\", dots: [2.875, 3.0, 3.0, 2.875, 3.125, 2.75, 3.0, 2.875, 3.0, 3.25, 2.75, 3.0, 3.0, 2.875, 3.125] },\n  ],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/062-rate-dot-plot/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/062-rate-dot-plot/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 062 Rate dot plot (Figma chart/062, \"Rate projections\"): C.rateDots, each member's year-end policy rate.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { rateDots } from \"../../plots/rate-dots\";\nimport { data } from \"./data\";\n\nconst median = (d: number[]) => [...d].sort((a, b) => a - b)[Math.floor(d.length / 2)];\nconst pct = (v: number) => v.toFixed(3) + \"%\";\nconst name = (l: string) => (l === \"LONGER RUN\" ? \"Longer run\" : l);\n\n// tooltip: one period column (group = column): the members' highest, median (the plot's bar) and lowest projection\nconst tip = (o: typeof data, g: number): TooltipSpec | null => {\n  const c = o.cols[g];\n  if (!c || !c.dots.length) return null;\n  return {\n    kind: \"range\",\n    caps: c.label + \" · \" + c.dots.length + \" MEMBERS\",\n    rows: [\n      { label: \"Highest\", value: pct(Math.max(...c.dots)), swatch: \"data/primary\" },\n      { label: \"Median\", value: pct(median(c.dots)), swatch: \"text/strong\" },\n      { label: \"Lowest\", value: pct(Math.min(...c.dots)), swatch: \"data/primary\" },\n    ],\n  };\n};\n\nexport const def: ChartDef = {\n  no: 62,\n  slug: \"rate-dot-plot\",\n  legend: [[\"data/primary\", \"Member view\"], [\"text/strong\", \"Median\"]],\n  plot: (K, p, w, d) => rateDots(K, p, w, (d as typeof data | undefined) ?? data),\n  tip: (d, g) => tip(d as typeof data, g),\n  // the next round: some members move their projection by 25 bp (kept on the axis)\n  update: (d, step) => {\n    const o = d as typeof data;\n    return { ...o, cols: o.cols.map((c, k) => ({ ...c, dots: c.dots.map((v, i) => Math.min(o.max - 0.25, Math.max(o.min + 0.25, v + 0.25 * Math.round(1.2 * Math.sin(i * 2.3 + k * 1.1 + step * 1.7))))) })) };\n  },\n  describe: {\n    title: \"Policy rate path\",\n    summary: `Year-end policy rate projections of ${data.cols[0].dots.length} members; the median falls from ${pct(median(data.cols[0].dots))} in 2026 to ${pct(median(data.cols[2].dots))} in 2028 and ${pct(median(data.cols[3].dots))} in the longer run.`,\n    table: { head: [\"Period\", \"Median\", \"Lowest\", \"Highest\", \"Members\"], rows: data.cols.map((c) => [name(c.label), pct(median(c.dots)), pct(Math.min(...c.dots)), pct(Math.max(...c.dots)), c.dots.length]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "distribution"
  ],
  "meta": {
    "access": "free",
    "no": 62,
    "family": "Distribution"
  }
}
