jsongraph
Version:
powerful minimalist graph/dataflow programming based on jsonschema references (nodejs/coffeescript)
24 lines (17 loc) • 388 B
text/coffeescript
jg = require 'jsongraph'
path = []
# create the graph: a<->b<-c
json =
graph:
a:
"$ref": [{"$ref": "#/graph/b"}]
b:
"$ref": [{"$ref": "#/graph/a"}]
c:
"$ref": [{"$ref": "#/graph/a"}]
# push global filter
jg.filters.global.rememberpath = (node,data) ->
path.push node.name
graph = jg.init json
graph.run 'b', {foo:"bar"}
console.log path.join '->'