# modules/pineal/ — Data-viz agnóstica (era lapaloma)

**Propósito.** Motor de gráficos con backends pluggables. Los crates
de visualización no conocen `gpui` ni `wgpu`: hablan contra el trait
`Canvas`, y producen un `RenderPlan` que cada backend ejecuta.

## Crates

| crate              | tipo | rol                                                  |
| ------------------ | ---- | ---------------------------------------------------- |
| `pineal-core`      | lib  | Datos: Series, Point, Rect, Color, RingBuffer        |
| `pineal-render`    | lib  | Trait `Canvas` + `RenderPlan` + backend GPUI (feat)  |
| `pineal-cartesian` | lib  | Axes + viewport + series sobre coord cartesiano      |
| `pineal-financial` | lib  | Candlestick, OHLC sobre cartesian                    |
| `pineal-stream`    | lib  | Streaming a 60Hz desde RingBuffer                    |
| `pineal-phosphor`  | lib  | Trail CRT con alpha decay sobre stream               |
| `pineal-polar`     | lib  | Coord polar (stub)                                   |
| `pineal-heatmap`   | lib  | Grid 2D color-mapped (stub)                          |
| `pineal-treemap`   | lib  | Rectangular treemap (stub)                           |
| `pineal-flow`      | lib  | Sankey/flow diagrams (stub)                          |
| `pineal-mesh`      | lib  | Triangle mesh + barycentric (stub)                   |
| `pineal-export`    | lib  | SVG/PNG export del RenderPlan                        |
| `pineal-umbrella`  | lib  | Re-export con features `core/render/cartesian/...`   |

## Dependencias

- Todos ← `pineal-core`. Render-dependientes ← `pineal-render`.
- Backend GPUI: feature gate `gpui` en pineal-render activa
  `gpui_backend.rs` (consumido por widgets en `apps/pineal-*-demo`).

## Estado

LOC ~4,000. **5 charts implementados** (LOC reales):
- `core` 878, `render` 386, `cartesian` 1397, `financial` 688,
  `stream` 231, `phosphor` 312, `umbrella` 53.

**6 stubs (<30 LOC c/u)** — completar:
- `polar` 16, `heatmap` 21, `treemap` 12, `flow` 16, `mesh` 28,
  `export` 23 (SVG exporter no implementado pese a depender de él
  el roadmap; verificar si export depende de los charts o vice versa).

Roadmap: cerrar los 6 stubs. Orden sugerido: polar → heatmap →
treemap → flow → mesh → export (este último porque depende del
renderer común).
