--- name: data_table version: 2.1.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. v2.0.0 splits the 4777 LOC entrypoint into 6 sub-functions. v2.1.0 separates members (module-owned) from uses_functions (consumed registry functions)." # members: funciones del registry que el modulo POSEE (renderizan dentro de el). # Estas funciones viven en cpp/functions/viz/data_table_*.cpp y NO se usan # fuera del modulo. Apps consumidoras NO listan estos miembros en su # `uses_functions` cuando declaran `uses_modules: [data_table_cpp]`. members: - data_table_cpp_viz - data_table_chips_cpp_viz - data_table_grid_cpp_viz - data_table_drill_cpp_viz - data_table_color_rules_cpp_viz - data_table_ai_panel_cpp_viz - data_table_viz_panels_cpp_viz # uses_functions: funciones del registry que el modulo CONSUME pero NO posee. # Estas son utiles fuera del modulo (compute, TQL stack, lua, llm, join, etc.). # Si una app necesita lua_engine/llm_anthropic/join_tables/auto_detect_type # STANDALONE (no a traves de data_table), las declara en su `uses_functions` # directamente. No es duplicacion — es uso independiente. uses_functions: - 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( 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 - v2.0.0 (2026-05-17) — **Major internal refactor (issue 0107c)**: split `data_table.cpp` (4777 LOC entrypoint monolitico) en 6 sub-funciones del registry en `cpp/functions/viz/`: `data_table_chips`, `data_table_grid`, `data_table_drill`, `data_table_color_rules`, `data_table_ai_panel`, `data_table_viz_panels`. Entrypoint reducido a 1818 LOC (custom column modal + render orchestration + `ui()` singleton). Nuevo header interno `modules/data_table/data_table_internal.h` con `UiState` aggregator + helpers compartidos (`ops_for_type`, `op_label`, `effective_type`, `view_mode_label`, `parse_hex_color`, `lerp_color_along_stops`, `filters_hash`, `ColInfo`, `auto_promote_aggregated`, etc.). API publica `data_table::render(...)` INTACTA — apps consumidoras NO necesitan cambios. Cada sub-funcion ahora puede testearse aisladamente (issue 0108 testbed agresivo). Members expandido de 13 a 19 (anaden 6 sub-funciones); `audit_data_table_usage_go_infra` + `fn doctor modules` (0107a) auditan drift contra esta lista. - v1.5.0 (2026-05-17) — Per-table state isolation: `stats_mode/cache`, `sel_*`, `inspect_*`, `drill_*` movidos de UiState singleton a `State` (fix multi-table). Conditional color extendido con tres modos: `CellBg` (legacy), `CategoricalDot` (autopalette de 12 hash-deterministico), `NumericRange` (gradiente N-color sobre bg). Hover del menu contextual de header restaurado. - 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).