newcat / baklavajs

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

how to create a custom input interface type ( v2 browser build ) ? #322

Closed eviltik closed 7 months ago

eviltik commented 11 months ago

Hello,

How to create a custom input interface type using browser build ?

I started using

class MyNodeInterface extends BaklavaJS.Core.Node {
      constructor() {
        super();
        this.initializeIo();
      }
}

but it failed with "can not be invoked without New" (line = super())

Any hints ?

Thank you

yojeek commented 10 months ago

Just borrow code of some of built-in interfaces as a boilerplate, for example :

https://github.com/newcat/baklavajs/tree/dev-v2.0/packages/renderer-vue/src/nodeinterfaces/textinput

newcat commented 10 months ago

You need to extend from BaklavaJS.Core.NodeInterface:

class MyNodeInterface extends BaklavaJS.Core.NodeInterface {
  constructor() {
    super("MyNodeInterface", 0);
  }
}