Skip to content

Commit 5854d9b

Browse files
committed
fix(proxies): keep latency sparkline within tooltip chart viewBox
Sparkline points were normalized into a 0-100 vertical space while the SVG viewBox is only 50 tall, so lower-latency samples mapped below the visible area and were clipped. Normalize into the actual 0-50 space.
1 parent 071eab1 commit 5854d9b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

components/ProxyNodeCard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ const latencyTrendData = computed(() => {
9494
const successTests = perf.history.filter((h) => h.success).length
9595
const successRate = Math.round((successTests / totalTests) * 100)
9696
97-
// Normalize to 0-100 for SVG viewBox
97+
// Normalize into the SVG coordinate space (viewBox is 100 x 50 below).
98+
// y must stay within 0-50 or the sparkline is clipped by the viewBox.
9899
const points = latencies.map((lat, i) => ({
99100
x: (i / (latencies.length - 1)) * 100,
100-
y: 100 - ((lat - min) / range) * 80 - 10, // 10-90 range to leave padding
101+
y: 50 - ((lat - min) / range) * 40 - 5, // 5-45 range to leave padding
101102
}))
102103
103104
return {

0 commit comments

Comments
 (0)