update links

This commit is contained in:
Fine 2022-08-24 11:56:38 +08:00
parent b693348172
commit 9d1ef93bd1
2 changed files with 10 additions and 8 deletions

View File

@ -27,6 +27,9 @@ export const linkElement = (graph: any) => {
[d.target.x, d.target.y - 5],
0.5
);
if (d.lowerArc) {
controlPos[1] = -controlPos[1];
}
return (
"M" +
d.source.x +
@ -57,6 +60,9 @@ export const anchorElement = (graph: any, funcs: any, tip: any) => {
[d.target.x, d.target.y - 5],
0.5
);
if (d.lowerArc) {
controlPos[1] = -controlPos[1];
}
const p = quadraticBezier(
0.5,
{ x: d.source.x, y: d.source.y - 5 },

View File

@ -297,15 +297,11 @@ function drawTopology(nodeArr: any[]) {
// line element
const obj = {} as any;
const calls = networkProfilingStore.calls.reduce((prev: any[], next: any) => {
if (
!(
obj[next.sourceId + next.targetId] && obj[next.targetId + next.sourceId]
)
) {
obj[next.sourceId + next.targetId] = true;
obj[next.targetId + next.sourceId] = true;
prev.push(next);
if (obj[next.targetId + next.sourceId]) {
next.lowerArc = true;
}
obj[next.sourceId + next.targetId] = true;
prev.push(next);
return prev;
}, []);