jsongraph
Version:
powerful minimalist graph/dataflow programming based on jsonschema references (nodejs/coffeescript)
48 lines (39 loc) • 682 B
JavaScript
// Generated by CoffeeScript 1.9.3
(function() {
var graph, jg, json, path;
jg = require('jsongraph');
path = [];
json = {
graph: {
a: {
"$ref": [
{
"$ref": "#/graph/b"
}
]
},
b: {
"$ref": [
{
"$ref": "#/graph/a"
}
]
},
c: {
"$ref": [
{
"$ref": "#/graph/a"
}
]
}
}
};
jg.filters.global.rememberpath = function(node, data) {
return path.push(node.name);
};
graph = jg.init(json);
graph.run('b', {
foo: "bar"
});
console.log(path.join('->'));
}).call(this);