Ovilia commented on code in PR #17061:
URL: https://github.com/apache/echarts/pull/17061#discussion_r940875871
##########
src/scale/Log.ts:
##########
@@ -97,15 +109,17 @@ class LogScale extends Scale {
getExtent() {
const base = this.base;
const extent = scaleProto.getExtent.call(this);
- extent[0] = mathPow(base, extent[0]);
- extent[1] = mathPow(base, extent[1]);
// Fix #4158
const originalScale = this._originalScale;
const originalExtent = originalScale.getExtent();
- this._fixMin && (extent[0] = fixRoundingError(extent[0],
originalExtent[0]));
- this._fixMax && (extent[1] = fixRoundingError(extent[1],
originalExtent[1]));
-
+ // To get extent without precision problem, get the original extent
directly
+ extent[0] = (extent[0] === mathLog(originalExtent[0]) / mathLog(base))
Review Comment:
Comparing floating number with `extent[0] === mathLog(originalExtent[0]` may
cause precision problems. And can you explain why do you remove `this._fixMin`
here?
--
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]