From aef22c614d5e5fc4f3c9b0c71ee0faac3c579b21 Mon Sep 17 00:00:00 2001 From: Heidi Date: Sat, 16 May 2026 08:05:40 +0100 Subject: [PATCH] update viewers page --- src/App.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index d27fa42..d157cce 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2596,10 +2596,14 @@ function LocationSignalMap({ countries, locations }) { const { layer } = markersRef.current layer.clearLayers() + const scaleMarkerRadius = (visitors, minRadius, maxRadius) => { + const count = Math.max(0, Number(visitors || 0)) + const normalized = Math.log1p(count) / Math.log1p(maxMarkerVisitors) + return minRadius + normalized * (maxRadius - minRadius) + } countryMarkers.forEach((country) => { - const share = Number(country.visitors || 0) / maxMarkerVisitors - const radius = 8 + Math.sqrt(share) * 34 + const radius = scaleMarkerRadius(country.visitors, 8, 24) L.circleMarker([country.lat, country.lon], { color: '#e82517', fillColor: '#e82517', @@ -2616,8 +2620,7 @@ function LocationSignalMap({ countries, locations }) { }) cityMarkers.forEach((location) => { - const share = Number(location.visitors || 0) / maxMarkerVisitors - const radius = 5 + Math.sqrt(share) * 24 + const radius = scaleMarkerRadius(location.visitors, 5, 14) L.circleMarker([location.lat, location.lon], { color: '#000000', fillColor: '#000000',