Events table.

This commit is contained in:
Mike Cao 2020-08-24 23:49:14 -07:00
parent 2addb96e4b
commit 5206622d5a
13 changed files with 131 additions and 31 deletions

View file

@ -124,5 +124,5 @@ export const countryFilter = data =>
export const percentFilter = data => {
const total = data.reduce((n, { y }) => n + y, 0);
return data.map(({ x, y }) => ({ x, y, z: total ? (y / total) * 100 : 0 }));
return data.map(({ x, y, ...props }) => ({ x, y, z: total ? (y / total) * 100 : 0, ...props }));
};