Created
February 18, 2015 17:43
-
-
Save trustmaster/b49965fcd4499964ecdf to your computer and use it in GitHub Desktop.
NoFlo issue #273 example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "comfreek", | |
"version": "1.0.0", | |
"description": "Test", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Vladimir Sibirov <trustmaster@kodigy.com>", | |
"license": "MIT", | |
"dependencies": { | |
"noflo": "^0.5.11", | |
"noflo-core": "^0.1.11", | |
"noflo-nodejs": "0.0.6" | |
}, | |
"noflo": { | |
"components": { | |
"Test": "Test.js" | |
}, | |
"graphs": { | |
"TestGraph": "TestGraph.json" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var noflo = require("noflo"); | |
exports.getComponent = function() { | |
var component = new noflo.Component; | |
component.description = "Test"; | |
component.inPorts.add('in', { | |
datatype: 'all', | |
addressable: true | |
}); | |
component.outPorts.add('out', {datatype: 'all'}); | |
noflo.helpers.WirePattern(component, { | |
"in": ["in"], | |
arrayPolicy: { | |
"in": "all" | |
} | |
}, function (data, groups, out) { | |
console.log("New data from 'WirePattern'"); | |
console.log(data); | |
}); | |
return component; // Return new instance | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"properties": { | |
"name": "Test", | |
"project": "comfreek", | |
"id": "comfreek/Test", | |
"environment": { | |
"type": "noflo-browser" | |
}, | |
"changed": true | |
}, | |
"inports": {}, | |
"outports": {}, | |
"groups": [], | |
"processes": { | |
"core/Repeat_3n65y": { | |
"component": "core/Repeat", | |
"metadata": { | |
"label": "core/Repeat", | |
"x": 334, | |
"y": 100, | |
"width": 72, | |
"height": 72 | |
} | |
}, | |
"core/Repeat_zxo12": { | |
"component": "core/Repeat", | |
"metadata": { | |
"label": "core/Repeat", | |
"x": 324, | |
"y": 252, | |
"width": 72, | |
"height": 72 | |
} | |
}, | |
"comfreek/Test_kb577": { | |
"component": "comfreek/Test", | |
"metadata": { | |
"label": "comfreek/Test", | |
"x": 576, | |
"y": 180, | |
"width": 72, | |
"height": 72 | |
} | |
} | |
}, | |
"connections": [ | |
{ | |
"src": { | |
"process": "core/Repeat_3n65y", | |
"port": "out" | |
}, | |
"tgt": { | |
"process": "comfreek/Test_kb577", | |
"port": "in" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"src": { | |
"process": "core/Repeat_zxo12", | |
"port": "out" | |
}, | |
"tgt": { | |
"process": "comfreek/Test_kb577", | |
"port": "in" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"data": "5", | |
"tgt": { | |
"process": "core/Repeat_3n65y", | |
"port": "in" | |
} | |
}, | |
{ | |
"data": "10", | |
"tgt": { | |
"process": "core/Repeat_zxo12", | |
"port": "in" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment