open-source-labs / Svelvet

🎛 A Svelte library for building dynamic, infinitely customizable node-based user interfaces and flowcharts
https://svelvet.io
2.56k stars 165 forks source link

Gradient edges based on anchor color #490

Closed Somfic closed 9 months ago

Somfic commented 10 months ago

I'd like to apply a gradient to my custom edge component to indicate a cast between value types between nodes, but I don't see the Edge component exposing any information that can help me with that, like the source and target anchor between an edge.

Is this usecase viable in the current version (8)?

Somfic commented 9 months ago

Update: this is possible by using the bind:edge value on the Edge component that is defined in a custom edge component implementation.

Using the source and target fields from edge for finding the from and to nodes gives enough information to determine the types and apply the styling in your custom edge component.

Thanks for all the work you've put in the library, it is much appreciated 👍.