UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

24 lines 750 B
import { Node } from '../../programmatic/node.js'; import { Vec2Schema } from '../../schemas/index.js'; export default class NodeDefinition extends Node { static title = 'Subtract Vector2'; static type = 'studio.tokens.vector2.subtract'; static description = 'Subtracts second vector from first vector'; constructor(props) { super(props); this.addInput('a', { type: Vec2Schema }); this.addInput('b', { type: Vec2Schema }); this.addOutput('value', { type: Vec2Schema }); } execute() { const { a, b } = this.getAllInputs(); this.outputs.value.set([a[0] - b[0], a[1] - b[1]]); } } //# sourceMappingURL=subtract.js.map