A small, dependency-free node editor extension for dear imgui.

Overview

imnodes

A small, dependency-free node editor extension for dear imgui.

Build Status

Features:

  • Create nodes, links, and pins in an immediate-mode style
  • Single header and source file, just copy-paste imnodes.h, imnodes_internal.h, and imnodes.cpp into your project. The only dependency is dear imgui itself!
  • Written in the same style of C++ as dear imgui itself -- no modern C++ used
  • Use regular dear imgui widgets inside the nodes
  • Multiple node and link selection with a box selector
  • Nodes, links, and pins are fully customizable, from color style to layout
  • Default themes match dear imgui's default themes

Scroll down for a brief tour, known issues, and further information!

Build the examples

This repository includes a few example files, under example/. You can copy-paste them into your own imgui project, or you can build them here, in this repository. To build here:

  • SDL2 needs to be installed
  • premake5 is used to generate the build files
# Assuming you've installed SDL2 via vcpkg, for instance
$ premake5 gmake \
    --sdl-include-path=/Users/nelarius/vcpkg/installed/x64-osx/include/SDL2 \
    --sdl-link-path=/Users/nelarius/vcpkg/installed/x64-osx/lib

# Or alternatively, if you are on MacOS and have the SDL2 framework installed
$ premake5 gmake --use-sdl-framework

$ make all -j

A brief tour

Here is a small overview of how the extension is used. For more information on example usage, scroll to the bottom of the README.

Before anything can be done, the library must be initialized. This can be done at the same time as dear imgui initialization.

ImGui::CreateContext();
ImNodes::CreateContext();

// elsewhere in the code...
ImNodes::DestroyContext();
ImGui::DestroyContext();

The node editor is a workspace which contains nodes. The node editor must be instantiated within a window, like any other UI element.

ImGui::Begin("node editor");

ImNodes::BeginNodeEditor();
ImNodes::EndNodeEditor();

ImGui::End();

Now you should have a workspace with a grid visible in the window. An empty node can now be instantiated:

const int hardcoded_node_id = 1;

ImNodes::BeginNodeEditor();

ImNodes::BeginNode(hardcoded_node_id);
ImGui::Dummy(ImVec2(80.0f, 45.0f));
ImNodes::EndNode();

ImNodes::EndNodeEditor();

Nodes, like windows in dear imgui must be uniquely identified. But we can't use the node titles for identification, because it should be possible to have many nodes of the same name in the workspace. Instead, you just use integers for identification.

Attributes are the UI content of the node. An attribute will have a pin (the little circle) on either side of the node. There are two types of attributes: input, and output attributes. Input attribute pins are on the left side of the node, and output attribute pins are on the right. Like nodes, pins must be uniquely identified.

ImNodes::BeginNode(hardcoded_node_id);

const int output_attr_id = 2;
ImNodes::BeginOutputAttribute(output_attr_id);
// in between Begin|EndAttribute calls, you can call ImGui
// UI functions
ImGui::Text("output pin");
ImNodes::EndOutputAttribute();

ImNodes::EndNode();

The extension doesn't really care what is in the attribute. It just renders the pin for the attribute, and allows the user to create links between pins.

A title bar can be added to the node using BeginNodeTitleBar and EndNodeTitleBar. Like attributes, you place your title bar's content between the function calls. Note that these functions have to be called before adding attributes or other dear imgui UI elements to the node, since the node's layout is built in order, top-to-bottom.

ImNodes::BeginNode(hardcoded_node_id);

ImNodes::BeginNodeTitleBar();
ImGui::TextUnformatted("output node");
ImNodes::EndNodeTitleBar();

// pins and other node UI content omitted...

ImNodes::EndNode();

The user has to render their own links between nodes as well. A link is a curve which connects two attributes. A link is just a pair of attribute ids. And like nodes and attributes, links too have to be identified by unique integer values:

std::vector
   <
   int, 
   int>> links;

   // elsewhere in the code...

   for (
   int i = 
   0; i < links.size(); ++i)
{
  
   const std::pair<
   int, 
   int> p = links[i];
  
   // in this case, we just use the array index of the link
  
   // as the unique identifier
  
   ImNodes::Link(i, p.
   first, p.
   second);
}
  

After EndNodeEditor has been called, you can check if a link was created during the frame with the function call IsLinkCreated:

int start_attr, end_attr;
if (ImNodes::IsLinkCreated(&start_attr, &end_attr))
{
  links.push_back(std::make_pair(start_attr, end_attr));
}

In addition to checking for new links, you can also check whether UI elements are being hovered over by the mouse cursor:

int node_id;
if (ImNodes::IsNodeHovered(&node_id))
{
  node_hovered = node_id;
}

You can also check to see if any node has been selected. Nodes can be clicked on, or they can be selected by clicking and dragging the box selector over them.

// Note that since many nodes can be selected at once, we first need to query the number of
// selected nodes before getting them.
const int num_selected_nodes = ImNodes::NumSelectedNodes();
if (num_selected_nodes > 0)
{
  std::vector<int> selected_nodes;
  selected_nodes.resize(num_selected_nodes);
  ImNodes::GetSelectedNodes(selected_nodes.data());
}

See imnodes.h for more UI event-related functions.

Like dear imgui, the style of the UI can be changed. You can set the color style of individual nodes, pins, and links mid-frame by calling ImNodes::PushColorStyle and ImNodes::PopColorStyle.

// set the titlebar color of an individual node
ImNodes::PushColorStyle(
  ImNodesCol_TitleBar, IM_COL32(11, 109, 191, 255));
ImNodes::PushColorStyle(
  ImNodesCol_TitleBarSelected, IM_COL32(81, 148, 204, 255));

ImNodes::BeginNode(hardcoded_node_id);
// node internals here...
ImNodes::EndNode();

ImNodes::PopColorStyle();
ImNodes::PopColorStyle();

If the style is not being set mid-frame, ImNodes::GetStyle can be called instead, and the values can be set into the style array directly.

// set the titlebar color for all nodes
ImNodesStyle& style = ImNodes::GetStyle();
style.colors[ImNodesCol_TitleBar] = IM_COL32(232, 27, 86, 255);
style.colors[ImNodesCol_TitleBarSelected] = IM_COL32(241, 108, 146, 255);

To handle quicker navigation of large graphs you can use an interactive mini-map overlay. The mini-map can be zoomed and scrolled. Editor nodes will track the panning of the mini-map accordingly.

ImGui::Begin("node editor");

ImNodes::BeginNodeEditor();

// add nodes...

// must be called right before EndNodeEditor
ImNodes::MiniMap();
ImNodes::EndNodeEditor();

ImGui::End();

The relative sizing and corner location of the mini-map in the editor space can be specified like so:

// MiniMap is a square region with a side length that is 20% the largest editor canvas dimension
// See ImNodesMiniMapLocation_ for other corner locations
ImNodes::MiniMap(0.2f, ImNodesMiniMapLocation_TopRight);

The mini-map also supports limited node hovering customization through a user-defined callback.

// User callback
void mini_map_node_hovering_callback(int node_id, void* user_data)
{
  ImGui::SetTooltip("This is node %d", node_id);
}

// Later on...
ImNodes::MiniMap(0.2f, ImNodesMiniMapLocation_TopRight, mini_map_node_hovering_callback, custom_user_data);

// 'custom_user_data' can be used to supply extra information needed for drawing within the callback

Customizing ImNodes

ImNodes can be customized by providing an imnodes_config.h header and specifying defining IMNODES_USER_CONFIG=imnodes_config.h when compiling.

It is currently possible to override the type of the minimap hovering callback function. This is useful when generating bindings for another language.

Here's an example imnodes_config.h, which generates a pybind wrapper for the callback.

#pragma once

#include <pybind11/functional.h>

namespace pybind11 {

inline bool PyWrapper_Check(PyObject *o) { return true; }

class wrapper : public object {
public:
    PYBIND11_OBJECT_DEFAULT(wrapper, object, PyWrapper_Check)
    wrapper(void* x) { m_ptr = (PyObject*)x; }
    explicit operator bool() const { return m_ptr != nullptr && m_ptr != Py_None; }
};

} //namespace pybind11

namespace py = pybind11;

#define ImNodesMiniMapNodeHoveringCallback py::wrapper

#define ImNodesMiniMapNodeHoveringCallbackUserData py::wrapper

Known issues

  • ImGui::Separator() spans the current window span. As a result, using a separator inside a node will result in the separator spilling out of the node into the node editor grid.

Further information

See the examples/ directory to see library usage in greater detail.

  • simple.cpp is a simple hello-world style program which displays two nodes
  • save_load.cpp is enables you to add and remove nodes and links, and serializes/deserializes them, so that the program state is retained between restarting the program
  • color_node_editor.cpp is a more complete example, which shows how a simple node editor is implemented with a graph.
Comments
  • [BUG] Invalid selected nodes

    [BUG] Invalid selected nodes

    Recently I tried a node editor that is able to delete selected nodes. The problem is that imnodes uses the node index to keep track of selected nodes which causes from assertion fails to invalid nodes being reported as selected. The solution I took was to clear the selection every time I deleted a selected node. I can make a pr if you like the solution.

    opened by brukted 14
  • Node overlap rendering is not correct

    Node overlap rendering is not correct

    When dragging nodes over each other, the rendering is glitchy due to all node frames being rendered in a loop in EndNodeEditor. It would be better to render the frame after EndNode is called so that the node frame and ImGui UI are at least rendered in the same order.

    node_overlap_rendering_problem

    bug 
    opened by Nelarius 14
  • Linking Errors

    Linking Errors

    I'm getting the below linking errors when I attempt to include imnodes in my project. I can include the files and it recognizes the functions but won't compile them. ImGui works fine when I don't attempt to use imnodes. Any thoughts.

    Thanks!

    VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::Initialize(void)" ([email protected]@@YAXXZ) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ) 1>VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::Shutdown(void)" ([email protected]@@YAXXZ) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ) 1>VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::BeginNode(int)" (?Beg[email protected]@@[email protected]) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ) 1>VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::EndNode(void)" ([email protected]@@YAXXZ) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ) 1>VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::BeginOutputAttribute(int,enum imnodes::PinShape)" ([email protected]@@[email protected]@@Z) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ) 1>VisualState.obj : error LNK2019: unresolved external symbol "void __cdecl imnodes::EndAttribute(void)" ([email protected]@@YAXXZ) referenced in function "public: void __cdecl VisualState::VisualZone(void)" ([email protected]@@QEAAXXZ)

    opened by brionholland 10
  • memory leak

    memory leak

    While debugging in visual studio, I noticed that after adding a bunch of nodes the memory use would continually grow. I think just adding onw node is doing the same thing, but the behavior is more noticeable with many nodes. I'm not 100% sure, but Intel Inspector says it's coming from here image

    bug 
    opened by ahmidou 9
  • PR#95 namespace collision

    PR#95 namespace collision

    Sorry for not realizing this earlier: namespace ImNodes will collide with https://github.com/rokups/ImNodes/blob/02b085dace8bdd815374d6440efb1f70d8a9ebaf/ImNodes.h#L35

    opened by sonoro1234 8
  • Add ability to disconnect a link by clicking and dragging

    Add ability to disconnect a link by clicking and dragging

    In Blender it's possible to click and drag a link to disconnect it from a node, which is a very convenient feature.

    Current plans:

    • [x] Left-click and drag to detach link (link detaching signalled via the IsLinkDestroyed function)
    • [x] Add some kind of option for enabling/disabling "click and drag to detach"
    • [x] Modifier + left-click over link to snap link wire to mouse cursor and detach link
    • [x] Option for enabling/disabling "snap wire to mouse cursor"
    enhancement 
    opened by Nelarius 8
  • Editor navigation mini-map

    Editor navigation mini-map

    Some background

    Something that seems useful for large graphs is a way of quickly navigating to nodes in some sort of "zoomed out" context. I searched through some old repo issues to find that this has been brought up in the past, but isn't practically achievable with ImGui in its current state.

    One alternative to zooming in the editor panel that I wanted to try was a navigable mini-map of the node editor context panel.

    Prototype design

    I've made a prototype version of this based on some basic design details:

    • the mini-map is just a re-drawn version of the editor context which shows the relative locations of nodes and their linkages, minus any titles or labels on pins

    https://user-images.githubusercontent.com/1093236/112758246-26998000-8fa2-11eb-9945-27a1a73b48c7.mp4

    • given these simplifications, the mini-map is independently zoom-able from the editor
    • the editor can be panned; panning the mini-map pans the editor at a rate proportional to its zoom, i.e:
      • when the mini-map is panned while zoomed out, the editor is panned significantly faster rate
      • conversely, when the mini-map is zoomed such that its scaling relative to the editor is 1-to-1, they pan at the same rate
    • mini-map nodes are hoverable. When clicked, they have the following behavior:
      • the mini-map node is centered in the mini-map
      • the corresponding editor node is centered in the editor view region

    https://user-images.githubusercontent.com/1093236/112758257-3618c900-8fa2-11eb-8e0b-cdfd7576d7da.mp4

    • mini-map nodes are hoverable:
      • the nodes can have custom tool-tips/pop-up behavior

    https://user-images.githubusercontent.com/1093236/112758959-bb51ad00-8fa5-11eb-931e-7ae67045145e.mp4

    Implementation

    I've added some code for the current prototype here using the existing imnodes implementation and ImGui functions. Some details are left a bit vague, namely, the containers storing node/link IDs and how I'm mapping from link-to-node IDs. Previously, I was using a function I added to the imnodes library in my local fork to get nodes IDs from links IDs without having to do any external structures to hold on to the link-to-node mapping, specifically.

    However, I propose that this functionality could be made into an complimentary library feature, since all the necessary information for rendering it is available in the imnodes internals.

    I imagine it as a widget which:

    • can be drawn as separate contents which is drawn in another window/group, like I've shown in the prototype
    ImGui::BeginGroup();
    imnodes::MiniMap(mini_map_size, ...);
    ImGui::EndGroup();
    
    • can be drawn as an entity that is overlaying the node editor context
    imnodes::BeginNodeEditor();
    imnodes::MiniMap(mini_map_size, editor_location, ...);
    imnodes::EndNodeEditor();
    

    Questions

    • First and foremost: is a DrawMiniMap feature useful/reasonable as I've describe it?
    • What's the best way to add custom drawing to mini-map nodes? For instance, how does one add tool-tips to mini-map nodes when they are hovered? One way I can think is with a callback supplied to DrawMiniMap
    • Whats the best way to deal with mini-map style? should it approximately follow the editor style settings, where possible? should it have a separate style configuration?
    opened by briancairl 6
  • Change mini-map behavior to work as described in issue #117

    Change mini-map behavior to work as described in issue #117

    Change mini-map behavior to work as described in issue #117

    Mini-map changes:

    • Remove old panning/zooming behavior
    • Fit and show full node graph
    • Show editor's canvas rect
    • On click/drag center editor's canvas to selected location

    Color node editor example changes:

    • Add menu to change mini-map location
    • Add menu to change style

    Internal changes:

    • Refactor how style variables are backed up to follow ImGui style

    NOTE: This is based on top of PR #120, so probably that one should go in first.

    opened by smilediver 5
  • Snapping to grid, primary grid line coloration

    Snapping to grid, primary grid line coloration

    @Web-eWorks made a nice implementation for snapping nodes to the grid: https://github.com/Nelarius/imnodes/pull/72 Opening this issue, so the work doesn't get lost.

    The pr would need some work due to merge conflicts. I think it also might be worth experimenting if the snapping the nodes to the grid while clicking and dragging would be a better experience.

    enhancement 
    opened by Nelarius 5
  • Crash on object_pool_update line 874 when cleaning a node editor and then adding a node.

    Crash on object_pool_update line 874 when cleaning a node editor and then adding a node.

    Hi,

    I have a crash that I can reproduce in 3 frames. First you need to draw two nodes in a editor. Then draw none and finally draw one. The application will assert on line 874 in the function object_pool_update.

    Here is a code exemple:

                    ImGui::Begin("test");
    		imnodes::BeginNodeEditor();
    		if (i == 0) { // frame 1
    
    			imnodes::BeginNode(0);
    			imnodes::EndNode();
    			imnodes::BeginNode(1);
    			imnodes::EndNode();
    
    			i++;
    		} else if (i == 1) { // frame 2
    
    			i++;
    		} else if (i == 2) { // frame 3
    
    			imnodes::BeginNode(0);
    			imnodes::EndNode();
    			i++;
    		}
    		imnodes::EndNodeEditor();
    		ImGui::End();
    

    You don't need anything more than that. The crash doesn't happen if on frame 3 the node use another id so it is maybe an intended crash ? If that's the case I still think that at least the error reporting is sub-par but still I don't see why this couldn't work.

    I do admit that I'm not familiar with imnodes so I might be missing something, I hope that you have all the informations you need.

    bug 
    opened by Tackwin 5
  • About the Pin's shape and Node's icon

    About the Pin's shape and Node's icon

    Now we PushColorStyle function to change the color for node and pin.

    How about adding a way to support to change the shape of Pin? We could get a good result if we can change the shape when using the node system with some of the basic shapes listed below:

    PinShape { CIRCLE, TRIANGLE, SQUARE, PENTAGON, STAR, SEMICIRCLE, HEX, CROSS, RING, ARROW, QUATREFOIL, RHOMBUS, HEART, OCTAGON, };

    Besides, it would be great if there have a way to change the node's icon like this:

    opened by ketoo 5
  • [Feature Request] Vertical Pins

    [Feature Request] Vertical Pins

    Hi there, just want to say thank you so much for this project, its really saved me a lot of time.

    I was wondering if this project could have vertical pins on the top/bottom of the nodes.

    (Also random side note, is there a way to make the lines straight that Im missing?)

    Thanks again and keep up the awesome stuff!

    opened by NHAS 0
  • phantom TitleBar rect glitch when conditionnal call to BeginNodeTitleBar

    phantom TitleBar rect glitch when conditionnal call to BeginNodeTitleBar

    If, from one frame to another, we call or don't call BeginNodeTitleBaron a specific node (depending on a condition for my case), a glitching rect stays on the screen. It is due to a missing value reset of title bar content rect in BeginNode().

    Adding node.TitleBarContentRect = ImRect(); in BeginNode() solves the issue

    opened by vlmillet 0
  • Fixes mismatched OutputAttribute in color example

    Fixes mismatched OutputAttribute in color example

    This PR just fixes what appears to be a (currently harmless) typo. It doesn't introduce any functional difference, given that EndInputAttribute() and EndOutputAttribute() both just call EndPinAttribute(), but if those semantics ever changed, it could cause an issue.

    opened by spiderkeys 0
  • Mis-Entering BoxSelection Interaction.

    Mis-Entering BoxSelection Interaction.

    I have a imnode window with ImGuiWindowFlags_NoBringToFrontOnFocus flag. While the imnode window getting focused, dragging another window above it, the imnode window will mis-enter BoxSelection Interaction.

    opened by koala999cn 2
  • Customizable ID type

    Customizable ID type

    Hi 👋 In my application I have a use case where I use 128-bits UUIDs as IDs internally, and I would like to use these same IDs as Node and Link IDs when I use imnodes without having to truncate to int back and forth.

    This is why I basically added using ID = int; to imnodes, and added the possibility to override that definition of ID inside "imnodes_config.h".

    A user-defined "imnodes_config.h" would look like this:

    // imnodes_config.h
    #pragma once
    #include <limits.h>
    #include <string>
    
    namespace IMNODES_NAMESPACE
    {
    using ID = int;
    static constexpr ID INVALID_ID = INT_MIN;
    
    inline void PushID(ID id) { ImGui::PushID(id); }
    
    inline std::string IDToString(ID id) { return std::to_string(id); }
    
    inline ID IDFromString(const std::string& str) { return std::stoi(str); }
    
    } // namespace IMNODES_NAMESPACE
    

    Changes

    The two main (and maybe controversial) changes I hade to make are:

    • [ ] Having to copy-paste ImGuiStorage's implementation from Dear ImGui into imnodes just to change the type of the ID used to index into that storage. But this also has the benefit of removing the static_casts from int to ImGuiID that were all over imnodes' implementation.
    • [ ] Changing the implementation of NodeLineHandler() that is used during serialization of the editor state. We now use std::string manipulations instead of sscanf to read and write the ID to and from strings. That is because we don't know how complex the user ID might be, and we have to let them handle the conversions. Using std::string instead of char[] is the simplest.
    opened by JulesFouchy 0
Releases(v0.5)
  • v0.5(Mar 9, 2022)

    Special thanks to everyone who contributed to this release with a pr!

    New features

    • Introduced the minimap https://github.com/Nelarius/imnodes/pull/99
      • Just one function call is required: MiniMap()!
    • Programmatic interface to handle node and link selections https://github.com/Nelarius/imnodes/pull/107 Introduces the functions
      • SelectNode
      • ClearNodeSelection
      • IsNodeSelected
      • SelectLink
      • ClearLinkSelection
      • IsLinkSelected
    • Auto-panning pans the editor automatically if the mouse goes outside the editor canvas while dragging nodes or links https://github.com/Nelarius/imnodes/pull/120
    • Add ImGui-like user defined callbacks for minimap node hovering events https://github.com/Nelarius/imnodes/pull/127
      • ImNodesMiniMapNodeHoveringCallback and ImNodesMiniMapNodeHoveringCallbackUserData added to imnodes.h
    Screenshot 2022-03-09 at 9 42 03

    The minimap in action!

    Other changes

    • Render canvas gridlines by default in the light color scheme to be more consistent with ImGui.

    Fixes

    • Prevent interaction with node graph if an ImGui widget is active. Fixes problems where the nodes underneath a color wheel move while manipulating the wheel.
    • Fixing some unresponsive UI issues arising from the reuse of internal ids https://github.com/Nelarius/imnodes/pull/124
    • Prevents links from being hovered if a pin is hovered https://github.com/Nelarius/imnodes/pull/126

    Breaking changes

    • The code was reformatted to be more consistent with ImGui https://github.com/Nelarius/imnodes/pull/95
      • Namespace renamed to ImNodes
      • The namespace is configurable, by defining IMNODES_NAMESPACE
      • All internal functions now CamelCase
      • Enums constants prefixed with ImNodes
    Source code(tar.gz)
    Source code(zip)
  • v0.4(Apr 2, 2021)

    New features

    depth-stacking

    • New depth sorting of nodes. Selection of overlapping nodes now handled correctly -- clicking on a node will place it on top of other overlapping nodes.

    • New querying functions

      • GetNodeGridSpacePos;
      • GetNodeScreenSpacePos
      • IsLinkCreated
    • Functions for clearing selections

      • ClearNodeSelection
      • ClearLinkSelection
    • DLL support was added. Library initialization and shutdown now resembles ImGui.

      • SetImGuiContext
      • CreateContext
      • DestroyContext
      • GetCurrentContext
      • SetCurrentContext

    Fixes

    • Some recangle-line overlap edge casess were fixed
    • Hovering, dragging, and middle click selection bugs were fixed. Only single pins, links, and nodes can be interacted with at the same time.
    • Solved an id issue causing node selection bugs
    • Render nodes on top of links, solving https://github.com/Nelarius/imnodes/issues/56
    • Fixed https://github.com/Nelarius/imnodes/issues/55
    • Fixed https://github.com/Nelarius/imnodes/issues/54

    Breaking changes

    • Removed imnodes::IO::emulate_three_button_mouse::modifier.
    • Initialize and Shutdown removed in favor of CreateContext and DestroyContext.

    Known issues

    • Overlapping ImGui widgets can interact https://github.com/Nelarius/imnodes/issues/90
    • There are some issues with reusing ids https://github.com/Nelarius/imnodes/issues/91
    Source code(tar.gz)
    Source code(zip)
  • v0.3(Jul 13, 2020)

    Huge thanks to everyone who contributed to items in this release!

    New features

    • Links snap to pins when close
    • Added EditorContextGetPanning() to access the current panning state of the editor
    • Added static attributes for node attributes which don't have a pin, along with EndInputAttribute(), EndOutputAttribute, and EndStaticAttribute.
    • EndAttribute() was deprecated with a compiler warning.
    • Enable editor panning with a pressed modifier to better support trackpads (enable via IO::emulate_three_button_mouse)
    • Added IsEditorHovered() to better detect when the mouse is over the node editor canvas.
    • Added IsLinkDestroyed(int*) to signal to the user that the editor has deleted a link. This was added so that the user can detach an existing link from a pin.

    Three new ways of interacting with links have been added:

    • Detach link from pin by clicking and dragging (configurable via the attribute flag AttributeFlags_EnableLinkDetachWithDragClick) detach_from_pin

    • Links snap to cursor when a modifier is pressed (configurable via IO::link_detach_with_modifier_click.modifier`) snap_to_cursor

    • Links can be configured to be created when snapping to the pin, instead of when the left mouse button is released (configurable via AttributeFlags_EnableLinkCreationOnSnap) create_on_snap

    Fixes

    • Fixed #26
    • Fixed a bug in detecting when the mouse hovered near a link
    • Selecting a link deselects all selected nodes
    • Prevent interacting with the canvas when the mouse is not directly over the editor canvas
    • Prevent links from snapping to pins of the same type
    Source code(tar.gz)
    Source code(zip)
  • v0.2(Mar 2, 2020)

    New features and breaking changes

    • Breaking change: node title bars can now be fully customized as any ImGui content can now be placed between the new BeginNodeTitleBar/EndNodeTitleBar function calls. This change also removes the SetNodeName function.
    image

    Calculator icon by DinosoftLabs from Flaticon

    • Pins now come in different shapes: circle, quad, and triangle, in both filled and unfilled variants. The desired shape flag is passed as a function argument to BeginInputAttribute/BeginOutputAttribute.
    image
    • Pins can now be offset from the node, controlled by the new imnodes::Style::pin_offset value.
    image
    • Breaking change: removes StyleFlags_PinOutline and ColorStyle_PinOutline.

    • Breaking change: replaces SetNodePos with two functions: SetNodeScreenSpacePos and SetNodeGridSpacePos.

    • New editor panning utility functions: EditorContextResetPanningand EditorContextMoveToNode.

    • Added a multi-editor example! Check out example/multi_editor.cpp

    Fixes

    • Selected nodes and links are now only deselected when clicking inside the same node editor window.
    • Overlapping node UIs and backgrounds don't glitch out anymore.

    A huge thanks to everyone who contributed to imnodes!

    Source code(tar.gz)
    Source code(zip)
  • v0.1(Dec 24, 2019)

    The basic features of a node editor are now implemented:

    • Create nodes, links, and pins in an immediate-mode style
    • Use regular dear imgui widgets inside the nodes
    • Multiple node and link selection with a box selector
    • Nodes, links, and pins are fully customizable, from color style to layout
    • The editor canvas can be customized
    • Node movement and new link creation handled internally
    • The node editor state can be saved and loaded to and from a INI file
    Source code(tar.gz)
    Source code(zip)
Owner
Johann Muszynski
Logistics @woltapp. In my free time I hack on computer graphics stuff.
Johann Muszynski
A drop-in entity editor for EnTT with Dear ImGui

imgui_entt_entity_editor A drop-in, single-file entity editor for EnTT, with ImGui as graphical backend. demo-code (live) Editor Editor with Entiy-Lis

Erik Scholz 151 Jan 2, 2023
Source code for the data dependency part of Jan Kossmann's PhD thesis "Unsupervised Database Optimization: Efficient Index Selection & Data Dependency-driven Query Optimization"

Unsupervised Database Optimization: Data Dependency-Driven Query Optimization Source code for the experiments presented in Chapter 8 of Jan Kossmann's

Jan Koßmann 4 Apr 24, 2022
Simple text editor in C++ - Simple editor built upon kilo editor.

GUMBO editor Simple editor built upon kilo editor. Still big work in progress although this is just fun side project to learn more C/C++. From 0.0.2->

Filip Ivanušec 3 Sep 15, 2021
This repository uses a ROS node to subscribe to camera (hikvision) and lidar (livox) data. After the node merges the data, it publishes the colored point cloud and displays it in rviz.

fusion-lidar-camera-ROS 一、介绍 本仓库是一个ROS工作空间,其中ws_fusion_camera/src有一个工具包color_pc ws_fusion_camera │ README.md │ └───src │ └───package: c

hongyu wang 23 Dec 7, 2022
A single-file, immediate-mode sequencer widget for C++17, Dear ImGui and EnTT

A single-file, immediate-mode sequencer widget for C++17, Dear ImGui and EnTT Table of Contents Overview Features Design Decisions Todo Open Questions

Alan Jefferson 194 Dec 16, 2022
An improved plot widget for Dear ImGui, aimed at displaying audio data

imgui-plot An improved plot widget for Dear ImGui, aimed at displaying audio data TOC Screenshots Rationale Usage Installation FAQ Screenshots Display

Anton Lobashev 399 Jan 3, 2023
A dependency free, embeddable debugger for Lua in a single file (.lua or .c)

debugger.lua A simple, embedabble debugger for Lua 5.x, and LuaJIT 2.x. debugger.lua is a simple, single file, pure Lua debugger that is easy to integ

Scott Lembcke 600 Dec 31, 2022
Seam is a pin-based node editor for OpenFrameworks that makes prototyping visual systems easier and faster.

seam Seam is a pin-based node editor for openFrameworks built using: openFrameworks Dear ImGui the node editor extension for ImGui It is heavily WIP,

Austin Clifton 2 Jan 2, 2022
A simple Defold extension to get the project root dir when running from the editor

Defold Project Directory extension This is a small native extension that makes it so that you can get the project directory of a game that is being ru

Marius Petcu 2 Oct 2, 2021
api & source menu base import imgui from imgui-js

onetap v4 crack https://discord.gg/AXCtxVH4PB people asking me for otv4 source "bin2h" (meaning binary to hex) large hexadecimal array deleted all the

h4xr0x#1337 9 Sep 6, 2022
Free (libre) font editor for Windows, Mac OS X and GNU+Linux

FontForge FontForge is a free (libre) font editor for Windows, Mac OS X and GNU+Linux. Use it to create, edit and convert fonts in OpenType, TrueType,

null 5k Dec 27, 2022
Notepad++ is a free source code editor and Notepad replacement that supports several programming languages and natural languages

Npp / Notepad++ is my customized text editor highly enhanced for coding such as insta-run, much more file extensions made self-recognizable, logically colored syntax highlighting for nearly every programming language and designed for very easy customizability -- from the toolbar, context menu, syntax coloring, plug-ins for optional increased capabilities and much more

SkyN9ne 1 Jan 23, 2022
C.impl is a small portable C interpreter integrated with a line text editor

C.impl C.impl is a small portable C interpreter integrated with a line text editor, originally developed for the ELLO 1A computer: http://ello.cc The

KnivD 22 Nov 21, 2022
te is a small text editor with emacs keybindings.

te - a tiny emacs te is a small text editor with emacs keybindings. Here are söme Ümlautß! Oh no. Come, you spirits That tend on mortal thoughts, unse

Leah Neukirchen 21 Nov 5, 2022
🦘 A dependency injection container for C++11, C++14 and later

kangaru ?? Kangaru is an inversion of control container for C++11, C++14 and later. It provides many features to automate dependency injection and red

Guillaume Racicot 368 Jan 3, 2023
LuaZDF - Lua Zero Dependency Functions

LuaZDF - Lua Zero Dependency Functions LuaZDF is a collection of independet functions that have zero dependencies among themselves. A function in LuaZ

null 46 Jun 4, 2022
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.

FREE Reverse Engineering Self-Study Course HERE Hacking Windows The book and code repo for the FREE Hacking Windows book by Kevin Thomas. FREE Book Do

Kevin Thomas 1.1k Dec 27, 2022
TinyGL: a Small, Free and Fast Subset of OpenGL

TinyGL A major overhaul of Fabrice Bellard's TinyGL to be more useful as a software rasterizer. Now with limited multithreading support Tightly tweake

Jim Huang 42 Dec 30, 2022
C++11 header-only library that offers small vector, small flat map/set/multimap/multiset.

sfl library This is header-only C++11 library that offers several new containers: small_vector small_flat_set small_flat_map small_flat_multiset small

null 21 Dec 14, 2022