fix(ui): объединить параллельные связи OSPF в читаемый граф

This commit is contained in:
Denozordec committed 2026-10-04 17:37:42 +07:00
1 parent 086f118204
commit 9f74cfebfe
8 files changed
+43 -13

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ export function OspfTopologyScope({ nodes, edges, selectedId, onSelect, width, h
const peers = nodes.filter(node => node.id !== focal?.id && ids.has(node.id))
const radiusX = width * 0.39, radiusY = height * 0.30
const positioned = peers.map((node, index) => {
const angle = 2 * Math.PI * index / peers.length - Math.PI / 2
const angle = peers.length === 1 ? 0 : 2 * Math.PI * index / peers.length - Math.PI / 2
return { ...node, x: width / 2 + radiusX * Math.cos(angle), y: height / 2 + radiusY * Math.sin(angle) }
})
return { nodes: focal ? [{ ...focal, x: width / 2, y: height / 2 }, ...positioned] : [], edges: visibleEdges, nodeStates }