feat: add active node settings
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
<script lang="ts">
|
||||
import type { Graph, NodeRegistry } from "@nodes/types";
|
||||
import type { Graph, Node, NodeRegistry } from "@nodes/types";
|
||||
import GraphEl from "./Graph.svelte";
|
||||
import { GraphManager } from "../graph-manager.js";
|
||||
import { createEventDispatcher, setContext } from "svelte";
|
||||
import type { Writable } from "svelte/store";
|
||||
import { type Writable } from "svelte/store";
|
||||
import { debounce } from "$lib/helpers";
|
||||
import { createKeyMap } from "$lib/helpers/createKeyMap";
|
||||
import { activeNodeId } from "./stores";
|
||||
|
||||
export let registry: NodeRegistry;
|
||||
export let graph: Graph;
|
||||
export let settings: Writable<Record<string, any>> | undefined;
|
||||
|
||||
export const manager = new GraphManager(registry);
|
||||
export let activeNode: Node | undefined;
|
||||
$: if ($activeNodeId !== -1) {
|
||||
activeNode = manager.getNode($activeNodeId);
|
||||
} else {
|
||||
activeNode = undefined;
|
||||
}
|
||||
|
||||
export const status = manager.status;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user