feat: add C++ ImGui functions for core UI and visualization
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>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#include "viz/table_view.h"
|
||||
#include "imgui.h"
|
||||
|
||||
bool table_view(const char* id, const char* const* headers, int col_count, const char* const* cells, int row_count) {
|
||||
ImGuiTableFlags flags =
|
||||
ImGuiTableFlags_Borders |
|
||||
ImGuiTableFlags_Sortable |
|
||||
ImGuiTableFlags_RowBg |
|
||||
ImGuiTableFlags_Resizable |
|
||||
ImGuiTableFlags_ScrollY |
|
||||
ImGuiTableFlags_Reorderable;
|
||||
|
||||
if (!ImGui::BeginTable(id, col_count, flags, ImVec2(0, 300))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int col = 0; col < col_count; col++) {
|
||||
ImGui::TableSetupColumn(headers[col]);
|
||||
}
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
for (int row = 0; row < row_count; row++) {
|
||||
ImGui::TableNextRow();
|
||||
for (int col = 0; col < col_count; col++) {
|
||||
ImGui::TableSetColumnIndex(col);
|
||||
ImGui::TextUnformatted(cells[row * col_count + col]);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user