Node Editor built using Dear ImGui
  • C++ 99.1%
  • CMake 0.9%
Find a file
2026-02-04 16:58:53 +01:00
.github/workflows Use github actions instead of Travis and AppVeyor (#113) 2021-07-11 04:41:20 +02:00
docs Update docs/README.md 2026-02-04 16:58:53 +01:00
examples Examples: Use imgui_impl_opengl3_loader.h instead of gl3w (#264) 2023-12-27 11:55:01 +01:00
external Examples: Use imgui_impl_opengl3_loader.h instead of gl3w (#264) 2023-12-27 11:55:01 +01:00
misc Natvis: Add crude_json::value visualization 2022-08-25 20:56:48 +02:00
.gitignore Backport fix from https://github.com/zig-gamedev/zgui/pull/15/commits/1b76cbeb9adbf7d1bfd0b11aa67ce1705c35856f 2025-11-23 13:58:08 +01:00
crude_json.cpp Editor: Clean long to int implicit cast warning in crude_json 2023-08-31 23:45:45 +02:00
crude_json.h Add version to sources 2020-12-04 22:08:43 +01:00
imgui_bezier_math.h Add version to sources 2020-12-04 22:08:43 +01:00
imgui_bezier_math.inl Add version to sources 2020-12-04 22:08:43 +01:00
imgui_canvas.cpp Canvas: Remember index of first command buffer to not miss updating any used (#260) 2023-10-21 21:56:21 +02:00
imgui_canvas.h Canvas: Remember index of first command buffer to not miss updating any used (#260) 2023-10-21 21:56:21 +02:00
imgui_extra_math.h Editor: Don't duplicated ImVec2/ImVec3 == != operators defined since ImGui r19002 (#268) 2023-12-27 11:11:19 +01:00
imgui_extra_math.inl Editor: Don't duplicated ImVec2/ImVec3 == != operators defined since ImGui r19002 (#268) 2023-12-27 11:11:19 +01:00
imgui_node_editor.cpp Backport fix from https://github.com/zig-gamedev/zgui/pull/15/commits/1b76cbeb9adbf7d1bfd0b11aa67ce1705c35856f 2025-11-23 13:58:08 +01:00
imgui_node_editor.h Editor: Add smooth zoom (#266) 2023-12-27 13:29:43 +01:00
imgui_node_editor_api.cpp Editor: Expose configuration editor was created with 2022-08-20 14:41:48 +02:00
imgui_node_editor_internal.h Editor: Add smooth zoom (#266) 2023-12-27 13:29:43 +01:00
imgui_node_editor_internal.inl Editor: Make selection rect start at click point 2022-08-21 05:12:02 +02:00
LICENSE Create LICENSE 2019-01-23 20:18:35 +01:00

Node Editor in ImGui

Originaly forked from here.

About

An implementation of node editor with ImGui-like API.

Project purpose is to serve as a basis for more complex solutions like blueprint editors.

node_editor_overview

Node Editor is build around an idea "draw your content, we do the rest", which mean interactions are handled by editor, content rendering is handled by user. Editor will take care of:

  • placing your node in the word
  • dragging nodes
  • zoom and scrolling
  • selection
  • various interaction that can be queried by API (creation, deletion, selection changes, etc.)

Here are some highlights:

  • Node movement and selection is handled internally

  • Node and pin contents are fully customizable

  • Fully styled, default theme is modeled after UE4 blueprints

    • Flexible enough to produce such nodes:

      image image image

    • Customizable links based on Bézier curves:

      image image image

  • Automatic highlights for nodes, pins and links:

    image

  • Smooth navigation and selection

  • Node state can be saved in user context, so layout will not break

  • Selection rectangles and group dragging

  • Context menu support

  • Basic shortcuts support (cut/copy/paste/delete)

  • ImGui style API

Editor is used to implement blueprint editor in Spark CE engine, it proved itself there by allowing to do everything we needed. Therefore it is now slowly moving into stable state from beeing a prototype.

Note: Project recently was restructured to mimic ImGui layout.

Please report issues or questions if something isn't clear.

Dependencies

  • Vanilla ImGui 1.72+
  • C++14

Dependencies for examples:

Optional extension you can pull into your local copy of ImGui node editor can take advantage of:

Building / Installing

Node Editor sources are located in root project directory. To use it, simply copy&paste sources into your project. Exactly like you can do with ImGui.

Examples

Examples can be build with CMake:

Windows:
    cmake -S examples -B build -G "Visual Studio 15 2017 Win64"
      or
    cmake -S examples -B build -G "Visual Studio 16 2019" -A x64

macOS:
    cmake -S examples -B build -G "Xcode"

Linux:
    cmake -S examples -B build -G "Unix Makefiles"

Build:
    cmake --build build --config Release

Executables will be located in build\bin directory.

Quick Start

Main node editor header is located in imgui_node_editor.h.

Minimal example of one node can be found in simple-example.cpp. Press 'F' in editor to focus on editor content if you see only grid.

# include <imgui.h>
# include <imgui_node_editor.h>
# include <application.h>

namespace ed = ax::NodeEditor;

struct Example:
    public Application
{
    using Application::Application;

    void OnStart() override
    {
        ed::Config config;
        config.SettingsFile = "Simple.json";
        m_Context = ed::CreateEditor(&config);
    }

    void OnStop() override
    {
        ed::DestroyEditor(m_Context);
    }

    void OnFrame(float deltaTime) override
    {
        auto& io = ImGui::GetIO();

        ImGui::Text("FPS: %.2f (%.2gms)", io.Framerate, io.Framerate ? 1000.0f / io.Framerate : 0.0f);

        ImGui::Separator();

        ed::SetCurrentEditor(m_Context);
        ed::Begin("My Editor", ImVec2(0.0, 0.0f));
        int uniqueId = 1;
        // Start drawing nodes.
        ed::BeginNode(uniqueId++);
            ImGui::Text("Node A");
            ed::BeginPin(uniqueId++, ed::PinKind::Input);
                ImGui::Text("-> In");
            ed::EndPin();
            ImGui::SameLine();
            ed::BeginPin(uniqueId++, ed::PinKind::Output);
                ImGui::Text("Out ->");
            ed::EndPin();
        ed::EndNode();
        ed::End();
        ed::SetCurrentEditor(nullptr);

        //ImGui::ShowMetricsWindow();
    }

    ed::EditorContext* m_Context = nullptr;
};

int Main(int argc, char** argv)
{
    Example exampe("Simple", argc, argv);

    if (exampe.Create())
        return exampe.Run();

    return 0;
}

Result:

00-Simple

For more details please visit examples folder.

Blueprints Example

Preview2

Here is Node Editor at work in Spark CE

image image