newcat / baklavajs

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

Restrict interfaces to be connected only if the same type #436

Open terion-name opened 2 days ago

terion-name commented 2 days ago

First of all, really great library, thank you! But one thing that I was surprised to understand on half-way of development with it: it doesn't restrict any type-to-type connections. Text to number, custom types, etc. This is very strange and looks like a bug. Or this somehow can be tuned?

UPD Found that docs say that only same-type connectons are allowed, but in reality – it allows any. Using 2.6.0 version in nuxt 3

newcat commented 1 day ago

Unfortunately I am unable to reproduce your issue. Here is what I've tried: https://stackblitz.com/edit/vitejs-vite-c3bey8?file=src%2FApp.vue

Can you verify you're doing the same? Specifically that you have added this: new BaklavaInterfaceTypes(editor, { viewPlugin: baklavaView });

terion-name commented 8 hours ago

Unfortunately I am unable to reproduce your issue. Here is what I've tried: https://stackblitz.com/edit/vitejs-vite-c3bey8?file=src%2FApp.vue

Can you verify you're doing the same? Specifically that you have added this: new BaklavaInterfaceTypes(editor, { viewPlugin: baklavaView });

ah, you need to manually register all types and manually set each input and output socket... it's not obvious from docs and really should be on getting started. thank you

But I don't get, why built-in interfaces do not have types set? For custom ones I can set it at definition and not repeat at each socket at each node, but with built-ins it is not the case