---
name: data_table
version: 1.4.0
lang: cpp
description: "Reusable C++ ImGui module to render a full TQL-aware data table: chips bar, table grid, viz panels, column-stats inline, drill, color rules, joins, TQL editor, Ask AI, Button renderer, event sink, tooltip per-cell. Bundles compute pipeline + TQL stack + Lua engine + viz_render."
members:
  - data_table_cpp_viz
  - compute_stage_cpp_core
  - compute_pipeline_cpp_core
  - compute_column_stats_cpp_core
  - tql_emit_cpp_core
  - tql_helpers_cpp_core
  - tql_apply_cpp_core
  - tql_to_sql_cpp_core
  - lua_engine_cpp_core
  - join_tables_cpp_core
  - auto_detect_type_cpp_core
  - llm_anthropic_cpp_core
  - viz_render_cpp_viz
tags: [tables, viz, ui, imgui, tql, cpp]
dir_path: modules/data_table
---

## Documentation

C++ ImGui module to render a full data table with TQL pipeline, viz panels, joins, color rules, declarative cell renderers (Badge, Progress, Duration, Icon, Button, Dots, CategoricalChip, ColorScale), drill, Ask AI and event sink.

Entry-point: `data_table::render(id, tables, state, events_out, show_chrome)`.

### Opt-in en una app

1. `app.md`: anadir `uses_modules: [data_table_cpp]`.
2. `CMakeLists.txt`: `target_link_libraries(<app> PRIVATE fn_module_data_table)`.
3. Header: `#include "data_table/data_table.h"` y `#include "core/data_table_types.h"`.
4. Reservar `data_table::State` persistente entre frames y llamar `data_table::render(...)` cada frame.

### Funciones miembro

Cada ID en `members` es una funcion del registry que el modulo bundla en su static lib. Cuando una app declara `uses_modules: [data_table_cpp]`, automaticamente "usa" estas funciones a traves del modulo — no hace falta listarlas otra vez en `uses_functions`.

### Version policy

Semver. Bumps de version se documentan en `## Capability growth log`. Cambios en API publica (`data_table.h`) = major. Adicion de funcionalidad opt-in = minor. Bugfix = patch.

## Capability growth log

- v1.4.0 (2026-05-16) — CategoricalChip (dot izquierda + text) + ColorScale (gradient N-color en fondo de celda)
- v1.3.1 (anterior) — Dots renderer via ImDrawList (font-independent)
- v1.3.0 — Dots renderer para sparkline-like de status timelines
- v1.2.0 — Joins, drill, color rules, tooltip per-cell, Button event sink
- v1.0.0 — Initial table + TQL pipeline + chips bar

## Notes

- El modulo se compila como static lib `fn_module_data_table` (cmake target). Static lib bundla todos los miembros — apps consumidoras solo enlazan UN target.
- Replaces former `fn_table_viz` target (2026-05-16).
- Requiere `fn_framework` (para `fn::local_path()` usado en Ask AI export).
