{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radial-lollipop",
  "type": "registry:component",
  "title": "Radial lollipop",
  "description": "A year of values around one ring. Sample data: network hashrate in EH/s, 12 months, November to October.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-radial-lollipop"
  ],
  "files": [
    {
      "path": "registry/chartory/components/radial-lollipop.tsx",
      "type": "registry:component",
      "target": "components/chartory/radial-lollipop.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Radial lollipop (Chartory chart 094): 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/radial-lollipop\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/094-radial-lollipop/data\"\nimport { def } from \"@/lib/chartory/charts/types/094-radial-lollipop/layout\"\n\nregisterChart(def, sample)\n\nexport type RadialLollipopData = typeof sample\nexport type RadialLollipopProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: RadialLollipopData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: RadialLollipopData[]\n}\n\nexport function RadialLollipop(props: RadialLollipopProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/094-radial-lollipop/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/094-radial-lollipop/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 094 Radial lollipop · sample data (Figma chart/094-radial-hashrate, crypto: network hashrate in EH/s, Nov → Oct).\nimport type { RadialLollipopData } from \"../../plots/radial-lollipop\";\n\nexport const data: RadialLollipopData = {\n  min: 560,\n  max: 820,\n  rings: [600, 700, 800],\n  labels: [\"N\", \"D\", \"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\"],\n  vals: [610, 628, 655, 640, 690, 720, 705, 748, 770, 762, 795, 812],\n  center: [[\"Label/Caps\", \"EH/S\", \"label\"], [\"Label/Caps\", \"12 MO\", \"label\"]],\n  rows: [\n    {  label: \"Miner revenue\", text: \"$1.9M\", pct: \"24 H\"  },\n    {  label: \"Hashprice\", text: \"$48\", pct: \"PH / DAY\"  },\n    {  label: \"Difficulty\", text: \"+4.1%\", pct: \"IN 3 D\", tone: \"status/warning\"  },\n  ],\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/094-radial-lollipop/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/094-radial-lollipop/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 094 Radial lollipop (Figma chart/094-radial-hashrate): C.radialLolli2 on the hashrate sample.\nimport type { ChartDef, TooltipSpec } from \"../../core/shell\";\nimport { radialLollipop } from \"../../plots/radial-lollipop\";\nimport { data } from \"./data\";\n\n/** A later look at the year: monthly hashrate moves (latest still the high), and the side list follows it. */\nfunction update(d0: unknown, step: number): typeof data {\n  const d = d0 as typeof data;\n  const vals = d.vals.map((v, i) => Math.min(d.max - 12, Math.max(d.min + 5, Math.round(v * (1 + 0.035 * Math.sin(i * 2.1 + step * 1.7 + 0.4))))));\n  const n = vals.length;\n  vals[n - 1] = Math.min(d.max - 2, Math.max(vals[n - 1], Math.max(...vals.slice(0, -1)) + 4));\n  const rev = +(1.9 * (1 + 0.06 * Math.sin(step * 2.3))).toFixed(1);\n  const diff = (vals[n - 1] / 780 - 1) * 100;\n  return {\n    ...d,\n    vals,\n    rows: [\n      { ...d.rows[0], text: \"$\" + rev.toFixed(1) + \"M\" },\n      { ...d.rows[1], text: \"$\" + Math.round(48 * (rev / 1.9) / (vals[n - 1] / 812)) },\n      { ...d.rows[2], text: (diff >= 0 ? \"+\" : \"−\") + Math.abs(diff).toFixed(1) + \"%\" },\n    ],\n  };\n}\n\nconst MONTHS = [\"Nov\", \"Dec\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\"];\n/** Hover: one month (stem and head): its hashrate against the month before. */\nfunction tip(d0: unknown, g: number): TooltipSpec | null {\n  const v = (d0 as typeof data).vals;\n  if (v[g] == null) return null;\n  if (g === 0) return { kind: \"value\", text: `${MONTHS[g]} · ${v[g]} EH/s` };\n  const dv = v[g] - v[g - 1];\n  return { kind: \"compare\", caps: MONTHS[g].toUpperCase() + \" · MONTHLY AVERAGE\", value: v[g] + \" EH/s\", delta: { text: (dv < 0 ? \"−\" : \"+\") + Math.abs(dv) + \" EH/s\", tone: \"neutral\" }, comparison: \"VS \" + MONTHS[g - 1].toUpperCase() };\n}\n\nexport const def: ChartDef = {\n  no: 94,\n  slug: \"radial-lollipop\",\n  legend: [[\"data/primary-soft\", \"Monthly average\"], [\"data/primary\", \"This month\"], [\"text/unselected\", \"Rings 600 · 700 · 800\"]],\n  plot: (K, p, w, d) => radialLollipop(K, p, w, (d as typeof data | undefined) ?? data),\n  tip,\n  update,\n  describe: {\n    title: \"Network hashrate, 12 months\",\n    summary: `Monthly average hashrate in EH/s from November to October: from ${data.vals[0]} to ${data.vals[data.vals.length - 1]}, the highest month last.`,\n    table: {\n      head: [\"Month\", \"EH/s\"],\n      rows: [\"Nov\", \"Dec\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\"].map((m, i) => [m, data.vals[i]]),\n    },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "change-over-time"
  ],
  "meta": {
    "access": "free",
    "no": 94,
    "family": "Change over time"
  }
}
