mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Localized country names.
This commit is contained in:
parent
e5cd162b83
commit
fd69f0df24
22 changed files with 69 additions and 263 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import firstBy from 'thenby';
|
||||
import { BROWSERS, ISO_COUNTRIES } from './constants';
|
||||
import { BROWSERS } from './constants';
|
||||
import { removeTrailingSlash, removeWWW, getDomainName } from './url';
|
||||
|
||||
export const urlFilter = (data, { raw }) => {
|
||||
|
|
@ -125,9 +125,6 @@ export const osFilter = data => data.filter(({ x }) => x);
|
|||
|
||||
export const deviceFilter = data => data.filter(({ x }) => x);
|
||||
|
||||
export const countryFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: ISO_COUNTRIES[x] || x, y })).filter(({ x }) => x);
|
||||
|
||||
export const percentFilter = data => {
|
||||
const total = data.reduce((n, { y }) => n + y, 0);
|
||||
return data.map(({ x, y, ...props }) => ({ x, y, z: total ? (y / total) * 100 : 0, ...props }));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue