https://github.com/rokups/imnodes
Node graph implementation for Dear ImGui. Used in https://github.com/rokups/rbfx
https://github.com/rokups/imnodes
Last synced: 17 days ago
JSON representation
Node graph implementation for Dear ImGui. Used in https://github.com/rokups/rbfx
- Host: GitHub
- URL: https://github.com/rokups/imnodes
- Owner: rokups
- License: mit
- Created: 2019-05-24T10:49:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-06T14:39:25.000Z (about 1 year ago)
- Last Synced: 2025-04-13T05:03:18.600Z (17 days ago)
- Language: C++
- Homepage:
- Size: 85 KB
- Stars: 697
- Watchers: 23
- Forks: 60
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ImNodes
=======A standalone [Dear ImGui](https://github.com/ocornut/imgui) node graph implementation.

Library provides core features needed to create a node graph, while leaving it to the user to define content of node.
Node layouting is left to the user, however comprehensible example is available which can be used as a base.## A (very) trivial example
```cpp
static ImNodes::CanvasState canvas;if (ImGui::Begin("ImNodes", nullptr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse))
{
ImNodes::BeginCanvas(&canvas);struct Node
{
ImVec2 pos{};
bool selected{};
ImNodes::Ez::SlotInfo inputs[1];
ImNodes::Ez::SlotInfo outputs[1];
};static Node nodes[3] = {
{{50, 100}, false, {{"In", 1}}, {{"Out", 1}}},
{{250, 50}, false, {{"In", 1}}, {{"Out", 1}}},
{{250, 100}, false, {{"In", 1}}, {{"Out", 1}}},
};for (Node& node : nodes)
{
if (ImNodes::Ez::BeginNode(&node, "Node Title", &node.pos, &node.selected))
{
ImNodes::Ez::InputSlots(node.inputs, 1);
ImNodes::Ez::OutputSlots(node.outputs, 1);
ImNodes::Ez::EndNode();
}
}ImNodes::Connection(&nodes[1], "In", &nodes[0], "Out");
ImNodes::Connection(&nodes[2], "In", &nodes[0], "Out");ImNodes::EndCanvas();
}
ImGui::End();
```