feat: some stuff

This commit is contained in:
2024-04-05 19:38:10 +02:00
parent b3780fdf96
commit 0ecf9798c4
22 changed files with 157 additions and 66 deletions

View File

@@ -1,11 +1,10 @@
import type { NodeRegistry, NodeType } from "@nodes/types";
import * as d from "plantarium-nodes-math";
import { createLogger } from "./helpers";
const nodeTypes: NodeType[] = [
{
id: "max/plantarium/input-float",
id: "max/plantarium/float",
inputs: {
"value": { type: "float", value: 0.1, internal: true },
},
@@ -48,6 +47,8 @@ export class RemoteNodeRegistry implements NodeRegistry {
async load(nodeIds: string[]) {
const a = performance.now();
nodeIds.push("max/plantarium/random");
nodeIds.push("max/plantarium/float");
for (const id of nodeIds) {
const nodeUrl = `${this.url}/n/${id}`;
const response = await fetch(nodeUrl);
@@ -70,10 +71,7 @@ wasm = val;`);
throw new Error(`Failed to load node ${id}`);
}
const node = await response.json();
node.execute = (...args) => {
console.log("Executing", id, args);
return wasmWrapper.execute(...args)
};
node.execute = wasmWrapper.execute;
this.nodes.set(id, node);
}