$ show thedmd/imgui-node-editor
This repository provides a reusable, interactive node editor library built on top of Dear ImGui. It is a pure C++ library with a public API that enables embedding a visual node/graph editor into any ImGui-based application. The core implementation handles node and link creation, dragging, selection, zoom/pan, context menus, cut/copy/paste, flow animations, and state serialization via a bundled JSON library. It is not a standalone application but ships with several examples and an application framework (Win32/DirectX11, GLFW/OpenGL) to demonstrate usage. The architecture is modular, with separate components for canvas rendering, bezier math, and JSON serialization, making individual parts reusable in other projects. The repository is well-maintained with active issue triage and recent commits, though it has medium technical drift due to heavy version-conditional code for Dear ImGui compatibility and reliance on some outdated dependencies (DirectX SDK, older stb versions).
The LLM identified 4 files worth highlighting for reuse:
Provides an infinite virtual canvas with smooth zoom/pan using ImGui draw lists. Reusable in any ImGui project needing a scrollable, scalable workspace. Implements coordinate transformations and suspend/resume for nested content.
Self-contained cubic bezier math functions: length calculation, curve splitting, projection of points onto curve, fixed-step sampling. Can be extracted for curve rendering, hit testing, or animation in any 2D graphics project.
Lightweight, single-header JSON parser and serializer with no external dependencies. Supports parsing from string and serializing to string. Reusable as a drop-in JSON utility for C++ projects that need simple JSON handling.
Abstract base class for ImGui applications, providing lifecycle (start, stop, frame), font management, and texture loading. Combined with Platform and Renderer interfaces, it enables easy porting across windowing systems and graphics APIs. Demonstrates a clean decoupling pattern for ImGui integration.