diff --git a/frontend/src/lib/components/edges/Edge.svelte b/frontend/src/lib/components/edges/Edge.svelte index e6f3807..c6ff08f 100644 --- a/frontend/src/lib/components/edges/Edge.svelte +++ b/frontend/src/lib/components/edges/Edge.svelte @@ -1,10 +1,25 @@ + + - - + +
{ // < - - - - from - - - - to const fromParents = this.getParentsOfNode(from); if (toParents.includes(from)) { - return toParents.splice(toParents.indexOf(from)); + const fromChildren = this.getChildrenOfNode(from); + return toParents.filter(n => fromChildren.includes(n)); } else if (fromParents.includes(to)) { - return [...fromParents.splice(fromParents.indexOf(to)), from]; + const toChildren = this.getChildrenOfNode(to); + return fromParents.filter(n => toChildren.includes(n)); } else { // these two nodes are not connected return; diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 5a0455b..f2766f1 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -4,6 +4,7 @@ import Graph from "$lib/components/graph/Graph.svelte"; import { MemoryRuntimeExecutor } from "$lib/runtime-executor"; import { MemoryNodeRegistry } from "$lib/node-registry"; + import { LinearSRGBColorSpace } from "three"; const nodeRegistry = new MemoryNodeRegistry(); const runtimeExecutor = new MemoryRuntimeExecutor(nodeRegistry); @@ -14,7 +15,7 @@ if (graph) { graphManager.load(JSON.parse(graph)); } else { - graphManager.load(graphManager.createTemplate("grid", 10, 10)); + graphManager.load(graphManager.createTemplate("tree", 5)); } graphManager.on("save", (graph) => { @@ -47,7 +48,12 @@
- +