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/05/20 03:44:47 UTC

[GitHub] [incubator-echarts] Ovilia opened a new pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Ovilia opened a new pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669


   <!-- 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?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   Hide labels when markArea is not inside grid
   
   ### Fixed issues
   
   - #12591: The presentation problem of markArea labels when scrolling
   
   ## Details
   
   ### Before: What was the problem?
   
   MarkArea label is displayed when the markArea is outside of grid.
   
   <img width="383" alt="屏幕快照 2020-05-20 11 42 58" src="https://user-images.githubusercontent.com/779050/82402526-2fbae600-9a8f-11ea-9a04-dd3ce2f312e5.png">
   
   
   
   ### After: How is it fixed in this PR?
   
   MarkArea label is not displayed when the markArea is outside of grid.
   
   <img width="378" alt="屏幕快照 2020-05-20 11 42 37" src="https://user-images.githubusercontent.com/779050/82402491-174acb80-9a8f-11ea-920c-0d7f99ab4503.png">
   
   
   
   
   ## 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
   


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



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


[GitHub] [incubator-echarts] nguyencuongabcxyz commented on pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
nguyencuongabcxyz commented on pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669#issuecomment-692506503


   Hi team,
   After upgrading to Echarts 4.9.0, The fix from this branch has removed my expected behavior for mark area. Before 4.9.0, when I zoomed in at the mark area till its border exceeded the grid, I still saw the mark area background and its label. But now, at Echarts 4.9.0, the mark area will completely disappear. I think it's a bug from this fix. What do you guys think?


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



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


[GitHub] [incubator-echarts] zhouping3 commented on pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
zhouping3 commented on pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669#issuecomment-694752319


   Echarts 4.9.0, the mark area will disappear when i scroll the bar


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



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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669#issuecomment-668956358


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


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



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


[GitHub] [incubator-echarts] pissang merged pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
pissang merged pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669


   


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



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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on pull request #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669#issuecomment-631218180


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/incubator-echarts/wiki/How-to-make-a-pull-request).


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



---------------------------------------------------------------------
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 #12669: fix(markArea): hide labels when markArea is not inside grid #12591

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #12669:
URL: https://github.com/apache/incubator-echarts/pull/12669#discussion_r465055401



##########
File path: src/component/marker/MarkAreaView.js
##########
@@ -208,9 +208,35 @@ MarkerView.extend({
         // Update visual and layout of line
         areaData.each(function (idx) {
             // Layout
-            areaData.setItemLayout(idx, zrUtil.map(dimPermutations, function (dim) {
+            var points = zrUtil.map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
-            }));
+            });
+            // If none of the area is inside coordSys, allClipped is set to be true
+            // in layout so that label will not be displayed. See #12591
+            var allClipped = true;
+            zrUtil.each(dimPermutations, function (dim) {
+                if (!allClipped) {
+                    return;
+                }
+                var xValue = areaData.get(dim[0], idx);
+                var yValue = areaData.get(dim[1], idx);
+                var xScale = coordSys.getAxis('x').scale;
+                var yScale = coordSys.getAxis('y').scale;
+                var xExtent = xScale.getExtent();
+                var yExtent = yScale.getExtent();
+                var x = xScale.parse(xValue);
+                var y = yScale.parse(yValue);
+                // If is infinity, the axis should be considered not clipped
+                if ((isInifinity(x) || x >= xExtent[0] && x <= xExtent[1])

Review comment:
       There is a builtin method to check if value is in the extent
   ```js
   coordSys.getAxis('x').containData(xValue)
   coordSys.getAxis('y').containData(yValue)
   ```




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



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