plainheart commented on code in PR #17322:
URL: https://github.com/apache/echarts/pull/17322#discussion_r913580592
##########
src/scale/Log.ts:
##########
@@ -86,8 +86,9 @@ class LogScale extends Scale {
setExtent(start: number, end: number): void {
const base = this.base;
- start = mathLog(start) / mathLog(base);
- end = mathLog(end) / mathLog(base);
+ // log(-Infinity) is NaN, so safe guard here
+ start = mathLog(Math.max(0, start)) / mathLog(base);
+ end = mathLog(Math.max(0, end)) / mathLog(base);
Review Comment:
The result of `mathLog(base)` can be cached and shared via tweaking the
first line of code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]