aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 22:56:52 +0100
committertv <tv@krebsco.de>2026-10-31 22:56:52 +0100
commit056c83d523ddb1c5d5b643ae83b94a793f5fde4a (patch)
tree3bd0f3ede9b2fae4296ea3d4312e7db291ffbd02 /src/api
parent6a7be2dc3fc2e2d24de1ebe4f28add8b68227e58 (diff)
dashboard: settle dynamic layout at once
Diffstat (limited to 'src/api')
-rw-r--r--src/api/dashboard/dashboard.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/api/dashboard/dashboard.html b/src/api/dashboard/dashboard.html
index 1b4c2ba..3e11524 100644
--- a/src/api/dashboard/dashboard.html
+++ b/src/api/dashboard/dashboard.html
@@ -675,8 +675,18 @@ function renderGraph() {
if (!nodes.includes(id)) { positions.delete(id); pinned.delete(id); }
}
const fresh = new Set(nodes.filter(id => !positions.has(id)));
- if (relayout) layout(nodes, pairs, width, height);
- else if (fresh.size > 0) layout(nodes, pairs, width, height, fresh);
+ if (relayout) {
+ layout(nodes, pairs, width, height);
+ // Dynamic: settled at once, not moving into place before one's eyes.
+ if (byRtt) {
+ for (let round = 0; round < 3000; round++) {
+ if (relax(nodes, pairs, width, height, .15, 2) <= .1) break;
+ }
+ lastLengths = pairs.map(pair => pair.join(" ")).join(",");
+ }
+ } else if (fresh.size > 0) {
+ layout(nodes, pairs, width, height, fresh);
+ }
relayout = false;
lastShape = shape;
}