Skip to content

Instantly share code, notes, and snippets.

@jskrzypek
Last active Feb 17, 2016
Embed
What would you like to do?
# In the graph we first need to define the nodes and the connections between them
Group(core/Group) OUT -> IN FilesystemConnection(server/FilesystemConnection)
FilesystemConnection() CONNECTION -> CONNECTION CsvSource(server/CsvSource)
CsvSource() OUT -> IN Display(core/Output)
Group2(core/Group) OUT -> IN FilesystemConnection2(server/FilesystemConnection)
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2(server/CsvSource)
CsvSource2() OUT -> IN Display2(core/Output)
# Start off the graph by sending a filename to the file reader
'NUCLEAR' -> GROUP Group()
'NODAL' -> GROUP Group2()
'samples/tables/nuclear.csv' -> IN Group()
'samples/tables/nodal.csv' -> IN Group2()
'use strict';
var noflo = require('noflo');
var _ = require('lodash');
var csv = require('fast-csv');
exports.getComponent = function() {
var c = new noflo.Component();
c.description = 'Readfile using wire pattern';
c.inPorts.add('connection', {
datatype: 'object',
description: 'Source file connection'
});
c.outPorts.add('out', {
datatype: 'object'
});
c.outPorts.add('error', {
datatype: 'object'
});
var readCsv = function(stream, onData, onEnd) {
return csv.fromStream(stream, {
headers: true,
delimiter: ',',
ignoreEmpty: true,
trim: true
})
.on('data', onData)
.on('end', onEnd);
};
noflo.helpers.WirePattern(c, {
'in': ['connection'],
out: 'out',
async: false,
error: 'error',
forwardGroups: false
}, function(connection, groups, out) {
_.each(groups, function(group) {
out.beginGroup(group);
});
readCsv(connection, function onData(row) {
out.send(row);
}, function onEnd(row) {
_.each(groups, function(group) {
out.endGroup(group);
});
});
});
return c;
};
DATA -> ENCODING FilesystemConnection() CONN
DATA -> ENCODING FilesystemConnection() DATA
DATA -> ENCODING FilesystemConnection() DISC
DATA -> ENCODING FilesystemConnection2() CONN
DATA -> ENCODING FilesystemConnection2() DATA
DATA -> ENCODING FilesystemConnection2() DISC
DATA -> GROUP Group() CONN
DATA -> GROUP Group() DATA
DATA -> GROUP Group() DISC
DATA -> GROUP Group2() CONN
DATA -> GROUP Group2() DATA
DATA -> GROUP Group2() DISC
DATA -> IN Group() CONN
Group() OUT -> IN FilesystemConnection() CONN
Group() OUT -> IN FilesystemConnection() < NUCLEAR
DATA -> IN Group() DATA
Group() OUT -> IN FilesystemConnection() DATA
DATA -> IN Group() DISC
Group() OUT -> IN FilesystemConnection() > NUCLEAR
Group() OUT -> IN FilesystemConnection() DISC
DATA -> IN Group2() CONN
Group2() OUT -> IN FilesystemConnection2() CONN
Group2() OUT -> IN FilesystemConnection2() < NODAL
DATA -> IN Group2() DATA
Group2() OUT -> IN FilesystemConnection2() DATA
DATA -> IN Group2() DISC
Group2() OUT -> IN FilesystemConnection2() > NODAL
Group2() OUT -> IN FilesystemConnection2() DISC
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() CONN
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() < NUCLEAR
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() < samples/tables/nuclear.csv
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() DATA
CsvSource() OUT -> IN Display() CONN
CsvSource() OUT -> IN Display() < NUCLEAR
CsvSource() OUT -> IN Display() < samples/tables/nuclear.csv
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() > samples/tables/nuclear.csv
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() > NUCLEAR
FilesystemConnection() CONNECTION -> CONNECTION CsvSource() DISC
CsvSource() OUT -> IN Display() DISC
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() CONN
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() < NODAL
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() < samples/tables/nodal.csv
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() DATA
CsvSource2() OUT -> IN Display2() CONN
CsvSource2() OUT -> IN Display2() < NODAL
CsvSource2() OUT -> IN Display2() < samples/tables/nodal.csv
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() > samples/tables/nodal.csv
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() > NODAL
FilesystemConnection2() CONNECTION -> CONNECTION CsvSource2() DISC
CsvSource2() OUT -> IN Display2() DISC
CsvSource() OUT -> IN Display() CONN
CsvSource() OUT -> IN Display() DATA
{ '': '1',
cost: '460.05',
date: '68.58',
t1: '14',
t2: '46',
cap: '687',
pr: '0',
ne: '1',
ct: '0',
bw: '0',
'cum.n': '14',
pt: '0' }
CsvSource2() OUT -> IN Display2() CONN
CsvSource2() OUT -> IN Display2() DATA
{ '': '1',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '2',
cost: '452.99',
date: '67.33',
t1: '10',
t2: '73',
cap: '1065',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '1',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '3',
cost: '443.22',
date: '67.33',
t1: '10',
t2: '85',
cap: '1065',
pr: '1',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '1',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '4',
cost: '652.32',
date: '68',
t1: '11',
t2: '67',
cap: '1065',
pr: '0',
ne: '1',
ct: '1',
bw: '0',
'cum.n': '12',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '5',
cost: '642.23',
date: '68',
t1: '11',
t2: '78',
cap: '1065',
pr: '1',
ne: '1',
ct: '1',
bw: '0',
'cum.n': '12',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '6',
cost: '345.39',
date: '67.92',
t1: '13',
t2: '51',
cap: '514',
pr: '0',
ne: '1',
ct: '1',
bw: '0',
'cum.n': '3',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '7',
cost: '272.37',
date: '68.17',
t1: '12',
t2: '50',
cap: '822',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '5',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '8',
cost: '317.21',
date: '68.42',
t1: '14',
t2: '59',
cap: '457',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '1',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '9',
cost: '457.12',
date: '68.42',
t1: '15',
t2: '55',
cap: '822',
pr: '1',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '5',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '10',
cost: '690.19',
date: '68.33',
t1: '12',
t2: '71',
cap: '792',
pr: '0',
ne: '1',
ct: '1',
bw: '1',
'cum.n': '2',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '11',
cost: '350.63',
date: '68.58',
t1: '12',
t2: '64',
cap: '560',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '3',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '12',
cost: '402.59',
date: '68.75',
t1: '13',
t2: '47',
cap: '790',
pr: '0',
ne: '1',
ct: '0',
bw: '0',
'cum.n': '6',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '13',
cost: '412.18',
date: '68.42',
t1: '15',
t2: '62',
cap: '530',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '2',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '14',
cost: '495.58',
date: '68.92',
t1: '17',
t2: '52',
cap: '1050',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '7',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '15',
cost: '394.36',
date: '68.92',
t1: '13',
t2: '65',
cap: '850',
pr: '0',
ne: '0',
ct: '0',
bw: '1',
'cum.n': '16',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '16',
cost: '423.32',
date: '68.42',
t1: '11',
t2: '67',
cap: '778',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '3',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '17',
cost: '712.27',
date: '69.5',
t1: '18',
t2: '60',
cap: '845',
pr: '0',
ne: '1',
ct: '0',
bw: '0',
'cum.n': '17',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '18',
cost: '289.66',
date: '68.42',
t1: '15',
t2: '76',
cap: '530',
pr: '1',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '2',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '19',
cost: '881.24',
date: '69.17',
t1: '15',
t2: '67',
cap: '1090',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '1',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '20',
cost: '490.88',
date: '68.92',
t1: '16',
t2: '59',
cap: '1050',
pr: '1',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '8',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '21',
cost: '567.79',
date: '68.75',
t1: '11',
t2: '70',
cap: '913',
pr: '0',
ne: '0',
ct: '1',
bw: '1',
'cum.n': '15',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '22',
cost: '665.99',
date: '70.92',
t1: '22',
t2: '57',
cap: '828',
pr: '1',
ne: '1',
ct: '0',
bw: '0',
'cum.n': '20',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '23',
cost: '621.45',
date: '69.67',
t1: '16',
t2: '59',
cap: '786',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '18',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '24',
cost: '608.8',
date: '70.08',
t1: '19',
t2: '58',
cap: '821',
pr: '1',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '3',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '25',
cost: '473.64',
date: '70.42',
t1: '19',
t2: '44',
cap: '538',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '19',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '26',
cost: '697.14',
date: '71.08',
t1: '20',
t2: '57',
cap: '1130',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '21',
pt: '0' }
CsvSource() OUT -> IN Display() DATA
{ '': '27',
cost: '207.51',
date: '67.25',
t1: '13',
t2: '63',
cap: '745',
pr: '0',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '8',
pt: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '28',
cost: '288.48',
date: '67.17',
t1: '9',
t2: '48',
cap: '821',
pr: '0',
ne: '0',
ct: '1',
bw: '0',
'cum.n': '7',
pt: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '29',
cost: '284.88',
date: '67.83',
t1: '12',
t2: '63',
cap: '886',
pr: '0',
ne: '0',
ct: '0',
bw: '1',
'cum.n': '11',
pt: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '30',
cost: '280.36',
date: '67.83',
t1: '12',
t2: '71',
cap: '886',
pr: '1',
ne: '0',
ct: '0',
bw: '1',
'cum.n': '11',
pt: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '31',
cost: '217.38',
date: '67.25',
t1: '13',
t2: '72',
cap: '745',
pr: '1',
ne: '0',
ct: '0',
bw: '0',
'cum.n': '8',
pt: '1' }
CsvSource() OUT -> IN Display() DATA
{ '': '32',
cost: '270.71',
date: '67.83',
t1: '7',
t2: '80',
cap: '886',
pr: '1',
ne: '0',
ct: '0',
bw: '1',
'cum.n': '11',
pt: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '2',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '3',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '4',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '5',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '6',
m: '1',
r: '0',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '7',
m: '1',
r: '1',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '8',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '9',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '10',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '11',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '12',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '13',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '14',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '15',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '16',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '17',
m: '1',
r: '1',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '18',
m: '1',
r: '1',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '19',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '20',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '21',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '22',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '23',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '24',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '25',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '26',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '27',
m: '1',
r: '0',
aged: '0',
stage: '1',
grade: '1',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '28',
m: '1',
r: '1',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '29',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '30',
m: '1',
r: '0',
aged: '1',
stage: '1',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '31',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '32',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '33',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '34',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '35',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '36',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '37',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '1',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '38',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '0',
xray: '1',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '39',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '40',
m: '1',
r: '0',
aged: '0',
stage: '1',
grade: '0',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '41',
m: '1',
r: '1',
aged: '0',
stage: '0',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '42',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '43',
m: '1',
r: '1',
aged: '1',
stage: '1',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '44',
m: '1',
r: '1',
aged: '1',
stage: '1',
grade: '0',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '45',
m: '1',
r: '1',
aged: '1',
stage: '0',
grade: '1',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '46',
m: '1',
r: '1',
aged: '1',
stage: '0',
grade: '0',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '47',
m: '1',
r: '0',
aged: '1',
stage: '0',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '48',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '1',
xray: '1',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '49',
m: '1',
r: '0',
aged: '0',
stage: '1',
grade: '1',
xray: '0',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '50',
m: '1',
r: '1',
aged: '0',
stage: '1',
grade: '0',
xray: '1',
acid: '0' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '51',
m: '1',
r: '1',
aged: '0',
stage: '0',
grade: '1',
xray: '0',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '52',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '1',
acid: '1' }
CsvSource2() OUT -> IN Display2() DATA
{ '': '53',
m: '1',
r: '0',
aged: '0',
stage: '0',
grade: '0',
xray: '1',
acid: '0' }
CsvSource() OUT -> IN Display() > samples/tables/nuclear.csv
CsvSource() OUT -> IN Display() > NUCLEAR
CsvSource2() OUT -> IN Display2() > samples/tables/nodal.csv
CsvSource2() OUT -> IN Display2() > NODAL
'use strict';
var noflo = require('noflo');
var fs = require('fs');
var DEFAULT_ENCODING = 'utf-8';
exports.getComponent = function() {
var c = new noflo.Component();
c.state = {
encoding: DEFAULT_ENCODING
};
c.description = 'Readfile using wire pattern';
c.inPorts.add('in', {
datatype: 'string',
description: 'Source file path'
});
c.inPorts.add('encoding', {
datatype: 'string',
description: 'File encoding',
default: DEFAULT_ENCODING
});
c.outPorts.add('connection', {
datatype: 'object'
});
c.outPorts.add('error', {
datatype: 'object'
});
// TODO: issue with defaulted (non required) params in wirepattern not being available in the process function
c.inPorts.encoding.on('data', function(value) {
c.state.encoding = value;
});
noflo.helpers.WirePattern(c, {
'in': ['in'],
out: 'connection',
error: 'error',
async: true,
forwardGroups: true
}, function(path, groups, out, callback) {
var connection = fs.createReadStream(path, c.state);
connection.once('error', function (err) {
c.fail(err, [path]);
});
connection.on('open', function () {
out.beginGroup(path);
out.send(connection);
out.endGroup();
callback();
});
});
return c;
};
m r aged stage grade xray acid
1 1 1 0 1 1 1 1
2 1 1 0 1 1 1 1
3 1 1 0 1 1 1 1
4 1 1 0 1 1 1 1
5 1 1 0 1 1 1 1
6 1 0 0 1 1 1 1
7 1 1 0 0 0 0 1
8 1 0 0 0 0 0 1
9 1 0 0 0 0 0 1
10 1 0 0 0 0 0 1
11 1 0 0 0 0 0 1
12 1 0 0 0 0 0 1
13 1 0 1 1 1 0 0
14 1 0 1 1 1 0 0
15 1 0 1 1 1 0 0
16 1 0 1 1 1 0 0
17 1 1 1 1 0 0 1
18 1 1 1 1 0 0 1
19 1 0 1 1 0 0 1
20 1 0 1 1 0 0 1
21 1 0 0 0 0 0 0
22 1 0 0 0 0 0 0
23 1 0 0 0 0 0 0
24 1 0 0 0 0 0 0
25 1 1 0 1 1 0 1
26 1 1 0 1 1 0 1
27 1 0 0 1 1 0 1
28 1 1 1 1 0 0 0
29 1 0 1 1 0 0 0
30 1 0 1 1 0 0 0
31 1 0 1 0 0 0 1
32 1 0 1 0 0 0 1
33 1 0 1 0 0 0 1
34 1 0 1 0 0 0 0
35 1 0 1 0 0 0 0
36 1 0 1 0 0 0 0
37 1 0 1 0 0 1 0
38 1 0 1 0 0 1 0
39 1 1 0 1 0 0 1
40 1 0 0 1 0 0 1
41 1 1 0 0 1 0 0
42 1 0 0 0 1 0 0
43 1 1 1 1 1 1 1
44 1 1 1 1 0 1 1
45 1 1 1 0 1 1 1
46 1 1 1 0 0 1 1
47 1 0 1 0 1 0 0
48 1 1 0 1 1 1 0
49 1 0 0 1 1 0 0
50 1 1 0 1 0 1 0
51 1 1 0 0 1 0 1
52 1 0 0 0 0 1 1
53 1 0 0 0 0 1 0
cost date t1 t2 cap pr ne ct bw cum.n pt
1 460.05 68.58 14 46 687 0 1 0 0 14 0
2 452.99 67.33 10 73 1065 0 0 1 0 1 0
3 443.22 67.33 10 85 1065 1 0 1 0 1 0
4 652.32 68 11 67 1065 0 1 1 0 12 0
5 642.23 68 11 78 1065 1 1 1 0 12 0
6 345.39 67.92 13 51 514 0 1 1 0 3 0
7 272.37 68.17 12 50 822 0 0 0 0 5 0
8 317.21 68.42 14 59 457 0 0 0 0 1 0
9 457.12 68.42 15 55 822 1 0 0 0 5 0
10 690.19 68.33 12 71 792 0 1 1 1 2 0
11 350.63 68.58 12 64 560 0 0 0 0 3 0
12 402.59 68.75 13 47 790 0 1 0 0 6 0
13 412.18 68.42 15 62 530 0 0 1 0 2 0
14 495.58 68.92 17 52 1050 0 0 0 0 7 0
15 394.36 68.92 13 65 850 0 0 0 1 16 0
16 423.32 68.42 11 67 778 0 0 0 0 3 0
17 712.27 69.5 18 60 845 0 1 0 0 17 0
18 289.66 68.42 15 76 530 1 0 1 0 2 0
19 881.24 69.17 15 67 1090 0 0 0 0 1 0
20 490.88 68.92 16 59 1050 1 0 0 0 8 0
21 567.79 68.75 11 70 913 0 0 1 1 15 0
22 665.99 70.92 22 57 828 1 1 0 0 20 0
23 621.45 69.67 16 59 786 0 0 1 0 18 0
24 608.8 70.08 19 58 821 1 0 0 0 3 0
25 473.64 70.42 19 44 538 0 0 1 0 19 0
26 697.14 71.08 20 57 1130 0 0 1 0 21 0
27 207.51 67.25 13 63 745 0 0 0 0 8 1
28 288.48 67.17 9 48 821 0 0 1 0 7 1
29 284.88 67.83 12 63 886 0 0 0 1 11 1
30 280.36 67.83 12 71 886 1 0 0 1 11 1
31 217.38 67.25 13 72 745 1 0 0 0 8 1
32 270.71 67.83 7 80 886 1 0 0 1 11 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment