diff --git a/src/lib/getMap.ts b/src/lib/getMap.ts index ddfb09e..bada773 100644 --- a/src/lib/getMap.ts +++ b/src/lib/getMap.ts @@ -138,27 +138,22 @@ export function getMap({ return { periodMap: { data: periodArray, - list: mapUnique(periodArray).filter((x) => x !== 0), + list: [...periodCountMap.keys()].sort((a, b) => a - b), countMap: periodCountMap, }, frequencyMap: { data: frequencyArray, - list: mapUnique(frequencyArray).filter((x) => x !== 0), + list: [...frequencyCountMap.keys()].sort((a, b) => a - b), countMap: frequencyCountMap, }, heatMap: { data: heatArray, - list: mapUnique(heatArray).filter((x) => x !== -1), + list: [...heatCountMap.keys()].sort((a, b) => a - b), countMap: heatCountMap, }, }; } -function mapUnique(map: number[][]): number[] { - const set = new Set(map.flat()); - return [...set].sort((a, b) => a - b); -} - function getCountMap(map: number[][]): Map { const countMap = new Map(); for (const row of map) {