Skip to content

Commit

Permalink
debug 20265
Browse files Browse the repository at this point in the history
  • Loading branch information
linlang171 committed Dec 8, 2024
1 parent 083eb3b commit 2cd49f2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/scale/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ export function contain(val: number, extent: [number, number]): boolean {
}

export function normalize(val: number, extent: [number, number]): number {
if (isNaN(val)) {
return NaN;
}
if (extent[1] === extent[0]) {
return 0.5;
return isNaN(val) ? NaN : 0.5;
}
return (val - extent[0]) / (extent[1] - extent[0]);
}
Expand Down

0 comments on commit 2cd49f2

Please sign in to comment.