jsongraph
Version:
powerful minimalist graph/dataflow programming based on jsonschema references (nodejs/coffeescript)
20 lines (15 loc) • 343 B
text/coffeescript
jg = require 'jsongraph'
# create the graph: b<->a<-c<-d
json =
graph:
a:
"$ref": [{"$ref": "#/graph/b"}]
b:
"$ref": [{"$ref": "#/graph/a"},{"$ref":"#/graph/c"}]
c:
"$ref": [{"$ref": "#/graph/a"}]
jg.opts.verbose = 2
graph = jg.init json
graph.run 'b', {foo:"bar"}
console.dir jg.graph
#graph.jsonschema()