()
| 2868 | // Draw the passive survey into one canvas. The in-page chart and the |
| 2869 | // full-screen console differ only in scale, so they share this — `big` bumps |
| 2870 | // type and padding for the large surface. Every AP's plotted box is recorded on |
| 2871 | // the canvas (`_wifiHits`) together with the plot geometry (`_wifiGeom`), which |
| 2872 | // is what lets hover and click map a pixel back to a BSSID. |
| 2873 | function _wifiDrawSpectrumInto(canvas, opts) { |
| 2874 | const d = _wifiState.data; if (!d || !canvas) return; |
| 2875 | const o = opts || {}; |
| 2876 | const K = o.big ? 1.3 : 1; // type / padding scale |
| 2877 | const dpr = window.devicePixelRatio || 1; |
| 2878 | const W = canvas.clientWidth, H = Math.round(o.height || canvas.clientHeight || 360); |
| 2879 | if (W < 20 || H < 20) return; |
| 2880 | canvas.width = W * dpr; canvas.height = H * dpr; |
| 2881 | canvas._wifiHits = []; |
| 2882 | const ctx = canvas.getContext('2d'); ctx.setTransform(dpr, 0, 0, dpr, 0, 0); |
| 2883 | ctx.clearRect(0, 0, W, H); |
| 2884 | const padL = Math.round(40 * K), padR = Math.round(12 * K), |
no test coverage detected