-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(log): allows zero and negativ values #20266
Conversation
Thanks for your contribution! To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: This message is shown because the PR description doesn't contain the document related template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logarithms of zero and negative numbers are not defined in the real numbers. So I don't think it's proper to support this.
I understand this. It was the minimal change to support it. scale/Log.ts:{setExtent,unionExtent,contain,normalize} If yes, how should it be done ? create a function ? programm it out ? regards. |
After thinking about it ... What about naming the function in util/math.ts 'symlog' or 'synmetricLog' and use it only where it's needed in: regards. |
Could you be more specific about in what scenerio do you need this feature? |
I will prepare an example. |
Here the example. The chart is more compact with 'log'. regars |
I have done some test. Modifiy 'log' is not the solution, what I really want is 'logvalue' regards. |
There are problems when using axis of type 'log' with zero and negative values.
This change allow zero and negative values, when useing type 'log' for an axis.
src/coord/axisAlignTicks.ts and src/scale/Log.ts will use log() as mathLog from src/util/math.ts.