GithubHelp home page GithubHelp logo

jwk000 / nged Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hugeproblem/nged

0.0 0.0 0.0 5.76 MB

A Node Graph EDitor

License: Apache License 2.0

C++ 89.72% Scheme 3.61% Python 3.99% C 2.24% Lua 0.43%

nged's Introduction

NGED: A Node Graph EDitor

This is the result of my attempt to make an easy to use, myself-friendly node graph editor.

Core components of this project are ngdoc.h (node graph document) and nged.h (node graph editor), and with this project comes with two demos, which in hope will give you some basic ideas of what they can do - if you are also looking for a node graph editor that is standalone, customizable, scriptable, efficient, beautiful, ergonomic and cross-platform.

  • visual s7 is lisp visualized in form of node graph, it looks like this: ngs7

  • pydemo is a functional python scripting environment, it looks like this: pydemo

What they share in common is the beautiful UI and friendly operations.

Features

Cross platform

Tested on:

  • Windows 10 x64
  • Windows 11 x64
  • Ubuntu 22 x64
  • Raspberry Pi OS Arm

Nice looking link paths

linkpath

dense or sparse, it's easy to keep track on the relationship of nodes and links:

path-eg1

path-eg2

Fuzzy search

fuzzy-search

Routers

router

Groups, Comments, Arrows and Tints

comment_and_tint

Subgraphs

subgraph

Multiple views on one graph

multiview

Focus

focus

// press F to focus selection; or with nothing selected, press F to focus the entire graph

Cut links with stroke

cut

// press Y to cut links

Drag links, Swap links

edit_link

// drag link with Shift pressed, the link will be swaped if the drop target has existing link

Find node

find_node

Select, add to selection, remove from selection

selection

Command palette

valign

Recursion (only for python demo)

recursion

Parmscript (only for python demo)

It's worth mention this other side project of mine: parmscript

With this, it's very easy to customize parameter interface on each node, and it can handle serialization / deserialization / evaluate to & from Python with no extra effort.

parmscript

Other

  • Undo, Redo
  • Copy, Paste
  • Read-only view
  • Headless (doc without UI and editor is fully functional)

Limits

  • One input pin can connect to at most one output pin. And I think this is the correct way - if you do want to connect multiple links into one input, you should always declare the logic between those multiple inputs, like or, and, merge &etc. - and by adding another node, this can be done.

Building

Requirements:

  • xmake
  • A C++17 compatible compiler, tested on
    • MSVC 2017
    • MSVC 2019
    • Clang 14
    • GCC 11.4
  • python & setuptools & pip, if you need the python binding and/or the pydemo

To build:

> xmake

to build with python:

> python setup.py build

or

> python -m pip install .

Options:

Graphic backend can be choosen between

  • DirectX 11 (default for windows)
  • DirectX 12
  • OpenGL 3
  • OpenGL 2 (default for non-windows)
  • Vulkan

to config:

> xmake f --backend=(dx11|dx12|gl3|gl2|vulkan)

Development

If you want to dive into the code, and/or make contribution, it's strongly adviced to use (neo|g)?vim editor with foldmethod=marker and foldmarker={{{,}}} set, otherwise the code look will likely to be not as tidy:

gvim

and please respect .editorconfig and .clang-format

tips: xmake project -k compile_commands can generate compile_commands.json for C++ LSPs.

To Make Your Own NodeGraph

Refer to demo/main.cpp as the starting point.

Basically, define your own NodeFactory, and off you go.

nged's People

Contributors

hugeproblem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.