a node-able bidirectionnal expression editor.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Nodable Logo

Build Status

Nodable is node-able !

Introduction:

This software is a node-able bidirectionnal expression editor. More precisely, it means Text-to-Node and Node-to-Text seamless edition. When user type an expression in the Text Editor the program split it into tokens and build the corresponding graph and displays it in the Graph Editor.

User can modify an expression by editing both text and graph. When the text is modified, the graph is updated, when the graph is modified the text could be updated manually. You can also edit a portion of an expression by selecting it like in any text editor.

Examples :

An expression example :

Example1

Video n°1 - a first demo :

Watch on Youtube

Video n°2 - Automatic Layout :

Watch on Youtube

Vidéo n°3 - First Talk about Nodable : Past, present and future : Watch on Youtube

The language :

Introduction:

The syntax used is really simple and works quite like a calculator.

Operands :

An operand could be :

  • a Boolean (ex: true, false)
  • a Number (ex: 1, 0.5, 100.456, etc.)
  • a String (ex: "Hello", "World", etc.)
  • a Symbol (ex: a, b, myVar, etc.)

Operand -> { Boolean , Number , String , Symbol }

Operators:

An operator could be only a binary operator :

  • an Addition
  • a Substraction
  • a Multiplication
  • a Division
  • an Assignment

Binary Operator -> { + , - , * , / , = }

All these binary operators supports precedence.

Expressions:

An expression could be :

  • a single Operand
  • a tuple formed by an Operand, a Binary Operator and an other Expression.

Expression -> { Operand , ( Operand , Binary Operator , Expression ) }

Unary operands are not allowed, so you can't evaluate expressions like

Expression -> { ( Unary Operator, Expression ) } (ex -10)

Platform compatibility :

Should work on all platforms but only tested under GNU/Linux Ubuntu 16.04 LTS (64bits)

How to compile ? :

To compile you need a c++ 11 compatible compiler. The make file provided is configured to use g++.

Install dependencies:

sudo apt-get install -y --no-install-recommends libsdl2-dev gcc-4.8 g++-4.8 libglfw3-dev

Clone the project with submodules:

git clone --recurse-submodules https://github.com/berdal84/Nodable

Move to the new folder:

cd ./Nodable

Compile:

make

How to run the software ? :

Install dependencies:

sudo apt-get install -y --no-install-recommends libsdl2 libglfw3

Clone the project with submodules:

git clone --recurse-submodules https://github.com/berdal84/Nodable

Move to the bin folder:

cd <nodable folder>/bin/Linux64

Run the software:

./nodable

Architecture :

The software is built to be dynamically reflective. The base class Object has members called Values. Members can be added or removed at runtime. A Value is a Variant class that can handle basic data types such as Booleans (bool), Numbers (double) or Strings (std::string).

Two Values can be linked by a Wire. A Wire is an oriented edge, so it has a source and a target Value.

The derived class Entity is an Object able to attach Components on it. Component is the abstract base class for all components. For now there are only few components :

  • Views : to draw the entity on screen.
  • Operations : to perform a computation.
  • Container : to instantiate and contain other entities (Factory and Container).
  • DataAccessObject : auto-save to JSON when the entity is modified.

Variable class is an Entity with a single member named "value".

Lexer class is an Entity able to convert an expression to a graph.

Application is a class to rule them all.

Draft UML Class Diagram

Road Map :

  • Update the expression when the user modify the graph.
  • Manual graph creation with mouse and keyboard (add/remove wire, add/remove node)
  • Conditionnal statement parsing (if, then, else, else if).
  • Iterative statement parsing (for, while).
  • Function parsing (symbol and in/out parameters).
  • Run-time execution of a full code.

Change Log:

  • 2018-06-12 : Added a Fullscreen ON/OFF item in View menu.
  • 2018-06-11 : Graph-to-Text works. Right-click on Graph View's background then select "Update Expression".
  • 2018-05-?? : First version with a GUI (using Dear ImGui).
  • 2017-10-01 : First version (command line only).

Dependencies / Credits :

Licence:

Nodable is licensed under the GPL License, see LICENSE for more information.

Each submodule are licensed, browse /extern folder.