From 501e312ac2ef2f737a4875d290648ad84f671228 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:51:14 +0100 Subject: [PATCH] implement fit workflow function --- .../src/components/Workflow/Editor/Index.vue | 12 +- .../Workflow/Editor/WorkflowGraph.vue | 296 ++++++++++-------- .../Workflow/Editor/WorkflowMinimap.vue | 43 +-- .../Workflow/Editor/composables/d3Zoom.ts | 9 +- .../Editor/composables/viewportBoundingBox.ts | 48 ++- .../Editor/composables/workflowBoundingBox.ts | 39 +++ .../Workflow/Editor/modules/geometry.ts | 33 ++ .../src/stores/workflowEditorCommentStore.ts | 11 + 8 files changed, 305 insertions(+), 186 deletions(-) create mode 100644 client/src/components/Workflow/Editor/composables/workflowBoundingBox.ts diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index 182dc05823e..33874ac33e6 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -158,6 +158,7 @@ activityBar.value?.isActiveSideBar("workflow-editor-report")); const parameters = ref(null); @@ -483,6 +485,7 @@ export default { id, name, parameters, + workflowGraph, ensureParametersSet, showAttributes, setName, @@ -996,6 +999,8 @@ export default { await this.resetStores(); this.onWorkflowMessage("Loading workflow...", "progress"); + console.log("loading"); + try { const data = await this.lastQueue.enqueue(loadWorkflow, { id, version }); await fromSimple(id, data); @@ -1003,6 +1008,11 @@ export default { } catch (e) { this.onWorkflowError("Loading workflow failed...", e); } + + await until(() => this.datatypesMapperLoading).toBe(false); + await nextTick(); + + this.workflowGraph.fitWorkflow(); } }, onLicense(license) { diff --git a/client/src/components/Workflow/Editor/WorkflowGraph.vue b/client/src/components/Workflow/Editor/WorkflowGraph.vue index b0a27f1b623..91392ae14bb 100644 --- a/client/src/components/Workflow/Editor/WorkflowGraph.vue +++ b/client/src/components/Workflow/Editor/WorkflowGraph.vue @@ -1,10 +1,168 @@ + + -