diff --git a/ui/app.js b/ui/app.js index 782ff43..cd301bf 100644 --- a/ui/app.js +++ b/ui/app.js @@ -233,44 +233,33 @@ const groups = groupBySubnet(devices); const ringBase = Math.min(w, h) * 0.18; const nodes = []; - const anchors = []; - const omeHub = { x: cx, y: cy }; groups.forEach((g, si) => { const ring = ringBase + si * Math.min(70, Math.max(42, 360 / Math.max(groups.length, 1))); - const pts = []; g.members.forEach((n, i) => { const a = (i / Math.max(g.members.length, 1)) * Math.PI * 2 - Math.PI / 2 + si * 0.15; const jitter = (n.id % 7) * 2.2; - const x = cx + Math.cos(a) * (ring + jitter); - const y = cy + Math.sin(a) * (ring + jitter); - pts.push({ x, y }); nodes.push({ ...n, - tx: x, - ty: y, + tx: cx + Math.cos(a) * (ring + jitter), + ty: cy + Math.sin(a) * (ring + jitter), r: nodeRadius(n), depth: 1, }); }); - const a = anchorsFromPoints(g.cidr, pts, omeHub, { pipeExtra: 44, pad: 10 }); - if (a) anchors.push(a); }); state.clusterHubs = []; state.laneGuides = []; - state.labelAnchors = anchors; + state.labelAnchors = []; setTargets(nodes); } function layoutGalaxy(devices, cx, cy, w, h) { const groups = groupBySubnet(devices); const nodes = []; - const anchors = []; - const omeHub = { x: cx, y: cy }; const arms = Math.max(groups.length, 1); const maxR = Math.min(w, h) * 0.42; groups.forEach((g, si) => { const armAngle = (si / arms) * Math.PI * 2; - const pts = []; g.members.forEach((n, i) => { const t = (i + 1) / (g.members.length + 1); const r = 70 + t * maxR; @@ -278,7 +267,6 @@ const wobble = Math.sin(i * 1.7 + si) * 12; const x = cx + Math.cos(twist) * r + Math.cos(twist + Math.PI / 2) * wobble * 0.35; const y = cy + Math.sin(twist) * r + Math.sin(twist + Math.PI / 2) * wobble * 0.35; - pts.push({ x, y }); nodes.push({ ...n, tx: x, @@ -288,20 +276,10 @@ arm: si, }); }); - // Prefer arm outward direction - const midT = 0.65; - const midTwist = midT * 3.2 + armAngle; - const a = anchorsFromPoints(g.cidr, pts, omeHub, { - dirX: Math.cos(midTwist), - dirY: Math.sin(midTwist), - pipeExtra: 48, - pad: 12, - }); - if (a) anchors.push(a); }); state.clusterHubs = []; state.laneGuides = []; - state.labelAnchors = anchors; + state.labelAnchors = []; setTargets(nodes); } diff --git a/ui/index.html b/ui/index.html index 4a78839..591260d 100644 --- a/ui/index.html +++ b/ui/index.html @@ -633,7 +633,7 @@ - +