Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/patchmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +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;

Expand Down
4 changes: 2 additions & 2 deletions src/utils/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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({
Expand Down