Localized country names.
This commit is contained in:
1 parent
e5cd162b83
commit
fd69f0df24
22 files changed
+69
-263
No files matched your search
+1
-4
@@ -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 }));
|
||||
|
||||
Reference in new issue
Block a user