mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Remove arithmetic node modules: add, multiply, and subtract
This commit is contained in:
@@ -1,41 +0,0 @@
|
|||||||
import { createNodeModule } from "../nodeTypes.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds two numeric values.
|
|
||||||
*/
|
|
||||||
export const addNumberNode = createNodeModule(
|
|
||||||
{
|
|
||||||
id: "add_number",
|
|
||||||
title: "Add",
|
|
||||||
category: "Math",
|
|
||||||
description: "Add two numbers.",
|
|
||||||
searchTags: ["add", "math", "sum", "number"],
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
id: "a",
|
|
||||||
name: "A",
|
|
||||||
direction: "input",
|
|
||||||
kind: "number",
|
|
||||||
defaultValue: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "b",
|
|
||||||
name: "B",
|
|
||||||
direction: "input",
|
|
||||||
kind: "number",
|
|
||||||
defaultValue: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
outputs: [
|
|
||||||
{ id: "res", name: "Result", direction: "output", kind: "number" },
|
|
||||||
],
|
|
||||||
properties: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
evaluateValue: ({ resolveValueInput }) => {
|
|
||||||
const a = resolveValueInput("a", "0");
|
|
||||||
const b = resolveValueInput("b", "0");
|
|
||||||
return `(${a}) + (${b})`;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
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})`;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { createNodeModule } from "../nodeTypes.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Subtracts one numeric value from another.
|
|
||||||
*/
|
|
||||||
export const subtractNumberNode = createNodeModule(
|
|
||||||
{
|
|
||||||
id: "subtract_number",
|
|
||||||
title: "Subtract",
|
|
||||||
category: "Math",
|
|
||||||
description: "Subtract one number from another.",
|
|
||||||
searchTags: ["subtract", "math", "minus", "difference", "number"],
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
id: "a",
|
|
||||||
name: "A",
|
|
||||||
direction: "input",
|
|
||||||
kind: "number",
|
|
||||||
defaultValue: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "b",
|
|
||||||
name: "B",
|
|
||||||
direction: "input",
|
|
||||||
kind: "number",
|
|
||||||
defaultValue: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
outputs: [
|
|
||||||
{ id: "res", name: "Result", direction: "output", kind: "number" },
|
|
||||||
],
|
|
||||||
properties: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
evaluateValue: ({ resolveValueInput }) => {
|
|
||||||
const a = resolveValueInput("a", "0");
|
|
||||||
const b = resolveValueInput("b", "0");
|
|
||||||
return `(${a}) - (${b})`;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
Reference in New Issue
Block a user