mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 21:15:35 +01:00
Merge 8d024e2931 into 784237bfab
This commit is contained in:
commit
a1523d774c
1 changed files with 9 additions and 1 deletions
|
|
@ -21,6 +21,14 @@ export function WorldMap({ data = [], className }: { data?: any[]; className?: s
|
||||||
const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);
|
const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);
|
||||||
const metrics = useMemo(() => (data ? percentFilter(data) : []), [data]);
|
const metrics = useMemo(() => (data ? percentFilter(data) : []), [data]);
|
||||||
|
|
||||||
|
function getStrokeColor(code: string) {
|
||||||
|
if (code === 'AQ') return;
|
||||||
|
|
||||||
|
return theme === 'light'
|
||||||
|
? colors.map.strokeColor
|
||||||
|
: colord(colors.map.strokeColor).darken(0.2).toHex();
|
||||||
|
}
|
||||||
|
|
||||||
function getFillColor(code: string) {
|
function getFillColor(code: string) {
|
||||||
if (code === 'AQ') return;
|
if (code === 'AQ') return;
|
||||||
const country = metrics?.find(({ x }) => x === code);
|
const country = metrics?.find(({ x }) => x === code);
|
||||||
|
|
@ -64,7 +72,7 @@ export function WorldMap({ data = [], className }: { data?: any[]; className?: s
|
||||||
key={geo.rsmKey}
|
key={geo.rsmKey}
|
||||||
geography={geo}
|
geography={geo}
|
||||||
fill={getFillColor(code)}
|
fill={getFillColor(code)}
|
||||||
stroke={colors.map.strokeColor}
|
stroke={getStrokeColor(code)}
|
||||||
opacity={getOpacity(code)}
|
opacity={getOpacity(code)}
|
||||||
style={{
|
style={{
|
||||||
default: { outline: 'none' },
|
default: { outline: 'none' },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue