diff --git a/packages/graph-editor/src/components/flow/wrapper/nodeV2.tsx b/packages/graph-editor/src/components/flow/wrapper/nodeV2.tsx
index 21ba63fe..4813e98e 100644
--- a/packages/graph-editor/src/components/flow/wrapper/nodeV2.tsx
+++ b/packages/graph-editor/src/components/flow/wrapper/nodeV2.tsx
@@ -163,7 +163,7 @@ const getColorPreview = (color: string, showValue = false) => {
const getValuePreview = (value, type) => {
- if (value === undefined) {
+ if (!value) {
return null;
}
@@ -189,9 +189,6 @@ const getValuePreview = (value, type) => {
case 'number':
valuePreview = value.toString();
break;
- case 'string':
- valuePreview = value;
- break;
default:
if (isHexColor(value)) {
return getColorPreview(value,true);
@@ -262,8 +259,9 @@ const InputHandle = observer(({ port, hideName }: { port: Port, hideName?: boole
>
{!hideName && (
- {inlineValuesValue && {getValuePreview(input.value, input.type) ?? input.name}}
- {port.value !== undefined ? {input.name} : null}
+ {inlineValuesValue && {getValuePreview(input.value, input.type) || port.name}}
+
+ {port.value && {port.name}}
)}
{inlineTypesValue && }
diff --git a/packages/graph-engine/src/nodes/generic/input.ts b/packages/graph-engine/src/nodes/generic/input.ts
index 29ee91d1..ed15ba51 100644
--- a/packages/graph-engine/src/nodes/generic/input.ts
+++ b/packages/graph-engine/src/nodes/generic/input.ts
@@ -4,9 +4,9 @@
* @packageDocumentation
*/
import { INodeDefinition } from "../../programmatic/node.js";
-import { Node } from "../../programmatic/node.js";
-import { NodeTypes } from "../../types.js";
import { annotatedDynamicInputs, annotatedSingleton } from '../../annotations/index.js';
+import { NodeTypes } from "../../types.js";
+import { Node } from "../../programmatic/node.js";
export default class NodeDefinition extends Node {
static title = "Input";
@@ -23,26 +23,19 @@ export default class NodeDefinition extends Node {
execute(): void | Promise {
const inputs = this.getAllInputs();
- const outputs = this.getAllOutputs();
+
+ //Remove all outputs
+ this.clearOutputs();
//Passthrough all
Object.keys(inputs).forEach((input) => {
const rawInput = this.getRawInput(input);
- if(!(input in outputs)) {
- this.addOutput(input, {
- type: rawInput.type,
- visible: true,
- });
- }
-
- this.setOutput(input, rawInput.value, rawInput.type);
- });
-
- Object.keys(outputs).forEach((output) => {
- if(!(output in inputs)) {
- delete this.outputs[output];
- }
+ this.addOutput(input, {
+ type: rawInput.type,
+ visible: true,
+ });
+ this.setOutput(input, rawInput.value);
});
}
}
diff --git a/packages/graph-engine/src/nodes/generic/output.ts b/packages/graph-engine/src/nodes/generic/output.ts
index 0b69c406..8326d5a3 100644
--- a/packages/graph-engine/src/nodes/generic/output.ts
+++ b/packages/graph-engine/src/nodes/generic/output.ts
@@ -3,12 +3,12 @@
*
* @packageDocumentation
*/
-import { AnySchema } from "../../schemas/index.js";
-import { INodeDefinition, Node } from "../../programmatic/node.js";
-import { NodeTypes } from "../../types.js";
import { ToInput } from "../../programmatic/input.js";
import { ToOutput } from "../../programmatic/output.js";
import { annotatedDynamicInputs, annotatedSingleton } from '../../annotations/index.js';
+import { NodeTypes } from "../../types.js";
+import { Node, INodeDefinition } from "../../programmatic/node.js";
+import { AnySchema } from "../../schemas/index.js";
export default class NodeDefinition extends Node {
@@ -32,25 +32,18 @@ export default class NodeDefinition extends Node {
execute(): void | Promise {
const inputs = this.getAllInputs();
- const outputs = this.getAllOutputs();
+
+ //Remove all outputs
+ this.clearOutputs();
//Passthrough all
Object.keys(inputs).forEach((input) => {
const rawInput = this.getRawInput(input);
- if(!(input in outputs)) {
- this.addOutput(input, {
- type: rawInput.type,
- });
- }
-
- this.setOutput(input, rawInput.value, rawInput.type);
- });
-
- Object.keys(outputs).forEach((output) => {
- if(!(output in inputs)) {
- delete this.outputs[output];
- }
+ this.addOutput(input, {
+ type: rawInput.type
+ });
+ this.setOutput(input, rawInput.value);
});
}
}
diff --git a/packages/graph-engine/src/programmatic/node.ts b/packages/graph-engine/src/programmatic/node.ts
index afe79a0b..9b5696e6 100644
--- a/packages/graph-engine/src/programmatic/node.ts
+++ b/packages/graph-engine/src/programmatic/node.ts
@@ -1,12 +1,12 @@
-import { Graph } from '../graph/index.js';
-import { GraphSchema } from "../schemas/index.js";
-import { IDeserializeOpts, SerializedNode } from "../graph/types.js";
import { Input } from "./input.js";
import { Output } from "./output.js";
-import { action, computed, makeObservable, observable } from "mobx";
-import { annotatedNodeRunning } from "../annotations/index.js";
import { v4 as uuid } from 'uuid';
+import { Graph } from '../graph/index.js';
+import { SerializedNode, IDeserializeOpts } from "../graph/types.js";
+import { annotatedNodeRunning } from "../annotations/index.js";
+import { GraphSchema } from "../schemas/index.js";
import getDefaults from "json-schema-defaults";
+import { action, computed, makeObservable, observable } from "mobx";
import type { NodeRun } from "../types.js";
@@ -282,12 +282,6 @@ export class Node {
) as T;
};
- getAllOutputs = >(): T => {
- return Object.fromEntries(
- Object.entries(this.outputs).map(([key, value]) => [key, value.value])
- ) as T;
- };
-
/**
* Handles cleanup for nodes with state.
* Use the super method to clear the graph reference