Graph Contexts

Different graph types are designed for different scenarios.

In Divooka, there are eight graph types (also called graph kinds), in three contexts and a family for defining types:

  1. Dataflow contexts: Flows, Function, Components (formerly System)
  2. Procedural contexts: Events, Routine
  3. Declarative contexts: StateMachine, Constructs
  4. Type definition: Type (formerly Struct)
Graph type Context What it is Divooka Explore Divooka Compute
Flows Dataflow A free-form canvas: values travel along wires, and a run executes the nodes marked active and everything they depend on. Create, edit, run Create, edit, run
Function Dataflow A graph other graphs call like a node, with one Input node and one Output node. Create, edit, run Create, edit, run
Components Dataflow An object defined as a dataflow: every output nothing else takes becomes a field of the object, and making one is what runs the graph. Open and run Create, edit, run
Events Procedural Callbacks an application framework calls, such as Start and an update on every frame. Create, edit, run Create, edit, run
Routine Procedural Steps in order along execution wires, with loops and branches. Create, edit, run Create, edit, run
StateMachine Declarative States joined by named transitions, each guarded by a condition. Open and run Create, edit, run
Constructs Declarative An object tree assembled from constructors and factories, with no side effects. Open and run Create, edit, run
Type Type definition A data structure of your own, with data members and Function or Routine graphs as its methods; it is not run on its own. Create, edit Create, edit

Divooka Explore creates Flows, Function, Events, Routine and Type graphs; it can open and run a document that holds Components, StateMachine or Constructs graphs, but does not offer to create them. Divooka Compute offers all eight. The editors show a graph's kind and its family above the canvas, for example Flows · dataflow. See the guides to graphs in Divooka Explore and graphs in Divooka Compute.

Older documents and pages may use the former names: System for Components, and Struct for Type (a Type can still be a Class, a Struct or a Record, chosen in its properties).

Dataflow vs Procedural Context

Comparison

Learn more:

Mixing Dataflow Context in Procedural Context

One must be very careful as to graph state when mixing dataflow nodes in procedural context, as illustrated in the below example:

Mix up

The Bigger Than computation is going to be evaluated twice: once per Repeat node, the other per Branch node. This is not standardized behavior and generally produces "undetermined" results.

Declarative Contexts

In a declarative graph the nodes describe something rather than computing it step by step. A StateMachine joins states by named transitions, each guarded by a condition: each state's behaviour is a graph of its own, and a run enters the first state, runs it, and takes the first transition whose condition holds. A Constructs graph is an object tree assembled from constructors and factories, with no side effects; it is a description other graphs read. Learn more: Declarative Contexts.

Modules

Module defines member data and member behaviors. In Divooka, each graph (no matter which type/context) is actually a module.

Types

The dedicated Type graph allows defining your own data type: its data members, and Function or Routine graphs as its methods. Other graphs make an instance of it with its Make node and read and set its members. A Type is not run on its own; use Function and Routine graphs for logic.