dear-node-editor
Safe Rust bindings for imgui-node-editor through the
cimnodes_editor wrapper and a repository-owned C ABI
shim.
This crate coexists with dear-imnodes:
dear-imnodeswraps ImNodes and is the current wasm-capable node editor path.dear-node-editorwraps imgui-node-editor and is native-only in the first integration phase.
The native-only scope is a workspace integration boundary, not a claim that the upstream C++ library can never run on WebAssembly. This repository's WASM path uses an import-style provider module with explicit generated exports; node editor support needs its own provider wiring before it can be exposed safely on wasm.
The sys layer deliberately exposes NodeId, PinId, and LinkId as pointer-sized integer values
instead of upstream C++ helper pointers. The safe layer wraps those values as Rust newtypes and uses
RAII tokens for editor frames, nodes, pins, create/delete sessions, shortcuts, and style pushes.
Upstream Relationship
This crate is a safe Rust layer over:
The node_editor_showcase example follows the upstream blueprints example
structure and uses the same style of stack layout calls (BeginHorizontal,
BeginVertical, and Spring) through dear-imgui-rs safe wrappers. Those
stack layout helpers are compatibility APIs implemented by dear-imgui-sys;
they are not official Dear ImGui APIs.
The vendored native imgui-node-editor sources are MIT-licensed. See
extensions/dear-node-editor-sys/third-party/cimnodes_editor/imgui-node-editor/LICENSE
in the repository and dear-imgui-sys/THIRD_PARTY_NOTICES.md for the stack
layout compatibility notice.
Compatibility
| Item | Version |
|---|---|
| Crate | 0.15.0 |
| dear-imgui-rs | 0.15.0 |
| dear-node-editor-sys | 0.15.0 |
Quick Start
use ;
If an application stores dear_imgui_rs::Context and EditorContext in the same owner struct,
declare EditorContext before the ImGui context so the editor is dropped first. Native
imgui-node-editor state is tied to the owning ImGui context.
The creation configuration is queryable through EditorContext::config():
The lower-level RAII tokens are still available when manual scoping is clearer:
Run the repository examples:
# Minimal interaction sample based on upstream basic-interaction-example.
# Blueprint-style showcase based on upstream blueprints-example.