newcat / baklavajs

Graph / node editor in the browser using VueJS
http://baklava.tech
MIT License
1.57k stars 116 forks source link

feat: Add getConnections method for retrieving node connections #364

Open a876691666 opened 9 months ago

a876691666 commented 9 months ago

This commit adds the retrieveNodeConnections method, which allows retrieving the connections associated with a given node. This functionality is necessary for retrieving and managing the connections of a node, enabling better analysis and manipulation of the node's relationships.

a876691666 commented 9 months ago

case:

props.node.graph?.retrieveNodeConnections(props.intf).forEach((connection) => {
  props.node.graph?.removeConnection(connection);
});
newcat commented 8 months ago

The method takes a node interface, not a node as the parameter. So I am a little bit confused - do you want to retrieve all connections for a node? In that case, the logic needs to be changed. If you want to retrieve all connections for a given node interface, then the method and parameter names should be changed.

a876691666 commented 8 months ago

It seems so, there's a naming issue