diff --git a/README.md b/README.md index c369e5e..7a9749f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Nodarium +Currently this visual programming language is used to develop https://nodes.max-richter.dev, a procedural modelling tool for 3d-plants. + # Table of contents - [Architecture](./docs/ARCHITECTURE.md) diff --git a/app/package.json b/app/package.json index 9466fb3..65227cb 100644 --- a/app/package.json +++ b/app/package.json @@ -10,6 +10,8 @@ "preview": "vite preview" }, "dependencies": { + "@nodes/registry": "link:../packages/registry", + "@nodes/runtime": "link:../packages/runtime", "@nodes/ui": "link:../packages/ui", "@nodes/utils": "link:../packages/utils", "@sveltejs/kit": "^2.5.7", diff --git a/app/src/lib/helpers/index.ts b/app/src/lib/helpers/index.ts index 5799ac5..fb59137 100644 --- a/app/src/lib/helpers/index.ts +++ b/app/src/lib/helpers/index.ts @@ -73,35 +73,6 @@ export const debounce = (fn: Function, ms = 300) => { export const clone: (v: T) => T = "structedClone" in globalThis ? globalThis.structuredClone : (obj) => JSON.parse(JSON.stringify(obj)); -export const createLogger = (() => { - let maxLength = 5; - return (scope: string) => { - maxLength = Math.max(maxLength, scope.length); - let muted = false; - - let isGrouped = false; - - function s(color: string, ...args: any) { - return isGrouped ? [...args] : [`[%c${scope.padEnd(maxLength, " ")}]:`, `color: ${color}`, ...args]; - } - - return { - log: (...args: any[]) => !muted && console.log(...s("#888", ...args)), - info: (...args: any[]) => !muted && console.info(...s("#888", ...args)), - warn: (...args: any[]) => !muted && console.warn(...s("#888", ...args)), - error: (...args: any[]) => console.error(...s("#f88", ...args)), - group: (...args: any[]) => { if (!muted) { console.groupCollapsed(...s("#888", ...args)); isGrouped = true; } }, - groupEnd: () => { if (!muted) { console.groupEnd(); isGrouped = false } }, - mute() { - muted = true; - }, - unmute() { - muted = false; - } - - } - } -})(); export function withSubComponents>( diff --git a/app/src/lib/performance/PerformanceViewer.svelte b/app/src/lib/performance/PerformanceViewer.svelte index 83fa37e..e89998b 100644 --- a/app/src/lib/performance/PerformanceViewer.svelte +++ b/app/src/lib/performance/PerformanceViewer.svelte @@ -3,7 +3,7 @@ import { humanizeNumber } from "$lib/helpers"; import { Checkbox } from "@nodes/ui"; import localStore from "$lib/helpers/localStore"; - import { type PerformanceData } from "./store"; + import { type PerformanceData } from "@nodes/utils"; import BarSplit from "./BarSplit.svelte"; export let data: PerformanceData; diff --git a/app/src/lib/performance/SmallPerformanceViewer.svelte b/app/src/lib/performance/SmallPerformanceViewer.svelte index ab042b6..347c105 100644 --- a/app/src/lib/performance/SmallPerformanceViewer.svelte +++ b/app/src/lib/performance/SmallPerformanceViewer.svelte @@ -2,15 +2,13 @@ import { humanizeDuration, humanizeNumber } from "$lib/helpers"; import localStore from "$lib/helpers/localStore"; import SmallGraph from "./SmallGraph.svelte"; - import type { PerformanceData, PerformanceStore } from "./store"; + import type { PerformanceData, PerformanceStore } from "@nodes/utils"; export let store: PerformanceStore; const open = localStore("node.performance.small.open", { runtime: false, fps: false, - vertices: false, - faces: false, }); $: vertices = $store?.at(-1)?.["total-vertices"][0] || 0; @@ -54,29 +52,15 @@ {/if} - ($open.vertices = !$open.vertices)}> - {$open.vertices ? "-" : "+"} vertices + + vertices {humanizeNumber(vertices || 0)} - {#if $open.vertices} - - - - - - {/if} - ($open.faces = !$open.faces)}> - {$open.faces ? "-" : "+"} faces + + faces {humanizeNumber(faces || 0)} - {#if $open.faces} - - - - - - {/if} diff --git a/app/src/lib/performance/index.ts b/app/src/lib/performance/index.ts index 0d8ab3d..767e4ef 100644 --- a/app/src/lib/performance/index.ts +++ b/app/src/lib/performance/index.ts @@ -1,2 +1 @@ -export * from "./store"; export { default as PerformanceViewer } from "./PerformanceViewer.svelte"; diff --git a/app/src/lib/result-viewer/Viewer.svelte b/app/src/lib/result-viewer/Viewer.svelte index 5a3b945..b610c7a 100644 --- a/app/src/lib/result-viewer/Viewer.svelte +++ b/app/src/lib/result-viewer/Viewer.svelte @@ -5,7 +5,7 @@ import { updateGeometries } from "./updateGeometries"; import { decodeFloat, splitNestedArray } from "@nodes/utils"; - import type { PerformanceStore } from "$lib/performance"; + import type { PerformanceStore } from "@nodes/utils"; import { AppSettings } from "$lib/settings/app-settings"; import SmallPerformanceViewer from "$lib/performance/SmallPerformanceViewer.svelte"; diff --git a/app/src/lib/settings/panels/BenchmarkPanel.svelte b/app/src/lib/settings/panels/BenchmarkPanel.svelte index ac03549..bae4d05 100644 --- a/app/src/lib/settings/panels/BenchmarkPanel.svelte +++ b/app/src/lib/settings/panels/BenchmarkPanel.svelte @@ -136,16 +136,6 @@ border: solid thin var(--outline); border-bottom: none; } - textarea { - width: 100%; - height: 1em; - font-size: 1em; - padding: 0.5em; - border: solid thin var(--outline); - background: var(--layer-2); - box-sizing: border-box; - height: 2.5em; - } i { opacity: 0.5; font-size: 0.8em; diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 09b24f0..d3edc4c 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -1,8 +1,6 @@