update viewers page

This commit is contained in:
Heidi
2026-05-16 08:05:40 +01:00
parent 1505b619b1
commit aef22c614d
+7 -4
View File
@@ -2596,10 +2596,14 @@ function LocationSignalMap({ countries, locations }) {
const { layer } = markersRef.current const { layer } = markersRef.current
layer.clearLayers() 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) => { countryMarkers.forEach((country) => {
const share = Number(country.visitors || 0) / maxMarkerVisitors const radius = scaleMarkerRadius(country.visitors, 8, 24)
const radius = 8 + Math.sqrt(share) * 34
L.circleMarker([country.lat, country.lon], { L.circleMarker([country.lat, country.lon], {
color: '#e82517', color: '#e82517',
fillColor: '#e82517', fillColor: '#e82517',
@@ -2616,8 +2620,7 @@ function LocationSignalMap({ countries, locations }) {
}) })
cityMarkers.forEach((location) => { cityMarkers.forEach((location) => {
const share = Number(location.visitors || 0) / maxMarkerVisitors const radius = scaleMarkerRadius(location.visitors, 5, 14)
const radius = 5 + Math.sqrt(share) * 24
L.circleMarker([location.lat, location.lon], { L.circleMarker([location.lat, location.lon], {
color: '#000000', color: '#000000',
fillColor: '#000000', fillColor: '#000000',