noflo-ui icon indicating copy to clipboard operation
noflo-ui copied to clipboard

are IIPs supported for ArrayPorts?

Open akonsu opened this issue 10 years ago • 2 comments

I have created a graph in the graph editor that includes a component with an ArrayPort. The port's event handler for the data event outputs its parameters to console (please see the code below).

I then set an IIP on this port, and run the graph. After that, I change the IIP and run the graph again.

Every time I change the IIP, the output from the handler shows a different index. The first time it is 0, then 1 etc.

Is this by design? Is there a way to set an IIP for index 0 only?

this.addArrayInPort('in', {
  required: true,
  addressable: true,
  datatype: 'all'
});

this.inPorts.in.on('data', function (data, index) {
  console.log(data, index);
});

akonsu avatar Jan 20 '15 17:01 akonsu

@akonsu noflo-ui isn't unfortunately yet aware of arrayports in a proper way. See #14 and the-grid/the-graph#51

bergie avatar Jan 20 '15 17:01 bergie

The workaround for this with current noflo-ui is to use a set of other components (for example, core/Repeat) and edit IIP in those, and forward to correct index of the addressable inport. Like this:

screenshot 2017-03-22 at 11 08 42

bergie avatar Mar 22 '17 10:03 bergie