updated graph rendering to be more efficient. added smooth scrolling, added color type, mmb drag for cutting

This commit is contained in:
2026-03-21 06:57:26 +11:00
parent 1f5da03474
commit ae374db9fb
54 changed files with 9147 additions and 138 deletions

View File

@@ -0,0 +1,26 @@
import { createNodeModule } from "../../nodeTypes.js";
/**
* Converts a color value to a numeric value.
*/
export const colorToNumberNode = createNodeModule(
{
id: "convert_color_to_number",
title: "Color to Number",
category: "Converters",
description: "Convert a color value to a numeric value.",
searchTags: ["color", "number", "convert", "cast"],
inputs: [
{ id: "color", name: "Color", direction: "input", kind: "color" }
],
outputs: [
{ id: "number", name: "Number", direction: "output", kind: "number" }
],
properties: [],
},
{
evaluateValue: ({ resolveValueInput }) => {
return resolveValueInput("color", "0");
},
}
);

View File

@@ -0,0 +1,7 @@
import { colorToNumberNode } from "./colorToNumber.js";
import { numberToColorNode } from "./numberToColor.js";
/**
* All type conversion nodes.
*/
export const converterNodes = [colorToNumberNode, numberToColorNode];

View File

@@ -0,0 +1,26 @@
import { createNodeModule } from "../../nodeTypes.js";
/**
* Converts a numeric value to a color value.
*/
export const numberToColorNode = createNodeModule(
{
id: "convert_number_to_color",
title: "Number to Color",
category: "Converters",
description: "Convert a numeric value to a color value.",
searchTags: ["number", "color", "convert", "cast"],
inputs: [
{ id: "number", name: "Number", direction: "input", kind: "number" }
],
outputs: [
{ id: "color", name: "Color", direction: "output", kind: "color" }
],
properties: [],
},
{
evaluateValue: ({ resolveValueInput }) => {
return resolveValueInput("number", "0");
},
}
);