* Round a peak value up to the nearest multiple of 4, with a floor of 4. * Keeps the graph y-axis stable across small fluctuations. * @param {number} peak
(peak)
| 28 | * @param {number} peak |
| 29 | */ |
| 30 | function roundPeak(peak) { |
| 31 | const rounded = Math.ceil(peak / 4) * 4; |
| 32 | return rounded < 4 ? 4 : rounded; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Draw the stacked frame-time sparkline (update + draw). |
no test coverage detected