Fixed font.

This commit is contained in:
Mike Cao 2023-04-02 10:00:28 -07:00
parent 8da72a693d
commit 2713e3316a
6 changed files with 20 additions and 11 deletions

View file

@ -42,6 +42,10 @@ export const refFilter = data => {
return Object.keys(map).map(key => ({ x: key, y: map[key], w: links[key] }));
};
export const emptyFilter = data => {
return data.map(item => (item.x ? item : null)).filter(n => n);
};
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 }));