update viewers page

This commit is contained in:
Heidi
2026-05-16 07:49:55 +01:00
parent 30cc816aa0
commit b1e3f764a3
2 changed files with 81 additions and 55 deletions
+1 -42
View File
@@ -2011,36 +2011,6 @@ const shortDateFormat = new Intl.DateTimeFormat('en-GB', {
month: 'short',
})
const timezoneMapPoints = {
'America/Los_Angeles': [34.05, -118.24],
'America/Denver': [39.74, -104.99],
'America/Chicago': [41.88, -87.63],
'America/New_York': [40.71, -74.01],
'America/Toronto': [43.65, -79.38],
'America/Phoenix': [33.45, -112.07],
'America/Sao_Paulo': [-23.55, -46.63],
'America/Mexico_City': [19.43, -99.13],
'Europe/London': [51.51, -0.13],
'Europe/Paris': [48.86, 2.35],
'Europe/Berlin': [52.52, 13.41],
'Europe/Madrid': [40.42, -3.7],
'Europe/Rome': [41.9, 12.5],
'Europe/Amsterdam': [52.37, 4.9],
'Europe/Stockholm': [59.33, 18.07],
'Europe/Warsaw': [52.23, 21.01],
'Europe/Moscow': [55.76, 37.62],
'Africa/Cairo': [30.04, 31.24],
'Africa/Johannesburg': [-26.2, 28.04],
'Asia/Dubai': [25.2, 55.27],
'Asia/Kolkata': [22.57, 88.36],
'Asia/Singapore': [1.35, 103.82],
'Asia/Tokyo': [35.68, 139.65],
'Asia/Seoul': [37.57, 126.98],
'Asia/Shanghai': [31.23, 121.47],
'Australia/Sydney': [-33.87, 151.21],
'Pacific/Auckland': [-36.85, 174.76],
}
const countryNames = {
AR: 'Argentina',
AU: 'Australia',
@@ -2093,17 +2063,6 @@ const countryMapPoints = {
ZA: [24, -29],
}
function timezonePoint(timezone = '') {
if (timezoneMapPoints[timezone]) return timezoneMapPoints[timezone]
if (timezone.startsWith('America/')) return [39, -96]
if (timezone.startsWith('Europe/')) return [50, 10]
if (timezone.startsWith('Africa/')) return [0, 20]
if (timezone.startsWith('Asia/')) return [34, 100]
if (timezone.startsWith('Australia/')) return [-25, 134]
if (timezone.startsWith('Pacific/')) return [-15, 170]
return [20, 0]
}
function filledLast30Days(rows) {
const byDate = new Map(rows.map((row) => [row.date, row]))
return Array.from({ length: 30 }, (_, index) => {
@@ -2432,7 +2391,7 @@ function ViewersPage({ viewers }) {
<div className="border-b border-surface px-5 py-4">
<h2 className="text-lg font-semibold">Location signals</h2>
<p className="mt-1 text-sm text-text-soft">
Country traffic when available, with timezone fallback from the last 30 days
Cloudflare edge geolocation from the last 30 days
</p>
</div>
<LocationSignalMap countries={countries} locations={locations} />