Skip to content
Back to skills

Heatmap

ASecurity

Grid-based heatmap with color-scaled cells. Includes a calendar heatmap variant (year and month views). Supports custom symbols, cell selection, tooltips, and multi-axis layouts.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
developmentgoreactnode

Works with

  • cursor
  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill heatmap --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Heatmap?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Heatmap
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-heatmap/badge)](https://www.skillsdirectory.com/skills/reaviz-heatmap)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Heatmap

Grid-based heatmap with color-scaled cells. Includes a calendar heatmap variant (year and month views). Supports custom symbols, cell selection, tooltips, and multi-axis layouts.

## Import

```tsx
import {
  Heatmap,
  HeatmapSeries,
  HeatmapCell,
  CalendarHeatmap
} from 'reaviz';
```

## Heatmap Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `ChartNestedDataShape[]` | `[]` | Chart data |
| `width` | `number` | auto | Width in pixels |
| `height` | `number` | auto | Height in pixels |
| `margins` | `Margins` | `10` | Chart margins |
| `series` | `ReactElement<HeatmapSeriesProps>` | `<HeatmapSeries padding={0.3} />` | Series component |
| `xAxis` | `ReactElement<LinearAxisProps>` | `<LinearXAxis type="category" />` | X axis (no axis line, padded labels) |
| `yAxis` | `ReactElement<LinearAxisProps>` | `<LinearYAxis type="category" />` | Y axis (no axis line, padded labels) |
| `secondaryAxis` | `ReactElement[]` | — | Additional axis components |
| `className` | `string` | — | SVG CSS class |
| `containerClassName` | `string` | — | Container div CSS class |

## HeatmapSeries Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `padding` | `number` | `0.1` | Padding between cells |
| `animated` | `boolean` | `true` | Enable animations |
| `colorScheme` | `ColorSchemeType` | `['rgba(28,107,86,0.5)', '#2da283']` | Color range for value mapping |
| `emptyColor` | `string` | `'rgba(200,200,200,0.08)'` | Color for cells with no data |
| `cell` | `ReactElement<HeatmapCellProps>` | `<HeatmapCell />` | Cell component |
| `selections` | `any` | — | Selected cell(s) for active state |

## HeatmapCell Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `rx` | `number` | `2` | Horizontal corner radius |
| `ry` | `number` | `2` | Vertical corner radius |
| `cursor` | `string` | `'auto'` | CSS cursor on hover |
| `tooltip` | `ReactElement<ChartTooltipProps> \| null` | `<ChartTooltip />` | Tooltip component |
| `symbol` | `(data) => ReactNode` | — | Custom symbol renderer (replaces rectangle) |
| `onClick` | `(event) => void` | — | Click handler |
| `onMouseEnter` | `(event) => void` | — | Mouse enter handler |
| `onMouseLeave` | `(event) => void` | — | Mouse leave handler |

## CalendarHeatmap Props

Extends Heatmap props with:

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `ChartShallowDataShape[]` | — | Flat data with Date keys (not nested) |
| `view` | `'year' \| 'month'` | `'year'` | Calendar view mode |
| `height` | `number` | — | Component height |
| `width` | `number` | — | Component width |

## Basic Usage

```tsx
const data = [
  { key: 'Jan', data: [
    { key: 'Low', data: 5 },
    { key: 'Med', data: 8 },
    { key: 'High', data: 12 },
  ]},
  { key: 'Feb', data: [
    { key: 'Low', data: 3 },
    { key: 'Med', data: 10 },
    { key: 'High', data: 7 },
  ]},
];

<Heatmap
  height={250}
  width={400}
  data={data}
/>
```

## Named Color Scheme

```tsx
<Heatmap
  data={data}
  series={<HeatmapSeries colorScheme="OrRd" />}
/>
```

## Custom Color Range

```tsx
<Heatmap
  data={data}
  series={
    <HeatmapSeries colorScheme={['#f0f9e8', '#08589e']} />
  }
/>
```

## Custom Cell Symbols

```tsx
<Heatmap
  data={data}
  series={
    <HeatmapSeries
      colorScheme="OrRd"
      cell={
        <HeatmapCell
          symbol={() => (
            <circle r={14} transform="translate(14, 14)" />
          )}
        />
      }
    />
  }
/>
```

## Cell Selection

```tsx
const [active, setActive] = useState([]);

<Heatmap
  data={data}
  series={
    <HeatmapSeries
      selections={active}
      cell={
        <HeatmapCell
          cursor="pointer"
          onClick={(e) => setActive([e.value])}
        />
      }
    />
  }
/>
```

## Calendar Heatmap (Year View)

```tsx
const calendarData = [
  { key: new Date('2024-01-01'), data: 3 },
  { key: new Date('2024-01-02'), data: 7 },
  { key: new Date('2024-01-03'), data: 1 },
  // ... one entry per day
];

<CalendarHeatmap
  height={115}
  width={715}
  data={calendarData}
  view="year"
/>
```

## Calendar Heatmap (Month View)

```tsx
<CalendarHeatmap
  height={115}
  width={100}
  data={monthData}
  view="month"
/>
```

## Custom Tooltip Content

```tsx
<HeatmapSeries
  cell={
    <HeatmapCell
      tooltip={
        <ChartTooltip
          content={(d) => `${d.data.key}: ${d.data.value}`}
        />
      }
    />
  }
/>
```

## No Padding (Tight Grid)

```tsx
<Heatmap
  data={data}
  series={<HeatmapSeries padding={0} />}
/>
```

## Notes

- Color scheme maps cell values to a color range using D3 scales
- Named schemes (e.g. `"OrRd"`) from D3 chromatic are supported alongside custom arrays
- Cells animate in with staggered delay based on index
- Tooltips are auto-disabled for transparent/empty cells
- CalendarHeatmap transforms flat `{ key: Date, data: number }` into the nested grid structure internally
- CalendarHeatmap default tooltip shows `"date · value"` format

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.