Files
fn_registry/cpp/functions/viz/heatmap.cpp
T
egutierrez 73a4c3a148 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>
2026-04-06 23:46:36 +02:00

25 lines
966 B
C++

#include "viz/heatmap.h"
#include "implot.h"
void heatmap(const char* title, const float* values, int rows, int cols,
float scale_min, float scale_max) {
if (ImPlot::BeginPlot(title, ImVec2(-1, 0), ImPlotFlags_NoLegend)) {
ImPlot::SetupAxes(nullptr, nullptr,
ImPlotAxisFlags_NoDecorations, ImPlotAxisFlags_NoDecorations);
ImPlot::PlotHeatmap("##data", values, rows, cols,
scale_min, scale_max);
ImPlot::EndPlot();
}
}
void heatmap(const char* title, const double* values, int rows, int cols,
double scale_min, double scale_max) {
if (ImPlot::BeginPlot(title, ImVec2(-1, 0), ImPlotFlags_NoLegend)) {
ImPlot::SetupAxes(nullptr, nullptr,
ImPlotAxisFlags_NoDecorations, ImPlotAxisFlags_NoDecorations);
ImPlot::PlotHeatmap("##data", values, rows, cols,
scale_min, scale_max);
ImPlot::EndPlot();
}
}