diff options
| author | tv <tv@krebsco.de> | 2026-10-31 20:54:02 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 20:54:02 +0100 |
| commit | cdcad619036aa04d48ad0925b507c25d86decdac (patch) | |
| tree | 98fa23b674fec8c167f6b630873cc3adbff19241 /src/api | |
| parent | fb20fcc6d1036fe6de86f2b4388fb55951d9c6ac (diff) | |
dashboard: draw RTT near the measuring node
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/dashboard/dashboard.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/dashboard/dashboard.html b/src/api/dashboard/dashboard.html index 8f0f409..f45ded3 100644 --- a/src/api/dashboard/dashboard.html +++ b/src/api/dashboard/dashboard.html @@ -647,8 +647,11 @@ function renderGraph() { descriptions.push(description); children.push(drawnLine); if (typeof line.rttMs === "number") { - // The one in use at the middle, larger; the others further along, beside theirs. - const t = line.used ? .5 : .3; + // Near the end that measured it (`a`, whose report is drawn), clear of its + // node and name, and short of the middle: the one in use larger, the others + // closer still, beside theirs. + const along = Math.min(length / 2, Math.max(36, length * .3)); + const t = (line.used ? along : Math.max(24, along * .6)) / length; const out = line.used ? -4 : Math.sign(side) * 9; const label = drawing("rtt " + key + " " + i, "text", upright({ x: p.x + (q.x - p.x) * t + ox + nx * out, |
