# Generation Mix block

> Power generation mix ridgeline chart with 6 sources in 3D depth, a 2D toggle and baseline menu

Hourly grid output for one day by solar, wind, nuclear, gas, hydro and battery, a total vs forecast, last week or 30-day average, source presets, hour readout, CSV and JSON export. ReUI Frame, shadcn ToggleGroup, Dialog. Energy dashboard.

- Type: Pro block
- Category: [Area Chart](https://web.dev.reui.io/blocks/chart/area-chart.md)
- Page: https://web.dev.reui.io/blocks/chart/area-chart/chart-16
- MCP: `get_block("chart-16")`
- Built with: Button, Button Group, Chart, Dialog, Dropdown Menu, Frame, Spinner, Toggle Group, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Several sources over one day as ridges standing in depth, where hovering one dims the rest and reads its share of that hour

## Agent notes

- Replace `SOURCES` and `SOURCE_CONFIG` in data.ts; each source's `baseline` totals are hand set, not derived from its `output`
- `MAX_GW` and `GW_TICKS` fix the scale at 16 GW, so a source that peaks higher overflows the plot
- Refresh only bumps `revision` after `REFRESH_MS` to replay the rise; nothing is refetched

## When not to use

- Several series compared as thin strokes on one flat axis, with no filled area: use the [Line Chart blocks](https://web.dev.reui.io/blocks/chart/line-chart.md)
- One metric month by month against the same months a year earlier: use [Inbound Leads](https://web.dev.reui.io/blocks/chart/area-chart/chart-52.md) (`get_block("chart-52")`)

## Third-party libraries

- Recharts v3: [API reference](https://recharts.github.io/en-US/api/), [docs](https://recharts.github.io/en-US/guide/getting-started/)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/chart-16
```

## About Area Chart blocks

### When to use

- A metric over time drawn as a gradient filled area and read against an earlier period or a baseline
- Dashboard widgets whose toolbar reshapes the view and exports the plotted data as CSV
- Report cards where a hovered point reads out beside its earlier value or its share of the whole

### When not to use

- A series held against a target or limit line drawn across the same axis: use the [Composed Chart blocks](https://web.dev.reui.io/blocks/chart/composed-chart.md)
- Several KPI tiles, each with a tiny trend tucked under its value: use the [Sparkline blocks](https://web.dev.reui.io/blocks/chart/sparkline.md)
- Conversion stages where each step keeps only part of the volume before it: use the [Sankey Chart blocks](https://web.dev.reui.io/blocks/chart/sankey-chart.md)

### Agent notes

- Keep the `useId` prefix on any new `linearGradient` id, so 2 copies of a block on one page never share a fill
- Copy and export confirmations call `toast` from `sonner`, so the app needs a mounted Toaster to show them
- `Chart` takes no props, so real figures replace the sample rows in the block's data file

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
