@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
26 lines (25 loc) • 808 B
JavaScript
import { APINode } from './APINode';
export class ObjectAPINode extends APINode {
objectKey;
static __isAbstract;
constructor(params) {
const { objectKey = 'object', objectLabel = 'Object' } = params;
super(params);
this.objectKey = objectKey;
this.oldAddInData({
name: objectKey,
displayName: objectLabel,
socketLabel: objectLabel,
type: 'pythonObject'
});
this.oldAddOutData({
name: objectKey,
socketLabel: objectLabel,
displayName: objectLabel,
type: 'pythonObject'
});
this.pythonComponent.setDataCodeGetter(objectKey, () => `$(${objectKey})`);
}
}
// add property __abstract to ObjectAPINode
ObjectAPINode.__isAbstract = true;