feat: add C++ support with ImGui/ImPlot framework and vendor submodules
Añade soporte C++ al registry: vendor submodules (glfw, imgui, implot, tracy), sistema de build con CMake y toolchains cross-platform, runner C++ en fn CLI, parser de tests Google Test, y funciones bash para build Linux/Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "viz/bar_chart.h"
|
||||
#include "implot.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
void bar_chart(const char* title, const char* const* labels, const float* values, int count, float bar_width) {
|
||||
if (ImPlot::BeginPlot(title, ImVec2(-1, 0))) {
|
||||
std::vector<double> positions(count);
|
||||
for (int i = 0; i < count; i++) positions[i] = i;
|
||||
|
||||
ImPlot::SetupAxisTicks(ImAxis_X1, positions.data(), count, labels);
|
||||
ImPlot::PlotBars("##data", values, count, bar_width);
|
||||
ImPlot::EndPlot();
|
||||
}
|
||||
}
|
||||
|
||||
void bar_chart(const char* title, const char* const* labels, const double* values, int count, double bar_width) {
|
||||
if (ImPlot::BeginPlot(title, ImVec2(-1, 0))) {
|
||||
std::vector<double> positions(count);
|
||||
for (int i = 0; i < count; i++) positions[i] = i;
|
||||
|
||||
ImPlot::SetupAxisTicks(ImAxis_X1, positions.data(), count, labels);
|
||||
ImPlot::PlotBars("##data", values, count, bar_width);
|
||||
ImPlot::EndPlot();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user