behave-graph icon indicating copy to clipboard operation
behave-graph copied to clipboard

Flow editor - show values next to input nodes as they are updated

Open oveddan opened this issue 3 years ago • 2 comments

In the flow editor, there is no way to know what value is being set in each input, without using some internal console.logs. It would be great if in the flow editor, when a data edge is attached between output/input, the value gets shown on the input node:

Screenshot 2022-11-21 at 11 32 49 PM

is there a way, from the outside of the engine, to subscribe to when a node's input gets updated? This way we could potentially display that value in the node.

oveddan avatar Nov 22 '22 07:11 oveddan

I created a function that can evaluate those at any time now....

https://github.com/bhouston/behave-graph/blob/main/packages/core/src/Execution/resolveSocketValue.ts

So you just need to figure out when to call this function. Technically it isn't very slow -- so you could, after every graph change, call this on every input socket? That would scale for at least a hundred or so nodes, and then eventually you'll have to be a bit smarter.

bhouston avatar Nov 22 '22 13:11 bhouston

Nice this is useful! What about a way for those nodes to emit a value when they get a new one?

oveddan avatar Nov 22 '22 20:11 oveddan