pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Global method for connecting nodes/anchors & expose `connect`/`disconnect` for `Anchor` as well

Open rohanrajpal opened this issue 2 years ago • 9 comments
trafficstars

Love the fact that now we can use connect & disconnect to programmatically connect nodes! Two doubts

  1. I guess it'd be great if we can also expose these methods from Anchors as well? Since they accept connections object too
  2. I guess there was a mention of a global method as well for connect & disconnect but i cant seem to find it, it'd be great to have that too

rohanrajpal avatar May 01 '23 06:05 rohanrajpal

Need to think through the global method before implementing and haven't had the time yet. Should get to it this week.

briangregoryholmes avatar May 02 '23 18:05 briangregoryholmes

Need to think through the global method before implementing and haven't had the time yet. Should get to it this week.

Sure thing! Happy to give any inputs if required.

Also what about point 1? I guess exposing let:connect from Anchor would be great as well

rohanrajpal avatar May 03 '23 07:05 rohanrajpal

Hey @briangregoryholmes ! Just wanted to know if this is possible now.

rohanrajpal avatar May 09 '23 05:05 rohanrajpal

The release cycle will be slowing down as the the team focuses on the next major version. This will absolutely be a part of that. I'll keep you posted.

briangregoryholmes avatar May 10 '23 16:05 briangregoryholmes

The release cycle will be slowing down as the the team focuses on the next major version. This will absolutely be a part of that. I'll keep you posted.

Sure sure, thanks for the update!

rohanrajpal avatar May 11 '23 11:05 rohanrajpal

Hey @briangregoryholmes now that 8.0 is about, is it possible to connect anchors via a function?

rohanrajpal avatar Jun 04 '23 06:06 rohanrajpal

I'm currently trying to restrict which inputs and outputs can connect. Essentially red-to-blue, green-to-yellow. And the ability to disconnect anchors from each other in the onConnected event would be nice. UPD: Found a way:

<script lang="ts">
let svelvet: Svelvet;
</script>

<Svelvet bind:this={svelvet}>

and then

svelvet.disconnect(["sourceNodeId", "sourceAnchorId"], ["targetNodeId", "targetAnchorId"]);

rinart73 avatar Jul 24 '23 18:07 rinart73

is there a similar connect function too?

rohanrajpal avatar Jul 27 '23 08:07 rohanrajpal

is there a similar connect function too?

Yes

rinart73 avatar Jul 27 '23 16:07 rinart73