{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "volume-profile",
  "type": "registry:component",
  "title": "Volume profile",
  "description": "Where the trading happened, by price. Sample data: spot price, Oct 8 to now, point of control at 150.5.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-volume-profile"
  ],
  "files": [
    {
      "path": "registry/chartory/components/volume-profile.tsx",
      "type": "registry:component",
      "target": "components/chartory/volume-profile.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Volume profile (Chartory chart 071): 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/volume-profile\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/071-volume-profile/data\"\nimport { def } from \"@/lib/chartory/charts/types/071-volume-profile/layout\"\n\nregisterChart(def, sample)\n\nexport type VolumeProfileData = typeof sample\nexport type VolumeProfileProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: VolumeProfileData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: VolumeProfileData[]\n}\n\nexport function VolumeProfile(props: VolumeProfileProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/071-volume-profile/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/071-volume-profile/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 071 Volume profile · sample data (Figma chart/071, SOL / USD over 48 hours: hourly price and traded volume per price level, 14 levels from 144 to 158).\nimport type { VolumeProfileData } from \"../../plots/volume-profile\";\n\nexport const data: VolumeProfileData = {\n  price: [148.172, 149.22, 149.855, 150.009, 150.18, 151.161, 151.122, 151.715, 150.713, 150.154, 149.858, 150.416, 151.561, 152.071, 151.581, 151.164, 151.306, 152.003, 152.768, 153.859, 155.029, 156, 156, 156, 155.248, 155.187, 155.231, 155.86, 156, 155.63, 155.338, 155.492, 156, 155.483, 155.394, 154.758, 154.66, 154.354, 154.818, 154.814, 154.734, 155.277, 156, 155.372, 154.765, 154.618, 154.977, 155.954],\n  min: 144, max: 158,\n  ticks: [\"158\", \"153.3\", \"148.7\", \"144\"],\n  vol: [3, 5, 8, 12, 17, 23, 30, 26, 19, 15, 11, 9, 6, 4],\n  poc: 6, va: [4, 9],\n  xl: { 0: \"OCT 8\", 24: \"OCT 9\", 47: \"NOW\" },\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/071-volume-profile/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/071-volume-profile/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 071 Volume profile (Figma chart/071, \"Volume at price\"): C.volumeProfile, SOL / USD over two days.\nimport type { ChartDef } from \"../../core/shell\";\nimport { volumeProfile } from \"../../plots/volume-profile\";\nimport { data } from \"./data\";\n\nconst step = (data.max - data.min) / data.vol.length;\nconst level = (b: number) => (data.min + b * step).toFixed(1) + \"–\" + (data.min + (b + 1) * step).toFixed(1);\nconst last = data.price[data.price.length - 1];\n\nconst r3 = (v: number) => Math.round(v * 1000) / 1000;\n\nexport const def: ChartDef = {\n  no: 71,\n  slug: \"volume-profile\",\n  legend: [[\"data/cat-2\", \"Price\"], [\"data/primary-soft\", \"Value area\"], [\"data/primary\", \"Point of control · 150.5\"]],\n  plot: (K, p, w, d) => volumeProfile(K, p, w, (d as typeof data | undefined) ?? data),\n  // two days later: the price path moves up to ±0.9 (inside the axis), volume per level up to ±15 %; the point of\n  // control keeps the most volume (the legend names its level)\n  update: (d, step) => {\n    const o = d as typeof data;\n    const vol = o.vol.map((v, b) => Math.max(1, Math.round(v * (1 + 0.15 * Math.sin(b * 1.2 + step * 2)))));\n    vol[o.poc] = Math.max(vol[o.poc], ...vol.filter((_, b) => b !== o.poc).map((v) => v + 2));\n    const hi = Math.max(...o.price);\n    return { ...o, vol, price: o.price.map((v, i) => Math.min(hi, Math.max(o.min + 1, r3(v + 0.9 * Math.sin(i * 0.35 + step * 1.9))))) };\n  },\n  describe: {\n    title: \"SOL / USD profile\",\n    summary: `SOL / USD hourly price from Oct 8 to now, ${data.price[0].toFixed(2)} to ${last.toFixed(2)}; the most volume traded at ${level(data.poc)} (point of control), the value area spans ${(data.min + data.va[0] * step).toFixed(1)} to ${(data.min + (data.va[1] + 1) * step).toFixed(1)}.`,\n    table: {\n      head: [\"Price level\", \"Volume\", \"Zone\"],\n      rows: data.vol.map((v, b) => [level(b), v, b === data.poc ? \"Point of control\" : b >= data.va[0] && b <= data.va[1] ? \"Value area\" : \"\"]).reverse(),\n    },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "distribution"
  ],
  "meta": {
    "access": "free",
    "no": 71,
    "family": "Distribution"
  }
}
