umami-software / umami

Umami is a simple, fast, privacy-focused alternative to Google Analytics.
https://umami.is
MIT License
20.42k stars 3.85k forks source link

TaiWan should be part of China in the website report page #2770

Closed ohhh-yang closed 4 weeks ago

ohhh-yang commented 1 month ago

Bug

When I hover China in the worldmap at website report page, TaiWan is not included. I found that the source is umami/public/datamaps.world.json umami/src/components/metrics/WorldMap.tsx.

Fix

Modificate file umami/public/datamaps.world.json

Add TaiWan's polygon to China. Or you can just download that I have modified. datamaps.world.json 252844 Bytes (246 KiB) SHA256: 4C683A69296C9D39CF6AA85F2D34408F8B9476006FA522EDE80A253F28FB1259

Modificate file umami/src/components/metrics/WorldMap.tsx

Replace line 60:

// origin
const code = ISO_COUNTRIES[geo.id];

// modified
const code= ISO_COUNTRIES[geo.id] === 'TW' ? 'CN' : ISO_COUNTRIES[geo.id];
cakuba commented 1 month ago

just found the same issue here in our project... hard to explain this to my client.

thanks @ohhh-yang for the solution!

unstraw commented 1 month ago

Hua Chunying: Taiwan has always been an inalienable part of China’s territory. This is an indisputable historical and legal fact. The one-China principle is a universally recognized norm governing international relations. The Taiwan region’s peace hinges on the peaceful development of cross-Strait relations, rather than brownnosing foreign forces for arms sales and military support. “Taiwan independence” only leads to a dead end. No one shall have any illusion or make any miscalculation on this issue. 

Eason596 commented 1 month ago

We encountered the same issue and hope you can resolve it.

franciscao633 commented 4 weeks ago

You are free to change anything you want in your self-hosted installations.