Heatmap Chart Example
bklit-ui/heatmap-chart-exampleFreeExample
Composable heatmap-chart demo for Open in v0
Install it
npx shadcn@latest add https://bklit.com/r/heatmap-chart-example.jsonSource
1"use client"23// In your app (monorepo/npm): import { HeatmapCells, HeatmapChart, HeatmapInteractionBoundary, HeatmapInteractionProvider, HeatmapLegend, HeatmapTooltip, HeatmapXAxis, HeatmapYAxis } from "@bklitui/ui/charts"4import { HeatmapCells, HeatmapChart, HeatmapInteractionBoundary, HeatmapInteractionProvider, HeatmapLegend, HeatmapTooltip, HeatmapXAxis, HeatmapYAxis } from "@/components/charts"56const data = [7 {8 bin: 0,9 bins: [10 { bin: 0, count: 2, date: new Date(2024, 0, 1) },11 { bin: 1, count: 0, date: new Date(2024, 0, 2) },12 { bin: 2, count: 3, date: new Date(2024, 0, 3) },13 { bin: 3, count: 1, date: new Date(2024, 0, 4) },14 { bin: 4, count: 4, date: new Date(2024, 0, 5) },15 { bin: 5, count: 0, date: new Date(2024, 0, 6) },16 { bin: 6, count: 1, date: new Date(2024, 0, 7) },17 ],18 },19 {20 bin: 1,21 bins: [22 { bin: 0, count: 1, date: new Date(2024, 0, 8) },23 { bin: 1, count: 2, date: new Date(2024, 0, 9) },24 { bin: 2, count: 0, date: new Date(2024, 0, 10) },25 { bin: 3, count: 3, date: new Date(2024, 0, 11) },26 { bin: 4, count: 2, date: new Date(2024, 0, 12) },27 { bin: 5, count: 1, date: new Date(2024, 0, 13) },28 { bin: 6, count: 0, date: new Date(2024, 0, 14) },29 ],30 },31];3233export default function Component() {34 return (35 <main className="flex min-h-svh w-full items-center justify-center p-6 md:p-10">36 <div className="w-full max-w-3xl">37 <HeatmapInteractionProvider>38 <HeatmapInteractionBoundary>39 <div className="flex w-full flex-col items-stretch gap-3">40 <HeatmapChart className="w-full" data={data} layout="fluid">41 <HeatmapCells />42 <HeatmapXAxis />43 <HeatmapYAxis />44 <HeatmapTooltip />45 </HeatmapChart>46 <HeatmapLegend />47 </div>48 </HeatmapInteractionBoundary>49</HeatmapInteractionProvider>50 </div>51 </main>52 )53}
What it pulls in
npm packages
Other registry items
Files it writes
More from bklit-ui
All 56 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Area Chart Examplearea-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Bar Chart Examplebar-chart-example | bklit-ui | Examples | Free | 4 deps · 2 files | |
| Candlestick Chart Examplecandlestick-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Choropleth Chart Examplechoropleth-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Composed Chart Examplecomposed-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Funnel Chart Examplefunnel-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Gauge Chart Examplegauge-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Line Chart Exampleline-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files |
