feat: enhance the process topology graph to support dragging nodes (#158)

This commit is contained in:
Fine0830
2022-09-15 17:18:39 +08:00
committed by GitHub
parent 9ed0121fd0
commit 26817e9f92
9 changed files with 311 additions and 291 deletions

View File

@@ -92,15 +92,21 @@ export const networkProfilingStore = defineStore({
}
return prev;
}, []);
calls = calls.map((d: any) => {
d.sourceId = d.source;
d.targetId = d.target;
d.source = d.sourceObj;
d.target = d.targetObj;
delete d.sourceObj;
delete d.targetObj;
return d;
});
const param = {} as any;
calls = data.calls.reduce((prev: (Call | any)[], next: Call | any) => {
if (param[next.targetId + next.sourceId]) {
next.lowerArc = true;
}
param[next.sourceId + next.targetId] = true;
next.sourceId = next.source;
next.targetId = next.target;
next.source = next.sourceObj;
next.target = next.targetObj;
delete next.sourceObj;
delete next.targetObj;
prev.push(next);
return prev;
}, []);
this.calls = calls;
this.nodes = data.nodes;
},