Disable subnet leader-pipe labels on Orbit and Galaxy.
Keep pipes on Clusters, Lanes, and Helix where they stay readable. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -633,7 +633,7 @@
|
||||
|
||||
<script src="/vendor/xterm/xterm.min.js?v=home1"></script>
|
||||
<script src="/vendor/xterm/xterm-addon-fit.min.js?v=home1"></script>
|
||||
<script src="/app.js?v=labelpipes2"></script>
|
||||
<script src="/app.js?v=labelpipes3"></script>
|
||||
<script src="/ops.js?v=opsfde2"></script>
|
||||
<script src="/ssh.js?v=fabric4"></script>
|
||||
<script src="/rdp.js?v=fabric4"></script>
|
||||
|
||||
Reference in New Issue
Block a user