{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ex-clickable-echarts-heatmap-chart",
  "registryDependencies": [
    "@evilcharts/echarts-heatmap-chart"
  ],
  "files": [
    {
      "path": "src/registry/examples/echarts/ex-clickable-echarts-heatmap-chart.tsx",
      "content": "\"use client\";\n\nimport {\n  EChartsHeatmapChart,\n  type ChartConfig,\n  type HeatmapDatum,\n  type HeatmapSelection,\n} from \"@/registry/charts/echarts-heatmap-chart\";\nimport { useState } from \"react\";\n\nfunction buildContributions(seed: number): HeatmapDatum[] {\n  let state = seed;\n  const random = () => {\n    state = (state * 1664525 + 1013904223) % 4294967296;\n    return state / 4294967296;\n  };\n  const end = Date.UTC(2025, 11, 31);\n  const data: HeatmapDatum[] = [];\n  for (let i = 364; i >= 0; i--) {\n    const day = new Date(end - i * 86_400_000);\n    const weekend = day.getUTCDay() === 0 || day.getUTCDay() === 6;\n    if (random() >= (weekend ? 0.3 : 0.8)) continue;\n    data.push({\n      date: day.toISOString().slice(0, 10),\n      value: Math.round(random() * (weekend ? 6 : 14)) + 1,\n    });\n  }\n  return data;\n}\n\nconst data = buildContributions(3);\n\nconst chartConfig = {\n  contributions: {\n    label: \"Contributions\",\n    colors: {\n      light: [\"#9be9a8\", \"#40c463\", \"#30a14e\", \"#216e39\"],\n      dark: [\"#0e4429\", \"#006d32\", \"#26a641\", \"#39d353\"],\n    },\n  },\n} satisfies ChartConfig;\n\nexport function EChartsExampleHeatmapChart() {\n  const [selection, setSelection] = useState<HeatmapSelection | null>(null);\n\n  return (\n    <div className=\"flex h-full w-full flex-col p-4\">\n      <EChartsHeatmapChart\n        className=\"min-h-0 w-full flex-1\"\n        data={data}\n        config={chartConfig}\n        onSelectionChange={setSelection} // [!code highlight]\n      >\n        <EChartsHeatmapChart.Cell dataKey=\"contributions\" isClickable /> {/* [!code highlight] */}\n        <EChartsHeatmapChart.MonthLabel />\n        <EChartsHeatmapChart.DayLabel />\n        <EChartsHeatmapChart.Tooltip />\n      </EChartsHeatmapChart>\n      <p className=\"text-muted-foreground mt-3 text-xs\">\n        {selection\n          ? `${selection.value} contributions on ${selection.date}`\n          : \"Click a day to select it.\"}\n      </p>\n    </div>\n  );\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}