0bdf35a461
Funciones C++/ImGui para dashboards (grid, panel, docking, sidebar, tabs), visualizaciones (candlestick, gauge, histogram, pie, sparkline, heatmap, scatter, line, bar, surface3d, kpi, table), grafos (force layout, renderer, viewport, spatial hash, types) y utilidades (time series buffer, tracy zones, memory/fps overlay, plot theme). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gauge | component | cpp | viz | 1.0.0 | pure | void gauge(const char* label, float value, float min_val, float max_val, float radius = 60.0f) | Renderiza un indicador circular tipo gauge/velocimetro usando ImGui draw primitives |
|
false |
|
false | cpp/functions/viz/gauge.cpp | imgui |
|
Renderiza el gauge en el frame ImGui actual, reservando espacio con ImGui::Dummy |
gauge
Indicador circular tipo gauge/velocimetro construido sobre ImGui draw primitives. No requiere ImPlot.
El arco ocupa 240 grados (de 150deg a 390deg en sentido horario). El color del arco de valor interpolado de verde (minimo) a amarillo (mitad) a rojo (maximo). Una aguja blanca apunta al valor actual.
Debe llamarse dentro del render callback de fn::run_app (o cualquier contexto con un frame ImGui activo).
Ejemplo
// KPI card con gauge de temperatura
gauge("CPU Temp", 72.5f, 0.0f, 100.0f, 50.0f);
// Gauge grande para dashboard principal
gauge("Velocidad", 3200.0f, 0.0f, 5000.0f, 80.0f);
Notas
- El arco de fondo es gris oscuro (IM_COL32(60,60,60,220)), 6px de grosor.
- La aguja tiene longitud del 75% del radio para evitar solapar el arco.
- Usa solo
float; no ofrece overloaddoubleporque ImGui DrawList trabaja en coordenadas de pantalla (float). - El espacio reservado es
diameter x (diameter + line_height)para incluir la etiqueta.