{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "network",
  "type": "registry:component",
  "title": "Network",
  "description": "One hub and what it connects to. Sample data: one agent on Atlas 3 and its six tools, search 12.4K calls (32%), files 2.7K (7%).",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-network2"
  ],
  "files": [
    {
      "path": "registry/chartory/components/network.tsx",
      "type": "registry:component",
      "target": "components/chartory/network.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Network (Chartory chart 039): 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/network\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/039-network/data\"\nimport { def } from \"@/lib/chartory/charts/types/039-network/layout\"\n\nregisterChart(def, sample)\n\nexport type NetworkData = typeof sample\nexport type NetworkProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: NetworkData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: NetworkData[]\n}\n\nexport function Network(props: NetworkProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/039-network/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/039-network/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 039 Network · sample data (Figma chart/039, AI: tool calls by an agent this week, in thousands).\nimport type { Network2Data } from \"../../plots/network2\";\n\nexport const data: Network2Data = {\n  hub: \"Atlas 3\",\n  hubSub: \"AGENT\",\n  nodes: [\n    { label: \"Search\", v: 12.4, tok: \"data/cat-2\", text: \"12.4K\", subs: [1, 1] },\n    { label: \"Code run\", v: 8.1, tok: \"data/cat-3\", text: \"8.1K\", subs: [1, 1, 1] },\n    { label: \"Browser\", v: 6.2, tok: \"data/cat-4\", text: \"6.2K\", subs: [1] },\n    { label: \"SQL\", v: 5.6, tok: \"data/cat-5\", text: \"5.6K\", subs: [1, 1] },\n    { label: \"Email\", v: 3.4, tok: \"data/cat-6\", text: \"3.4K\", subs: [1] },\n    { label: \"Files\", v: 2.7, tok: \"data/cat-8\", text: \"2.7K\", subs: [1, 1] },\n  ],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/039-network/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/039-network/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 039 Network (Figma chart/039): C.network2; no legend (every node is named beside it).\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { network2 } from \"../../plots/network2\";\nimport { data } from \"./data\";\n\nconst tot = data.nodes.reduce((a, x) => a + x.v, 0);\nconst pct = (v: number) => Math.round((v / tot) * 100) + \"%\";\n\n/** Tooltip for one tool (group = the tool's node and edge): its calls and their share of all calls. */\nfunction tipOf(o: typeof data, g: number): TooltipSpec | null {\n  const n = o.nodes[g];\n  if (!n) return null;\n  const all = o.nodes.reduce((a, x) => a + x.v, 0);\n  return { kind: \"cell\", caps: `${o.hub} · ${n.label}`.toUpperCase(), value: n.text, unit: \"calls\", swatch: n.tok, share: Math.round((n.v / all) * 100) + \"% OF ALL CALLS\" };\n}\n\nexport const def: ChartDef = {\n  no: 39,\n  slug: \"network\",\n  legend: null,\n  // update: next week's calls; each tool moves ±5 % around a shared ±8 % swing (order kept, so every tool keeps its\n  // place), the shown count is one decimal in K and the share is recomputed in the plot\n  update: (d, step) => {\n    const o = d as typeof data;\n    const k = 1 + 0.08 * Math.sin(step * 2.3 + 0.5);\n    return {\n      ...o,\n      nodes: o.nodes.map((n, i) => {\n        const v = +(n.v * k * (1 + 0.05 * Math.sin(step * 1.7 + i * 1.9))).toFixed(1);\n        return { ...n, v, text: v.toFixed(1) + \"K\" };\n      }),\n    };\n  },\n  plot: (K, p, w, d) => network2(K, p, w, (d as typeof data | undefined) ?? data),\n  tip: (d, g) => tipOf(d as typeof data, g),\n  describe: {\n    title: \"Agent tool calls\",\n    summary: `Tool calls by the ${data.hub} agent this week across ${data.nodes.length} tools: ${data.nodes[0].label} leads with ${data.nodes[0].text} (${pct(data.nodes[0].v)}), ${data.nodes[data.nodes.length - 1].label} is lowest with ${data.nodes[data.nodes.length - 1].text}.`,\n    table: { head: [\"Tool\", \"Calls\", \"Share\"], rows: data.nodes.map((n) => [n.label, n.text, pct(n.v)]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "relationship"
  ],
  "meta": {
    "access": "free",
    "no": 39,
    "family": "Relationship"
  }
}
