Skip to content

Commit

Permalink
refactor: simpler uniqueValues
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Vettorello <[email protected]>
  • Loading branch information
monfera and markov00 committed Sep 21, 2021
1 parent 604a1e0 commit 820f3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/charts/src/utils/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function constrainPadding(

/** @internal */
export function computeOrdinalDataDomain<T>(data: T[], sorted: boolean, removeNull: boolean): T[] {
const uniqueValues = [...new Set(data.filter((d) => (removeNull ? d !== null : true)))];
const uniqueValues = [...new Set(removeNull ? data.filter((d) => d !== null) : data)];
return sorted ? uniqueValues.sort((a, b) => `${a}`.localeCompare(`${b}`)) : uniqueValues;
}

Expand Down

0 comments on commit 820f3fd

Please sign in to comment.