Files
fn_registry/cpp/functions/viz/graph_renderer.h
T
egutierrez 0bdf35a461 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>
2026-04-08 00:10:18 +02:00

29 lines
1.1 KiB
C++

#pragma once
#include <cstdint>
struct GraphData; // forward declare
struct GraphRendererConfig {
float node_outline = 1.5f; // outline width in pixels
float edge_width = 1.0f; // edge line width
float edge_alpha = 0.4f; // edge transparency
uint32_t bg_color = 0xFF1A1A1E; // ABGR background
bool edge_fade_alpha = true; // fade edge alpha by distance to camera
// Default palette for communities (when node.color == 0)
// 10 distinct colors, ABGR packed
};
struct GraphRenderer;
// Lifecycle
GraphRenderer* graph_renderer_create(int width, int height, const GraphRendererConfig& config = {});
void graph_renderer_destroy(GraphRenderer* r);
void graph_renderer_resize(GraphRenderer* r, int width, int height);
// Render graph to internal FBO.
// cam_x, cam_y: camera center in graph space
// cam_zoom: zoom level (1.0 = 1:1 pixel mapping)
// Returns OpenGL texture ID suitable for ImGui::Image().
unsigned int graph_renderer_draw(GraphRenderer* r, const GraphData& graph,
float cam_x, float cam_y, float cam_zoom);