{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "arc-diagram",
  "type": "registry:component",
  "title": "Arc diagram",
  "description": "Flows between groups, as arcs on one line. Sample data: on-chain transfers between seven wallet types, from exchanges to miners.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-arc-diagram"
  ],
  "files": [
    {
      "path": "registry/chartory/components/arc-diagram.tsx",
      "type": "registry:component",
      "target": "components/chartory/arc-diagram.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Arc diagram (Chartory chart 064): 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/arc-diagram\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/064-arc-diagram/data\"\nimport { def } from \"@/lib/chartory/charts/types/064-arc-diagram/layout\"\n\nregisterChart(def, sample)\n\nexport type ArcDiagramData = typeof sample\nexport type ArcDiagramProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: ArcDiagramData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: ArcDiagramData[]\n}\n\nexport function ArcDiagram(props: ArcDiagramProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/064-arc-diagram/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/064-arc-diagram/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 064 Arc diagram · sample data (Figma chart/064, transfers between wallet clusters; link value = transfer weight).\nimport type { ArcDiagramData } from \"../../plots/arc-diagram\";\n\nexport const data: ArcDiagramData = {\n  nodes: [\n    { label: \"CEX\", v: 9, tok: \"data/cat-2\" }, { label: \"MM\", v: 6, tok: \"data/cat-3\" }, { label: \"DEFI\", v: 7, tok: \"data/primary\" },\n    { label: \"BRIDGE\", v: 4, tok: \"data/cat-4\" }, { label: \"WHALE\", v: 5, tok: \"data/cat-5\" }, { label: \"RETAIL\", v: 8, tok: \"data/cat-8\" },\n    { label: \"MINER\", v: 3, tok: \"data/cat-6\" },\n  ],\n  links: [[0, 5, 9], [0, 1, 7], [1, 2, 6], [2, 3, 4], [4, 0, 8], [5, 2, 3], [6, 0, 5], [3, 5, 2], [1, 4, 3], [2, 6, 1]],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/064-arc-diagram/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/064-arc-diagram/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 064 Arc diagram (Figma chart/064, \"Wallet cluster transfers\"): C.arcDiagram, 7 clusters and 10 transfer links.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { arcDiagram } from \"../../plots/arc-diagram\";\nimport { data } from \"./data\";\n\nconst nm = (i: number) => data.nodes[i].label;\nconst top = [...data.links].sort((a, b) => b[2] - a[2])[0];\n\n// tooltip: one cluster with the arcs it sends (group = source node): one row per outgoing link (swatch = the\n// receiving cluster's colour), the total sent weight\nconst tip = (o: typeof data, g: number): TooltipSpec | null => {\n  const q = o.nodes[g];\n  if (!q) return null;\n  const out = o.links.filter(([a]) => a === g);\n  if (!out.length) return { kind: \"value\", text: q.label + \" · volume \" + q.v };\n  return {\n    kind: \"series\",\n    caps: q.label + \" · SENT\",\n    rows: out.map(([, b, v]) => ({ label: \"To \" + o.nodes[b].label, value: String(v), swatch: o.nodes[b].tok })),\n    total: { label: \"Total weight\", value: String(out.reduce((s, l) => s + l[2], 0)) },\n  };\n};\n\nexport const def: ChartDef = {\n  no: 64,\n  slug: \"arc-diagram\",\n  legend: null,\n  plot: (K, p, w, d) => arcDiagram(K, p, w, (d as typeof data | undefined) ?? data),\n  tip: (d, g) => tip(d as typeof data, g),\n  // the next week: cluster volumes and transfer weights move up to ±20 % (whole weights, at least 1)\n  update: (d, step) => {\n    const o = d as typeof data;\n    const mv = (v: number, a: number) => Math.max(1, Math.round(v * (1 + 0.2 * Math.sin(a + step * 2))));\n    return { ...o, nodes: o.nodes.map((q, i) => ({ ...q, v: mv(q.v, i * 1.5) })), links: o.links.map(([a, b, v], i) => [a, b, mv(v, i * 1.9 + 0.7)] as [number, number, number]) };\n  },\n  describe: {\n    title: \"Transfer arcs\",\n    summary: `${data.links.length} transfer links between ${data.nodes.length} wallet clusters; the heaviest is ${nm(top[0])} to ${nm(top[1])} with weight ${top[2]}.`,\n    table: { head: [\"From\", \"To\", \"Weight\"], rows: data.links.map(([a, b, v]) => [nm(a), nm(b), v]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "relationship"
  ],
  "meta": {
    "access": "free",
    "no": 64,
    "family": "Relationship"
  }
}
