Graph Contexts

Different graph types are designed for different scenarios.

In Divooka, there are nine graph types (also called graph kinds), in three contexts, a family for defining types, and a family of special kinds that are still experimental:

  1. Dataflow contexts: Flows, Function
  2. Procedural contexts: Events, Routine
  3. Declarative contexts: Components (formerly System)
  4. Type definition: Type (formerly Struct)
  5. Special (experimental): StateMachine, Constructs, Workflow
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
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
Components Declarative An object described by what it assembles: every output nothing else takes becomes a field of the object, and making one is what runs the graph. Create, edit, 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
StateMachine Special (experimental) States joined by named transitions, each guarded by a condition. Open and run Create, edit, run
Constructs Special (experimental) An object tree assembled from constructors, factories, builders and values alone; a node of any other kind is marked and warned about, and still runs. Open and run Create, edit, run
Workflow Special (experimental) A long-running process as steps, each computing something or waiting for an answer, a time or a signal, saved at every step. - Create, edit, run

Divooka Explore creates Flows, Function, Events, Routine, Components and Type graphs; it can open and run a document that holds StateMachine or Constructs graphs, but does not offer to create them. Divooka Compute offers all nine, and is the only one that offers Workflow graphs. 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 Components graph describes an object by what it assembles: every output nothing else takes becomes a field of the object, and making one - from another graph - is what runs the graph. Learn more: Declarative Contexts.

Two of the special, experimental kinds describe things too. 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, factories, builders and values alone - a description other graphs read. A factory makes something new; a builder takes an object and answers it changed, as Add Class does to an HTML element or Style Layer to a chart layer; and the values are those a person writes down, the constants a package names, and the choices between values - Choose Value, Switch Value and Select Output. Which tools those are is decided tool by tool: a node that computes or acts is not offered on a Constructs graph, and one a document already holds there is marked on the canvas and warned about, and still runs.

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.