{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "funding-stripes",
  "type": "registry:component",
  "title": "Funding stripes",
  "description": "Who pays whom, one stripe per period. Sample data: funding rate per 8 hours with the BTC price, Jul 12 to Oct 9.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-stripes"
  ],
  "files": [
    {
      "path": "registry/chartory/components/funding-stripes.tsx",
      "type": "registry:component",
      "target": "components/chartory/funding-stripes.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Funding stripes (Chartory chart 090): 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/funding-stripes\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/090-funding-stripes/data\"\nimport { def } from \"@/lib/chartory/charts/types/090-funding-stripes/layout\"\n\nregisterChart(def, sample)\n\nexport type FundingStripesData = typeof sample\nexport type FundingStripesProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: FundingStripesData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: FundingStripesData[]\n}\n\nexport function FundingStripes(props: FundingStripesProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/090-funding-stripes/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/090-funding-stripes/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 090 Funding rate · sample data (Figma chart/090-stripes-funding).\nimport type { StripesData } from \"../../plots/stripes\";\n\nexport const data: StripesData = {\n  vals: [0.0031, 0.0048, 0.0115, 0.0074, 0.0162, 0.0132, 0.0118, 0.0206, 0.0218, 0.0178, 0.0214, 0.0251, 0.0212, 0.0146, 0.0152, 0.0224, 0.0141, 0.0148, 0.0149, 0.0144, 0.0135, 0.017, 0.0139, 0.0182, 0.0096, 0.0162, 0.0129, 0.0149, 0.0136, 0.0026, 0.0039, 0.003, 0.0042, 0.0039, 0.0029, 0.0041, -0.0068, -0.0026, 0.002, 0.0019, 0.0005, -0.0068, -0.0045, -0.001, -0.0072, -0.0071, 0.0003, -0.0052, 0.0032, 0.0037, 0.005, 0.0068, 0.0007, 0.0018, 0.0089, 0.0087, 0.011, 0.0099, 0.0073, 0.0124, 0.0107, -0.026, -0.0198, -0.0302, -0.0187, -0.0215, -0.0256, -0.0225, -0.0281, -0.0358, 0.0222, 0.0222, 0.0187, 0.0224, 0.0134, 0.0227, 0.0168, 0.0173, 0.0107, 0.0131, 0.016, 0.0101, 0.0073, 0.008, 0.0091, 0.01, 0.0055, 0.0017, 0.0014, 0.008],\n  price: [58.3, 59, 59.15, 59.71, 60.39, 59.87, 59.52, 60.18, 60.79, 60.76, 60.5, 61.17, 61.73, 61.95, 61.48, 62.07, 61.73, 61.51, 60.92, 60.91, 60.37, 60.39, 60.06, 59.9, 60.34, 59.77, 59.87, 59.63, 60.2, 59.77, 60.37, 60.64, 60.16, 59.81, 60.05, 60.64, 60.24, 59.76, 59.33, 59.6, 59.93, 59.33, 59.57, 60.28, 60.95, 61.03, 60.62, 61.17, 61, 61.06, 61.53, 61.9, 62.12, 62.06, 62.49, 62.8, 62.88, 63.29, 62.72, 62.54, 62.87, 62.83, 62.34, 61.76, 61.54, 60.51, 59.63, 59.05, 58.5, 58, 58.7, 59.07, 58.67, 59.36, 59.76, 60.01, 59.86, 59.23, 59.37, 59.07, 59.63, 59.58, 60.05, 59.78, 59.91, 60.44, 60.41, 59.96, 59.37, 59.93],\n  max: 0.022,\n  xl: { 0: \"JUL 12\", 45: \"AUG 26\", 89: \"OCT 9\" },\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/090-funding-stripes/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/090-funding-stripes/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 090 Funding stripes (Figma chart/090-stripes-funding): C.stripes, 90 days of BTC perp funding with the price.\nimport type { ChartDef } from \"../../core/shell\";\nimport { stripes } from \"../../plots/stripes\";\nimport { data } from \"./data\";\n\nconst start = Date.UTC(2026, 6, 12);\nconst day = (i: number) => new Date(start + i * 864e5).toLocaleDateString(\"en-GB\", { day: \"numeric\", month: \"short\", timeZone: \"UTC\" });\nconst neg = data.vals.filter((v) => v < 0).length;\n\n/** A later look: funding prints move (sign kept), the price path shifts smoothly. */\nfunction update(d0: unknown, step: number): typeof data {\n  const d = d0 as typeof data;\n  return {\n    ...d,\n    vals: d.vals.map((v, i) => +(v * (1 + 0.18 * Math.sin(i * 0.9 + step * 1.7))).toFixed(4) || v),\n    price: d.price.map((v, i) => +(v * (1 + 0.025 * Math.sin(i / 11 + step * 1.3))).toFixed(2)),\n  };\n}\n\nexport const def: ChartDef = {\n  no: 90,\n  slug: \"funding-stripes\",\n  legend: [[\"data/primary\", \"Longs pay\"], [\"data/cat-2\", \"Shorts pay\"], [\"text/strong\", \"BTC price\"]],\n  plot: (K, p, w, d) => stripes(K, p, w, (d as typeof data | undefined) ?? data),\n  update,\n  describe: {\n    title: \"BTC perp funding\",\n    summary: `Daily funding rate (% per 8 h) over ${data.vals.length} days from ${day(0)} to ${day(data.vals.length - 1)}: longs paid on ${data.vals.length - neg} days, shorts on ${neg}; BTC price from ${data.price[0]}K to ${data.price[data.price.length - 1]}K.`,\n    table: { head: [\"Day\", \"Funding (%)\", \"BTC ($K)\"], rows: data.vals.map((v, i) => [day(i), v, data.price[i]]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "change-over-time"
  ],
  "meta": {
    "access": "free",
    "no": 90,
    "family": "Change over time"
  }
}
