96fcd05511
Auditoria del issue 0044: 9 archivos .md de cpp/functions/viz/ con uses_functions actualizado. Resuelve dependencias detectadas via #include: plot_static (consumido por bar_chart, histogram, line_plot, pie_chart, scatter_plot), gl_loader, gl_framebuffer, gl_shader, graph_force_layout, graph_renderer, graph_spatial_hash, orbit_camera, sparkline y tokens. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.4 KiB
2.4 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, notes
| 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 | notes | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pie_chart | component | cpp | viz | 1.1.0 | pure | void pie_chart(const char* title, const char* const* labels, const float* values, int count, float radius = 0.0f, float height = 200.0f) | Pie/donut chart con ImPlot, ejes pineados, altura explicita y tooltip por slice al pasar el mouse |
|
|
false |
|
false | cpp/functions/viz/pie_chart.cpp | imgui |
|
Renderiza el pie en el frame ImGui actual; muestra tooltip con label + valor + % al pasar por encima de un slice | scaffolding/demo en primitives_gallery |
pie_chart
Wrapper atomico sobre ImPlot::PlotPieChart configurado para visualizacion estatica en dashboards. Modo pie (radius >= 0) o donut (radius < 0).
v1.1 (2026-04-24)
- Altura explicita (
height): necesaria para evitar vibracion en contenedores conAutoResizeY. Verviz/plot_static.h. - Flags compartidos desde
plot_static::kPlotFlags+kAxisFlagsHidden(axis decorations off): sin pan/zoom, sin menus, sin auto-fit, sin highlight al hover. - Tooltip por slice: calcula que slice esta bajo el cursor usando
atan2(mouse - center)(ImPlot dibuja slices en sentido CCW matematico desde angulo 90°, arriba) y muestralabel + valor + porcentaje. - Aspect 1:1 mantenido con
ImPlotFlags_Equalpara que el pie no se deforme en paneles rectangulares.
Ejemplo
const char* labels[] = {"Pure", "Impure"};
float values[] = {412, 187};
pie_chart("##purity", labels, values, 2); // pie normal, h=200
pie_chart("##purity", labels, values, 2, -0.4f, 260.0f); // donut, h=260