diff --git a/src/views/dashboard/related/topology/components/Graph.vue b/src/views/dashboard/related/topology/components/Graph.vue index 46e87fe9..c8608129 100644 --- a/src/views/dashboard/related/topology/components/Graph.vue +++ b/src/views/dashboard/related/topology/components/Graph.vue @@ -36,11 +36,11 @@ limitations under the License. --> /> - {{ n.name.length > 20 ? `${n.name.substring(0, 20)}...` : n.name }} + {{ n.name.length > 30 ? `${n.name.substring(0, 30)}...` : n.name }} @@ -113,7 +113,10 @@ limitations under the License. --> const topologyLayout = ref({}); const graphWidth = ref(100); const currentNode = ref>(null); - const diff = computed(() => [(width.value - graphWidth.value - 120) / 2, 40]); + const diff = computed(() => [ + (width.value - graphWidth.value - 160) / 2, + (height.value - topologyLayout.value.layout.height - 60) / 2, + ]); const radius = 10; async function init() { diff --git a/src/views/dashboard/related/topology/components/utils/layout.ts b/src/views/dashboard/related/topology/components/utils/layout.ts index 75aad15c..689a7ee9 100644 --- a/src/views/dashboard/related/topology/components/utils/layout.ts +++ b/src/views/dashboard/related/topology/components/utils/layout.ts @@ -234,8 +234,8 @@ export function hierarchy(levels: Node[][], calls: Call[], radius: number) { const nodes: Node[] = levels.reduce((a, x) => a.concat(x), []); // layout const padding = 30; - const node_height = 120; - const node_width = 100; + const node_height = 100; + const node_width = 180; const bundle_width = 10; const metro_d = 4; for (const n of nodes) { @@ -259,7 +259,7 @@ export function hierarchy(levels: Node[][], calls: Call[], radius: number) { } n.x = node_width + x_offset + n.width / 2; n.y = n.level * node_height + y_offset; - x_offset += node_height + n.width; + x_offset += node_width + n.width; } } const layout = {