Skip to content
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

Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. (3) Should no dataZoom filtering when toolbox.feature.dataZoom not declared. #15015

Merged
merged 3 commits into from
May 31, 2021

Conversation

100pah
Copy link
Member

@100pah 100pah commented May 22, 2021

(1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1
(2) stack sum eliminate floating arithmetic problem.

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

fix:

  • number getPrecisionSafe incorrect on scientific notation like 3.45e-1
  • Fix the result of getPrecision and use getPrecision instead of getPrecisionSafe.
  • stack sum eliminate floating arithmetic problem.
  • If toolbox declared but toolbox.feature.dataZoom not declared, should no dataZoom filter performed.

Fix #14668

Test cases

<test/axis-filter-extent2.html>
<test/ut/spec/util/number.ts>

(1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1
(2) stack sum eliminate floating arithmetic problem.
@echarts-bot
Copy link

echarts-bot bot commented May 22, 2021

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

@100pah 100pah changed the title fix: Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. May 22, 2021
* See <http://0.30000000000000004.com/>
*/
export function addSafe(val0: number, val1: number): number {
const maxPrecision = Math.max(getPrecisionSafe(val0), getPrecisionSafe(val1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use ROUND_SUPPORTED_PRECISION_MAX in the

export function getPrecision(val: string | number): number {

to avoid infinity loop? That method is much faster.

@100pah 100pah changed the title Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. (3) Should no dataZoom filtering when toolbox.feature.dataZoom not declared. May 31, 2021
@100pah 100pah merged commit 0d4758b into master May 31, 2021
@echarts-bot
Copy link

echarts-bot bot commented May 31, 2021

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@pissang pissang deleted the fix/stack-miss-data branch July 22, 2021 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some data missed in Echarts Stacked Area Graphs
2 participants