Daggerlib.js
Daggerlib.js achieves a Coffman-Graham style directed acycled graph via a resursive set reduction algorithm. This allows for grouping the topological ordering of nodes into layers of ordinals instead of discrete ordinals. With layered ordinals, you can perform optimized parallel scheduling of tasks, render Sugiyama-style layered graphs, etc.
'use strict'const Dagger = ; // We'll create a node that has one input pin and one output pinDaggerNode { super; // Create an input pin. We want it to be autoclone. DaggerInputPins can only have a single // connection. When an input pin is connected, and it is marked as autoclone, it will automatically // generate and add a new pin to it's input pin collection. We'll allow the pin to have a max of 4 clones. let inputPin = ; inputPin; this; // Create an output pin. We want it to allow multiple connections. A DaggerOutputPin can have unlimited // connections to input pins. let outputPin = ; outputPinallowMultiConnect = true; this; } // create a DaggerGraph and add 4 nodes to itlet graph = ;let n1 = ; n1name = "node 1"; graph;let n2 = ; n2name = "node 2"; graph;let n3 = ; n3name = "node 3"; graph;let n4 = ; n4name = "node 4"; graph; // connect output pin 0 of node 1 to first unconnected input put of node 2n1allPins0; // connect output pin 0 of node 2 to first unconnected input put of node 4n2allPins0; // connect output pin 0 of node 1 to first unconnected input put of node 3n1allPins0; // connect output pin 0 of node 3 to first unconnected input put of node 4n3allPins0; console;