You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to programmatically add edges between nodes with let:connect function of the Node component, as suggested by the documentation. I've tried a few different variations, but none of them worked. Likewise, I would expect the button on the second node to create a connection to the first one on click. But it doesn't so I am kind of at a loss here. Anyone any ideas?
<scriptlang="ts">
import {Node,Svelvet,Anchor} from "svelvet";
// My problem: Node.connect doesn't work in the way shown below and I also don't get any feedback as to why in terms of e.g. console output
// Is it necessary to add the Anchors manually as I did below?
</script><Svelvet><Nodeid="1"...><div>
...
</div><Anchor/></Node><Nodeid="2"let:connect><div>
...
<buttonon:click={()=>connect(1)}>
Connect to 1
</button></div><Anchor/></Node></Svelvet>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to programmatically add edges between nodes with let:connect function of the Node component, as suggested by the documentation. I've tried a few different variations, but none of them worked. Likewise, I would expect the button on the second node to create a connection to the first one on click. But it doesn't so I am kind of at a loss here. Anyone any ideas?
The code below running in stackblitz: https://stackblitz.com/edit/sveltejs-kit-template-default-uek3rl?file=src%2Froutes%2F%2Bpage.svelte
Beta Was this translation helpful? Give feedback.
All reactions