@mytec: iter10.1 ready for testing
This commit is contained in:
@@ -57,10 +57,16 @@ export default memo(function CoverageStats({ points, resolution }: CoverageStats
|
||||
const totalArea = estimateAreaKm2(points.length, resolution);
|
||||
const total = points.length;
|
||||
|
||||
const rsrpValues = points.map((p) => p.rsrp);
|
||||
const minRSRP = Math.min(...rsrpValues);
|
||||
const maxRSRP = Math.max(...rsrpValues);
|
||||
const avgRSRP = rsrpValues.reduce((a, b) => a + b, 0) / total;
|
||||
// Use reduce instead of Math.min/max spread — spread crashes on 65k+ elements
|
||||
let minRSRP = Infinity;
|
||||
let maxRSRP = -Infinity;
|
||||
let sumRSRP = 0;
|
||||
for (const p of points) {
|
||||
if (p.rsrp < minRSRP) minRSRP = p.rsrp;
|
||||
if (p.rsrp > maxRSRP) maxRSRP = p.rsrp;
|
||||
sumRSRP += p.rsrp;
|
||||
}
|
||||
const avgRSRP = sumRSRP / total;
|
||||
|
||||
// Unique sites contributing to coverage
|
||||
const uniqueSites = new Set(points.map((p) => p.siteId)).size;
|
||||
|
||||
Reference in New Issue
Block a user