diff --git a/src/views/dashboard/related/network-profiling/components/Graph/linkProcess.ts b/src/views/dashboard/related/network-profiling/components/Graph/linkProcess.ts index df32310d..16cdb7d5 100644 --- a/src/views/dashboard/related/network-profiling/components/Graph/linkProcess.ts +++ b/src/views/dashboard/related/network-profiling/components/Graph/linkProcess.ts @@ -25,8 +25,8 @@ export const linkElement = (graph: any) => { .attr("stroke", "#97B0F8") .attr("d", (d: Call) => { const controlPos = computeControlPoint( - [d.source.x, d.source.y], - [d.target.x, d.target.y], + [d.source.x, d.source.y - 5], + [d.target.x, d.target.y - 5], 0.5 ); if (d.lowerArc) { @@ -36,7 +36,7 @@ export const linkElement = (graph: any) => { "M" + d.source.x + " " + - d.source.y + + (d.source.y - 5) + " " + "Q" + controlPos[0] + @@ -45,7 +45,7 @@ export const linkElement = (graph: any) => { " " + d.target.x + " " + - d.target.y + (d.target.y - 5) ); }); return linkEnter; @@ -73,7 +73,7 @@ export const anchorElement = (graph: any, funcs: any, tip: any) => { }) .attr("y", (d: Call) => { const p = getMidpoint(d); - return p[1] + 3; + return p[1] - 2; }) .text((d: Call) => { const types = [...d.sourceComponents, ...d.targetComponents]; @@ -100,7 +100,7 @@ export const anchorElement = (graph: any, funcs: any, tip: any) => { }) .attr("y", (d: Call) => { const p = getMidpoint(d); - return p[1] - 9; + return p[1] - 14; }) .attr("xlink:href", (d: Call) => { const types = [...d.sourceComponents, ...d.targetComponents]; diff --git a/src/views/dashboard/related/network-profiling/components/Graph/nodeProcess.ts b/src/views/dashboard/related/network-profiling/components/Graph/nodeProcess.ts index 23a033d4..197b1273 100644 --- a/src/views/dashboard/related/network-profiling/components/Graph/nodeProcess.ts +++ b/src/views/dashboard/related/network-profiling/components/Graph/nodeProcess.ts @@ -37,16 +37,16 @@ export default (d3: any, graph: any, funcs: any, tip: any) => { .append("image") .attr("width", 35) .attr("height", 35) - .attr("x", (d: any) => d.x - 15) - .attr("y", (d: any) => d.y - 15) + .attr("x", (d: { x: number }) => d.x - 15) + .attr("y", (d: { y: number }) => d.y - 15) .attr("style", "cursor: move;") .attr("xlink:href", icons.CUBE); nodeEnter .append("text") .attr("fill", "#000") .attr("text-anchor", "middle") - .attr("x", (d: any) => d.x) - .attr("y", (d: any) => d.y + 28) + .attr("x", (d: { x: number }) => d.x) + .attr("y", (d: { y: number }) => d.y + 28) .text((d: { name: string }) => d.name.length > 10 ? `${d.name.substring(0, 10)}...` : d.name ); diff --git a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue b/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue index 6a9b9518..2b352403 100644 --- a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue +++ b/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue @@ -80,6 +80,7 @@ const config = ref({}); const diff = ref([220, 200]); const radius = 210; const dates = ref>(null); +const nodeList = ref([]); onMounted(() => { init(); @@ -278,7 +279,8 @@ function createLayout() { outNodes[v].x = pointArr[v][0]; outNodes[v].y = pointArr[v][1]; } - drawTopology([...nodeArr, ...outNodes]); + nodeList.value = [...nodeArr, ...outNodes]; + drawTopology(nodeList.value); } function drawTopology(nodeArr: any[]) {