{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "renko",
  "type": "registry:component",
  "title": "Renko",
  "description": "Price, counted in fixed bricks. Sample data: spot price in $50 bricks, Sep 10 to Oct 9.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-renko"
  ],
  "files": [
    {
      "path": "registry/chartory/components/renko.tsx",
      "type": "registry:component",
      "target": "components/chartory/renko.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Renko (Chartory chart 056): 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/renko\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/056-renko/data\"\nimport { def } from \"@/lib/chartory/charts/types/056-renko/layout\"\n\nregisterChart(def, sample)\n\nexport type RenkoData = typeof sample\nexport type RenkoProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: RenkoData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: RenkoData[]\n}\n\nexport function Renko(props: RenkoProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/056-renko/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/056-renko/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 056 ETH price bricks · sample data (Figma chart/056, from the Figma definition, seeded values expanded).\nimport type { RenkoData } from \"../../plots/renko\";\n\nexport const data: RenkoData = {\n  start: 2400,\n  size: 50,\n  moves: \"UUUDUUUUDDUUUUUDDDUUUUDUUUUDDUUU\",\n  min: 2350,\n  max: 3150,\n  ticks: [\"3,150\", \"2,883\", \"2,617\", \"2,350\"],\n  xl: { 0: \"SEP 10\", 16: \"SEP 25\", 31: \"OCT 9\" }\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/056-renko/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/056-renko/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 056 Renko (Figma chart/056, \"ETH price bricks\"): C.renko, $50 bricks from $2,400, Sep 10 to Oct 9.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { renko } from \"../../plots/renko\";\nimport { data } from \"./data\";\n\nconst bricks = (() => {\n  let pr = data.start;\n  return [...data.moves].map((m, i) => { const up = m === \"U\"; const from = pr; pr += up ? data.size : -data.size; return [i + 1, up ? \"Up\" : \"Down\", from, pr] as [number, string, number, number]; });\n})();\nconst ups = [...data.moves].filter((m) => m === \"U\").length;\nconst usd = (v: number) => \"$\" + v.toLocaleString(\"en-US\");\n\n// tooltip: one brick (group = brick index): its close against the brick before\nconst tip = (o: typeof data, g: number): TooltipSpec | null => {\n  if (g < 0 || g >= o.moves.length) return null;\n  let pr = o.start;\n  for (let i = 0; i < g; i++) pr += o.moves[i] === \"U\" ? o.size : -o.size;\n  const up = o.moves[g] === \"U\";\n  return { kind: \"compare\", caps: \"BRICK \" + (g + 1) + \" · ETH\", value: usd(pr + (up ? o.size : -o.size)), delta: { text: (up ? \"+\" : \"−\") + usd(o.size), tone: up ? \"success\" : \"danger\" }, comparison: \"VS \" + usd(pr) };\n};\n\nexport const def: ChartDef = {\n  no: 56,\n  slug: \"renko\",\n  legend: [[\"status/success\", \"Up $50\"], [\"status/danger\", \"Down $50\"]],\n  plot: (K, p, w, d) => renko(K, p, w, (d as typeof data | undefined) ?? data),\n  tip: (d, g) => tip(d as typeof data, g),\n  // the same brick pattern one brick higher or lower (bricks stay inside the axis)\n  update: (d, step) => {\n    const o = d as typeof data;\n    return { ...o, start: o.start + (step % 2 ? o.size : -o.size) };\n  },\n  describe: {\n    title: \"ETH price bricks\",\n    summary: `ETH price in $${data.size} bricks from Sep 10 to Oct 9: ${ups} up and ${data.moves.length - ups} down bricks, from ${usd(data.start)} to ${usd(bricks[bricks.length - 1][3])}.`,\n    table: { head: [\"Brick\", \"Direction\", \"From\", \"To\"], rows: bricks.map(([i, d, a, b]) => [i, d, usd(a), usd(b)]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "change-over-time"
  ],
  "meta": {
    "access": "free",
    "no": 56,
    "family": "Change over time"
  }
}
