mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
41
scripts/nodes/library/multiplyNumber.js
Normal file
41
scripts/nodes/library/multiplyNumber.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { createNodeModule } from "../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Multiplies two numeric values.
|
||||
*/
|
||||
export const multiplyNumberNode = createNodeModule(
|
||||
{
|
||||
id: "multiply_number",
|
||||
title: "Multiply",
|
||||
category: "Math",
|
||||
description: "Multiply two numbers.",
|
||||
searchTags: ["multiply", "product", "math", "number"],
|
||||
inputs: [
|
||||
{
|
||||
id: "a",
|
||||
name: "A",
|
||||
direction: "input",
|
||||
kind: "number",
|
||||
defaultValue: 1,
|
||||
},
|
||||
{
|
||||
id: "b",
|
||||
name: "B",
|
||||
direction: "input",
|
||||
kind: "number",
|
||||
defaultValue: 1,
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{ id: "res", name: "Result", direction: "output", kind: "number" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ resolveValueInput }) => {
|
||||
const a = resolveValueInput("a", "1");
|
||||
const b = resolveValueInput("b", "1");
|
||||
return `(${a}) * (${b})`;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user