zettca opened a new pull request, #19847:
URL: https://github.com/apache/echarts/pull/19847

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   
   ### What does this PR do?
   
   - Replaces global `isFinite` with `Number.isFinite` and unary (`+`) with 
`Number()` conversion so that a simple chart doesn't blow up when passing in a 
`BigInt`
   
   ### ~Fixed~ Related issues
   
   - Related to #19237 (addresses a small part of it)
   
   ## Details
   
   ### Before: What was the problem?
   
   When passing a `BigInt` data column to a chart
   
   ```
   Uncaught TypeError: Cannot convert a BigInt value to a number
       at isFinite (<anonymous>)
       at detectValue (chunk-TNIQ5HHQ.js?v=9ea597be:5513:25)
       at doGuessOrdinal (chunk-TNIQ5HHQ.js?v=9ea597be:5494:21)
       at guessOrdinal (chunk-TNIQ5HHQ.js?v=9ea597be:5434:10)
       at new SourceImpl2 (chunk-TNIQ5HHQ.js?v=9ea597be:5538:17)
       at createSource (chunk-TNIQ5HHQ.js?v=9ea597be:5555:16)
   ```
   
   
![image](https://github.com/apache/echarts/assets/638946/c0661a57-f6d4-41d3-90f5-3347c634bbe6)
   
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. 
-->
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   Chart is rendered without crashing 🚀 
   
   ## 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
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   
   Please let me know if you'd like me to address some of the conversion issues 
in other places of the codebase too. That would require quite a few changes 
thought; I've kept this PR small to increase its chances of being merged
   
   Thank you 🙏 


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