baklavajs icon indicating copy to clipboard operation
baklavajs copied to clipboard

Restrict interfaces to be connected only if the same type

Open terion-name opened this issue 1 year ago • 3 comments

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

terion-name avatar Nov 23 '24 22:11 terion-name

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 });

newcat avatar Nov 24 '24 22:11 newcat

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

terion-name avatar Nov 25 '24 21:11 terion-name

I agree with terion-name — the docs say that only the same type connections are allowed baby default but this is not the case. The allowed types for connections must be set up.

At least this should be documented much better.

mrunion avatar Jan 18 '25 14:01 mrunion