You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/03/03 05:43:03 UTC

[GitHub] [incubator-echarts] pissang commented on a change in pull request #10221: Fix #10210 wrong color of piecewise visualMap with scatter charts

pissang commented on a change in pull request #10221: Fix #10210 wrong color of piecewise visualMap with scatter charts
URL: https://github.com/apache/incubator-echarts/pull/10221#discussion_r386798880
 
 

 ##########
 File path: src/data/helper/sourceHelper.js
 ##########
 @@ -664,14 +664,12 @@ function doGuessOrdinal(
     }
 
     function detectValue(val) {
-        var beStr = isString(val);
-        // Consider usage convenience, '1', '2' will be treated as "number".
-        // `isFinit('')` get `true`.
-        if (val != null && isFinite(val) && val !== '') {
-            return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;
-        }
-        else if (beStr && val !== '-') {
-            return BE_ORDINAL.Must;
+        // For string, assign its type to 'ordinal'
+        if (isString(val)) {
+            return true;
+        }
+        else if (val != null && isNaN(val)) {
+            return false;
 
 Review comment:
   I'd prefer solution A for this fix.  
   
   Solution B is a more complex fix we need to do to solve similar issues. I think we need to do do some abstraction to connect between the visualMap(or other components needs dimension info) and the data storage. For example visualMap declares it needs to take the second dimension of all series and treat it as a category data. Then we can get this info when we are trying to guess if the dimension is ordinal in initializing the data storage.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org