-
-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
I'm trying to disable/hide an input, depending on if another input is connected or not.
I'm using the class-based approach to create the node.
In the documentation I see:
onUpdate({ operation }) {
if (operation === "Sine") {
return {
inputs: {
input1: () => new NumberInterface("Input", 0),
},
};
} else {
return {
inputs: {
input1: () => new NumberInterface("Input", 0),
input2: () => new NumberInterface("Input", 0),
},
};
}
},
but how do I do this with a class, since there seems no onUpdate available there?
This is my class definition:
class BaseNode<I extends Inputs = Inputs, O extends Outputs = Outputs> extends DynamicNode<
I,
O
> {
public type = 'BaseNode';
public override get title(): string {
return 'Base';
}
public inputs = {
input1: new NumberInterface('Input 1', 1),
input2: new NumberInterface('Input 2', 1),
} as NodeInterfaceDefinition<I>;
public outputs = {
output: new NodeInterface('Output', 1),
} as NodeInterfaceDefinition<O>;
public constructor() {
super();
}
public override load(data: unknown): void {
}
public override calculate: CalculateFunction<I, O> = (inputs, outputs) => {
return {} as O;
};
}
I'd like to achieve that for example, when there is nothing connected to input1, then input2 is hidden.
Any ideas?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels