Move node graph from panel to overlay on viewport

This commit is contained in:
Keavon Chambers
2023-08-19 01:21:37 -07:00
parent d74e4b2ab3
commit 185106132d
29 changed files with 776 additions and 640 deletions
@@ -8,10 +8,7 @@ import {
type FrontendNodeType,
UpdateNodeGraph,
UpdateNodeTypes,
UpdateNodeGraphBarLayout,
UpdateZoomWithScroll,
defaultWidgetLayout,
patchWidgetLayout,
} from "@graphite/wasm-communication/messages";
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -20,7 +17,6 @@ export function createNodeGraphState(editor: Editor) {
nodes: [] as FrontendNode[],
links: [] as FrontendNodeLink[],
nodeTypes: [] as FrontendNodeType[],
nodeGraphBarLayout: defaultWidgetLayout(),
zoomWithScroll: false as boolean,
});
@@ -38,12 +34,6 @@ export function createNodeGraphState(editor: Editor) {
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateNodeGraphBarLayout, (updateNodeGraphBarLayout) => {
update((state) => {
patchWidgetLayout(state.nodeGraphBarLayout, updateNodeGraphBarLayout);
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateZoomWithScroll, (updateZoomWithScroll) => {
update((state) => {
state.zoomWithScroll = updateZoomWithScroll.zoomWithScroll;