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/10 13:19:29 UTC

[GitHub] [incubator-echarts] cuijian-dexter opened a new pull request #12266: Fix#12164 Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in

cuijian-dexter opened a new pull request #12266: Fix#12164  Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in
URL: https://github.com/apache/incubator-echarts/pull/12266
 
 
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ 1 ] bug fixing
   - [ 0 ] new feature
   - [ 0 ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Usage
   
   ### Are there any API changes?
   
   - [ ] The API has been changed.
   
   <!-- LIST THE API CHANGES HERE -->
   
   
   
   ### Related test cases or examples to use the new APIs
   
   NA.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   
   [https://github.com/apache/incubator-echarts/issues/12164](url)
   

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


[GitHub] [incubator-echarts] pissang commented on a change in pull request #12266: Fix#12164 Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #12266: Fix#12164  Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in
URL: https://github.com/apache/incubator-echarts/pull/12266#discussion_r392563759
 
 

 ##########
 File path: src/chart/line/lineAnimationDiff.js
 ##########
 @@ -166,6 +166,13 @@ export default function (
 
     // Diff result may be crossed if all items are changed
     // Sort by data index
+    for (var i = rawIndices.length - 1; i >= 0; i--) {
+        for (var j = 0; j < rawIndices.length; j++) {
+            if (rawIndices[i] === rawIndices[j]) {
+                rawIndices.splice(i, 1);
+            }
+        }
+    }
 
 Review comment:
   O(n2) algorithm may have performance issue on large data. 
   
   Also splice is usually not a performant method and can easily get logic messed up(because the array length is changed after splice). Create a new array(when necessary) is much simpler and has better performance. Check https://jsperf.com/splice-vs-filter 
   
   Since there `rawIndices` has been sorted in the following code. We can loop sortedIndices, and only compare two neighbor rawIndex to see if they are the same.

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


[GitHub] [incubator-echarts] cuijian-dexter commented on a change in pull request #12266: Fix#12164 Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in

Posted by GitBox <gi...@apache.org>.
cuijian-dexter commented on a change in pull request #12266: Fix#12164  Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in
URL: https://github.com/apache/incubator-echarts/pull/12266#discussion_r391388164
 
 

 ##########
 File path: src/chart/line/lineAnimationDiff.js
 ##########
 @@ -166,6 +166,7 @@ export default function (
 
     // Diff result may be crossed if all items are changed
     // Sort by data index
+    rawIndices =  Array.from(new Set(rawIndices));
 
 Review comment:
   OK,I will fix it

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


[GitHub] [incubator-echarts] pissang commented on a change in pull request #12266: Fix#12164 Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #12266: Fix#12164  Erroneous Behavior when displaying a line chart with multiple data pushes before updating chart data while zoomed in
URL: https://github.com/apache/incubator-echarts/pull/12266#discussion_r390926226
 
 

 ##########
 File path: src/chart/line/lineAnimationDiff.js
 ##########
 @@ -166,6 +166,7 @@ export default function (
 
     // Diff result may be crossed if all items are changed
     // Sort by data index
+    rawIndices =  Array.from(new Set(rawIndices));
 
 Review comment:
   Please don't use `Array.from` and `Set` because it's not supported in IE. See https://www.echartsjs.com/zh/coding-standard.html

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