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',