(qW, qN, qE, qS)
| 139 | } |
| 140 | |
| 141 | function normalizeQValuesForDisplay(qW, qN, qE, qS) { |
| 142 | const scores = [qW, qN, qE, qS].filter(x => x != null); |
| 143 | const min = Math.min(...scores); |
| 144 | const max = Math.max(...scores); |
| 145 | |
| 146 | const normalize = q => (q - min) / (max - min); |
| 147 | return { |
| 148 | qWNormalized: qW == null ? qW : normalize(qW), |
| 149 | qNNormalized: qN == null ? qN : normalize(qN), |
| 150 | qENormalized: qE == null ? qE : normalize(qE), |
| 151 | qSNormalized: qS == null ? qE : normalize(qS) |
| 152 | }; |
| 153 | } |
| 154 | |
| 155 | function drawQValueOverlay(context, q, qNormalized, x, y, w, h) { |
| 156 | if (q == null) { |
no test coverage detected