Skip to content

specify array port index in edge #128

Closed
forresto opened this Issue Jan 11, 2014 · 8 comments

3 participants

@forresto
NoFlo member

To show ArrayPorts in the UI (the-grid/the-graph#51) it would be helpful if the index were defined in the edge. Is there a way to do this in FBP?

{
  "src": {
    "process": "SplitOne",
    "port": "out",
    "index": 0
  },
  "tgt": {
    "process": "Thing",
    "port": "in"
  }
}

Otherwise, the only way to find its index is by the order of the edges, which seems fragile. And the only way to know if it is an ArrayPort (#90) is by waiting for the component def from the library.

@alfa256
alfa256 commented Jan 11, 2014

Example from the book:

    Read(THFILERD) OUT ->
      IN Count(THCOUNT) OUT -> 
        IN [0] Concatenate(THMERGE) OUT ->
          IN Print(THVIEW),
    Count COUNT -> IN[1] Concatenate,
   'data.fil' -> OPT Read;

It uses IN [0] , and OUT [0] would be the obvious choice.

@forresto forresto added the ui-related label Feb 7, 2014
@bergie bergie referenced this issue in flowbased/fbp Feb 7, 2014
Closed

Allow addressing ArrayPorts #15

@bergie
NoFlo member
bergie commented Feb 7, 2014

This needs a compatibility fallback, i.e. setting index based on order edges are specified when loading the JSON specification if no index is provided there.

@bergie
NoFlo member
bergie commented Feb 7, 2014

This is also connected with the UI-side of things: noflo/noflo-ui#14

@bergie
NoFlo member
bergie commented Feb 18, 2014

I think this won't be safe to do with the old-style ArrayPort, but should work with the new isAddressable() ports from #136

@forresto
NoFlo member

I want to bump this up for https://github.com/automata/noflo-canvas/issues/1 (scratch own itch prioritization).

I guess we need a Graph method to change index? Should it be a property on the edge (not metadata, since it changes how the graph works)? Should it also sort the edges, for compatibility and legibility?

@forresto
NoFlo member

@bergie could you prioritize this in noflo so I can make it happen in the-graph?

Also, is there a way that I can query noflo if a port is addressable? I guess with if edge.src.index? I could infer it, but it would be nice to get before any edges are added.

@bergie
NoFlo member
bergie commented Apr 25, 2014

@alfa256 I just added array port index support into the FBP parser:

SomeNode OUT -> IN[2] OtherNode
@bergie bergie added a commit to noflo/noflo-runtime-base that referenced this issue Apr 25, 2014
@bergie bergie Initial indexed connection support, refs noflo/noflo#128 2223326
@bergie
NoFlo member
bergie commented Apr 25, 2014

@forresto ok, initial support is now in. Would you like to experiment with how that would connect with the UI?

@bergie bergie added a commit to noflo/noflo-runtime-iframe that referenced this issue Apr 25, 2014
@bergie bergie Add some edge indexes to the tests, refs noflo/noflo#128 6b103c8
@bergie bergie added a commit to noflo/noflo.github.io that referenced this issue Apr 25, 2014
@bergie bergie Tentative connection index support in protocol, refs noflo/noflo#128 59a098f
@bergie bergie closed this May 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.