# Heatmap

Animated uniform grids for matrices, spectrograms, and capacity maps.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview base="pixijs" title="Basic Chart" name="heatmap-demo">
  <Heatmap />
</ComponentPreview>

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @chartcn/pixijs/heatmap
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install pixi.js
      ```

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource src="registry/bases/pixijs/ui/chart.tsx" title="components/chart/pixijs/chart.tsx" />

      <ComponentSource src="registry/bases/pixijs/components/heatmap/heatmap.tsx" title="components/chart/pixijs/heatmap.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Usage [#usage]

```tsx
import { ChartcnHeatmap } from "@/components/chart/pixijs/heatmap";
```

```tsx
<ChartcnHeatmap config={chartConfig} data={data}>
  <ChartcnHeatmap.XAxis />
  <ChartcnHeatmap.YAxis />
  <ChartcnHeatmap.Legend />
  <ChartcnHeatmap.Tooltip />
  <ChartcnHeatmap.Heatmap colormap="viridis" />
</ChartcnHeatmap>
```

## Examples [#examples]

### Cell gaps and colormaps [#cell-gaps-and-colormaps]

<ComponentPreview base="pixijs" title="Inferno cells" name="cell-gap-heatmap-demo">
  <CellGapHeatmap />
</ComponentPreview>

## API Reference [#api-reference]

### Heatmap [#heatmap]

| Prop        | Type                                                           | Default     |
| ----------- | -------------------------------------------------------------- | ----------- |
| `colormap`  | `"viridis" \| "plasma" \| "inferno" \| "magma" \| "grayscale"` | `"viridis"` |
| `cellGapPx` | `number`                                                       | `0`         |
| `opacity`   | `number`                                                       | `1`         |
| `zMin`      | `number`                                                       | automatic   |
| `zMax`      | `number`                                                       | automatic   |
