Skip to content

Commit 49d45b9

Browse files
committed
fix NaN不应返回有值
debug 20265
1 parent be1028e commit 49d45b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/scale/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function normalize(
151151
// Dont use optional arguments for performance consideration here.
152152
): number {
153153
if (extent[1] === extent[0]) {
154-
return 0.5;
154+
return isNaN(val) ? NaN : 0.5;
155155
}
156156
return (val - extent[0]) / (extent[1] - extent[0]);
157157
}

0 commit comments

Comments
 (0)