declarative relay deployment on hetzner relay-eval.waow.tech
atproto relay
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

relay-eval dashboard: focus Y-axis on dense cluster

find the tightest range containing 60% of data points and use
that for the Y scale. outliers (0%, 46%) get clamped to the
bottom edge instead of compressing the 98-99% cluster into
an unreadable band.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+20 -5
+20 -5
relay-eval/src/static/index.html
··· 303 303 304 304 const pad = { t: 20, r: 20, b: 20, l: 20 }; 305 305 const cw = W - pad.l - pad.r, ch = H - pad.t - pad.b; 306 - let lo = 100, hi = 0; 306 + 307 + // collect all values to find the dense cluster for Y-axis focus 308 + const allVals = []; 307 309 for (const host of hosts) { 308 - for (const v of series[host]) { if (v != null) { if (v < lo) lo = v; if (v > hi) hi = v; } } 310 + for (const v of series[host]) { if (v != null) allVals.push(v); } 311 + } 312 + allVals.sort((a, b) => a - b); 313 + const n = allVals.length; 314 + 315 + // find the tightest range containing >= 60% of data points 316 + // this isolates the dense cluster (e.g. 98-99.5%) from outliers (0%, 46%) 317 + const winSize = Math.max(2, Math.ceil(n * 0.6)); 318 + let minSpan = Infinity, bestI = 0; 319 + for (let i = 0; i <= n - winSize; i++) { 320 + const span = allVals[i + winSize - 1] - allVals[i]; 321 + if (span < minSpan) { minSpan = span; bestI = i; } 309 322 } 310 - lo = Math.max(0, Math.floor(lo - 1)); 311 - hi = Math.min(100, Math.ceil(hi + 0.5)); 323 + let lo = Math.max(0, Math.floor(allVals[bestI] - 1)); 324 + let hi = Math.min(100, Math.ceil(allVals[bestI + winSize - 1] + 0.5)); 325 + if (hi - lo < 2) lo = Math.max(0, hi - 2); 312 326 const yr = hi - lo || 1; 313 327 314 328 const toX = i => pad.l + (i / (runs.length - 1)) * cw; 315 - const toY = v => pad.t + ch - ((v - lo) / yr) * ch; 329 + // clamp values to [lo, hi] — outliers sit at the edge 330 + const toY = v => pad.t + ch - ((Math.max(Math.min(v, hi), lo) - lo) / yr) * ch; 316 331 _tc.layout = { pad, cw, ch, lo, hi, yr, toX, toY, W, H }; 317 332 318 333 const validPts = host => series[host].map((v, i) => [i, v]).filter(p => p[1] !== null);