ImNodeEditor
A tiny, standalone node-editor for Dear ImGui — focused on dead-simple API, smooth panning/zooming, and easy embedding.
Highlights
- Nodes, pins, links with simple typing (
Any,Float,Vector,Texture,Exec) and selection tools. ([Gigabite Studios][2]) - Zoomable, pannable canvas with marquee select, link creation & deletion. ([Gigabite Studios][2])
- Persistence helpers (
SaveToString,LoadFromString) and small traversal utilities. ([Gigabite Studios][2])
Getting Started
Build (CMake)
git clone https://dock-it.dev/Inverse-Interactive/ImNodeEditor
cd ImNodeEditor
cmake -S . -B build
cmake --build build -j
Minimal Usage
#include "ImNodeEditor.h"
ImNodeEditor::Editor editor;
void DrawUI()
{
// Call once per frame inside your ImGui frame
editor.Draw("My Node Editor");
}
Create a simple graph:
// Create a node and a couple of pins
int nodeA = editor.AddNode("Number", ImVec2(100, 120));
int outA = editor.AddPin(nodeA, ImNodeEditor::PinKind::Output, ImNodeEditor::PinType::Float);
int nodeB = editor.AddNode("Print", ImVec2(380, 120));
int inB = editor.AddPin(nodeB, ImNodeEditor::PinKind::Input, ImNodeEditor::PinType::Float);
// Link them
editor.AddLink(outA, inB);
// Optional: custom node content
editor.SetNodeDrawFunction(nodeA, [](const ImRect& rect, ImNodeEditor::Node&){
ImGui::SetCursorScreenPos(rect.Min);
ImGui::InvisibleButton("body", rect.GetSize());
ImGui::SetCursorScreenPos(rect.Min + ImVec2(8, 6));
ImGui::TextUnformatted("Value: 1.0");
});
License
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
See the full text in LICENSE. ([Gigabite Studios][1])
Description
Languages
CMake
47.5%
C++
36.7%
C
15.8%