From 6a662faace594fffa07af36db1db176bb191ae21 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Wed, 16 Jul 2025 12:10:13 +0900 Subject: [PATCH 1/2] update trigger --- src/patchmap.js | 1 + src/utils/convert.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/patchmap.js b/src/patchmap.js index 1e6f6d87..d0119a93 100644 --- a/src/patchmap.js +++ b/src/patchmap.js @@ -145,6 +145,7 @@ class Patchmap { event.removeAllEvent(this.viewport); this.initSelectState(); draw(context, validatedData); + this.update({ path: '$..children[?(@.type=="relations")]', refresh: true }); this.app.start(); return validatedData; diff --git a/src/utils/convert.js b/src/utils/convert.js index dfad52dd..5ee0890c 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -65,6 +65,7 @@ export const convertLegacyData = (data) => { } } else if (key === 'strings') { objs[key].show = false; + objs[key].attrs = { zIndex: 20 }; for (const value of values) { objs[key].children.push({ type: 'relations', @@ -96,8 +97,7 @@ export const convertLegacyData = (data) => { }); } } else { - objs[key].attrs = {}; - objs[key].attrs.zIndex = 10; + objs[key].attrs = { zIndex: 10 }; for (const value of values) { const { transform, ...props } = value.properties; objs[key].children.push({ From 0237c74131b1185f9747005604c063e1cb764545 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Wed, 16 Jul 2025 12:18:28 +0900 Subject: [PATCH 2/2] fix comment --- src/patchmap.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/patchmap.js b/src/patchmap.js index d0119a93..b2ce6073 100644 --- a/src/patchmap.js +++ b/src/patchmap.js @@ -145,7 +145,12 @@ class Patchmap { event.removeAllEvent(this.viewport); this.initSelectState(); draw(context, validatedData); + + // Force a refresh of all relation elements after the initial draw. This ensures + // that all link targets exist in the scene graph before the relations + // attempt to draw their links. this.update({ path: '$..children[?(@.type=="relations")]', refresh: true }); + this.app.start(); return validatedData;