{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "allocation-echarts-sankey-chart",
  "description": "Fund allocation flow with labelled nodes and a stat row",
  "dependencies": [
    "echarts",
    "motion"
  ],
  "registryDependencies": [
    "@evilcharts/echarts-sankey-chart"
  ],
  "files": [
    {
      "path": "src/registry/blocks/echarts/b-allocation-echarts-sankey-chart.tsx",
      "content": "\"use client\";\n\nimport { EChartsSankeyChart, type ChartConfig } from \"@/registry/charts/echarts-sankey-chart\";\nimport { cn } from \"@/lib/utils\";\n\nconst chartData = {\n  nodes: [\n    { name: \"Inflow\" },\n    { name: \"Equities\" },\n    { name: \"Bonds\" },\n    { name: \"Cash\" },\n    { name: \"Growth\" },\n    { name: \"Income\" },\n    { name: \"Reserve\" },\n  ],\n  links: [\n    { source: 0, target: 1, value: 78 },\n    { source: 0, target: 2, value: 46 },\n    { source: 0, target: 3, value: 24 },\n    { source: 1, target: 4, value: 52 },\n    { source: 1, target: 5, value: 26 },\n    { source: 2, target: 5, value: 19 },\n    { source: 2, target: 6, value: 27 },\n    { source: 3, target: 4, value: 9 },\n    { source: 3, target: 6, value: 15 },\n  ],\n};\n\nconst chartConfig = {\n  Inflow: { label: \"Inflow\", colors: { light: [\"#0d9488\"], dark: [\"#2dd4bf\"] } },\n  Equities: { label: \"Equities\", colors: { light: [\"#d97706\"], dark: [\"#fbbf24\"] } },\n  Bonds: { label: \"Bonds\", colors: { light: [\"#ea580c\"], dark: [\"#fb923c\"] } },\n  Cash: { label: \"Cash\", colors: { light: [\"#b45309\"], dark: [\"#f59e0b\"] } },\n  Growth: { label: \"Growth\", colors: { light: [\"#7c3aed\"], dark: [\"#a78bfa\"] } },\n  Income: { label: \"Income\", colors: { light: [\"#6d28d9\"], dark: [\"#8b5cf6\"] } },\n  Reserve: { label: \"Reserve\", colors: { light: [\"#4f46e5\"], dark: [\"#818cf8\"] } },\n} satisfies ChartConfig;\n\nconst STATS = [\n  { key: \"positions\", label: \"Open positions\", value: \"204\" },\n  { key: \"aum\", label: \"Assets under management\", value: \"$65,430\" },\n  { key: \"hedged\", label: \"Hedged\", value: \"87%\" },\n];\n\nexport function EChartsAllocationSankeyChart() {\n  return (\n    <div className=\"flex h-full w-full flex-col p-4\">\n      <div className=\"flex items-baseline justify-between gap-4\">\n        <span className=\"text-primary text-base font-medium tracking-tight sm:text-lg\">\n          Where the fund flows\n        </span>\n        <span className=\"text-muted-foreground text-xs\">Quarter to date</span>\n      </div>\n\n      <div className=\"mt-2 min-h-0 w-full flex-1\">\n        <EChartsSankeyChart\n          data={chartData}\n          config={chartConfig}\n          className=\"h-full w-full\"\n          nodeWidth={92}\n          nodePadding={12}\n          linkCurvature={0.55}\n        >\n          <EChartsSankeyChart.Tooltip variant=\"frosted-glass\" />\n          <EChartsSankeyChart.Link variant=\"gradient\" />\n          <EChartsSankeyChart.Node radius={6}>\n            <EChartsSankeyChart.NodeLabel\n              position=\"inside\"\n              showValues\n              valueFormatter={(value) => `$${(value * 1000).toLocaleString(\"en-US\")}`}\n            />\n          </EChartsSankeyChart.Node>\n        </EChartsSankeyChart>\n      </div>\n\n      <div className=\"mt-3 grid shrink-0 grid-cols-3 gap-4\">\n        {STATS.map(({ key, label, value }, i) => (\n          <div\n            key={key}\n            className={cn(\n              \"flex flex-col gap-0.5\",\n              i === 1 && \"items-center text-center\",\n              i === STATS.length - 1 && \"items-end text-right\",\n            )}\n          >\n            <span className=\"text-muted-foreground truncate text-[10px] tracking-wide uppercase sm:text-[11px]\">\n              {label}\n            </span>\n            <span className=\"text-primary text-lg font-semibold tracking-tight sm:text-2xl\">\n              {value}\n            </span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:block",
      "target": "components/evilcharts/blocks/allocation-echarts-sankey-chart.tsx"
    }
  ],
  "type": "registry:block"
}