Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify array port index in edge #128

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

specify array port index in edge #128

forresto opened this issue Jan 11, 2014 · 8 comments
Labels

Comments

@forresto
Copy link
Member

@forresto forresto commented Jan 11, 2014

To show ArrayPorts in the UI (flowhub/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
Copy link

@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.

@bergie
Copy link
Member

@bergie 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
Copy link
Member

@bergie bergie commented Feb 7, 2014

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

@bergie
Copy link
Member

@bergie 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
Copy link
Member Author

@forresto forresto commented Apr 11, 2014

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
Copy link
Member Author

@forresto forresto commented Apr 25, 2014

@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
Copy link
Member

@bergie bergie commented Apr 25, 2014

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

SomeNode OUT -> IN[2] OtherNode
bergie added a commit that referenced this issue Apr 25, 2014
bergie added a commit to noflo/noflo-runtime-base that referenced this issue Apr 25, 2014
@bergie
Copy link
Member

@bergie 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 added a commit to noflo/noflo-runtime-iframe that referenced this issue Apr 25, 2014
bergie added a commit to noflo/noflo.github.io that referenced this issue Apr 25, 2014
@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.