rahul37wallst-sudo opened a new pull request, #21667:
URL: https://github.com/apache/echarts/pull/21667

   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   Fix tiny value-axis tick calculation so valid sub-`1e-20` extents do not 
collapse to zero during rounding.
   
   
   
   ### Fixed issues
   
   - #21645: `yAxis.max` smaller than about `1e-19` could trigger an assertion 
error during interval tick calculation.
   
   
   ## Details
   
   ### Before: What was the problem?
   
   For very small positive value-axis extents, such as a `yAxis.max` of 
`2.324097633474072e-20`, the tick interval calculation could request a 
precision greater than the cross-platform `toFixed(20)` limit.
   
   The shared `round` helper clamped that precision to `20`, which could 
over-round tiny values such as `3e-21` to `0`. This produced invalid 
interval/nice extent values and could trigger an assertion error in 
`IntervalScale.setConfig`, preventing the chart from rendering.
   
   
   
   ### After: How does it behave after the fixing?
   
   When the requested rounding precision is above the supported `toFixed` 
limit, `round` now returns the numeric value directly instead of clamping to 
`20` and over-rounding it.
   
   This keeps tiny positive nice intervals finite and non-zero, so value axes 
with valid small numeric extents can calculate ticks and render successfully.
   
   Added regression coverage in:
   
   - `test/ut/spec/scale/interval.test.ts`
   - `test/ut/spec/util/number.test.ts`
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   <!-- PLEASE CHECK IT AGAINST: 
<https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors>
 -->
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   
   Validation run locally:
   
   - `npx jest --config test/ut/jest.config.cjs --coverage=false --runInBand 
--runTestsByPath test/ut/spec/scale/interval.test.ts 
test/ut/spec/util/number.test.ts`
   - `npm run checktype`
   - pre-commit `npm run lint`
   - `git diff --check`
   


-- 
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]

Reply via email to