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 2021/02/25 03:34:30 UTC

[GitHub] [echarts] Nick22nd opened a new pull request #14343: fix(markArea): markArea background color disappeared. close #13647

Nick22nd opened a new pull request #14343:
URL: https://github.com/apache/echarts/pull/14343


   <!-- 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. -->
   fix markArea background color disappearing when markArea inclued selected area 
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   - #13647: When you select a area in the same color markArea, you will find the markArea background color disappear.
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   when selected area was included in markArea, then point would not meet condition that set allClipped to false. 
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   ![13647-before](https://user-images.githubusercontent.com/30228906/109098532-8101af80-775c-11eb-87ef-37b770c279e0.png)
   
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   add condition that check if rectangle of markArea intersects the rectangle of display area.
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   ![13647-after](https://user-images.githubusercontent.com/30228906/109098973-3e8ca280-775d-11eb-8d85-01f18ab2fde5.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] [echarts] susiwen8 commented on a change in pull request #14343: fix(markArea): markArea background color disappeared. close #13647

Posted by GitBox <gi...@apache.org>.
susiwen8 commented on a change in pull request #14343:
URL: https://github.com/apache/echarts/pull/14343#discussion_r582509664



##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
             const points = map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
             });
+            const xAxis = coordSys.getAxis('x').scale.getExtent();
+            const yAxis = coordSys.getAxis('y').scale.getExtent();
+            const xPoint = [coordSys.getAxis('x').scale.parse(areaData.get('x0', idx)),

Review comment:
       It's better to 'cache' `coordSys.getAxis('x').scale` and `coordSys.getAxis('y').scale`




----------------------------------------------------------------
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] [echarts] echarts-bot[bot] commented on pull request #14343: fix(markArea): markArea background color disappeared. close #13647

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


   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] [echarts] pissang commented on a change in pull request #14343: fix(markArea): markArea background color disappeared. close #13647

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



##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
             const points = map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
             });
+            const xScale = coordSys.getAxis('x').scale;
+            const yScale = coordSys.getAxis('y').scale;
+            const xAxis = xScale.getExtent();

Review comment:
       Use a more specific name here. For example `xAxisExtent`, `yAxisExtent`

##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
             const points = map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
             });
+            const xScale = coordSys.getAxis('x').scale;
+            const yScale = coordSys.getAxis('y').scale;
+            const xAxis = xScale.getExtent();
+            const yAxis = yScale.getExtent();
+            const xPoint = [xScale.parse(areaData.get('x0', idx)), xScale.parse(areaData.get('x1', idx))];
+            const yPoint = [yScale.parse(areaData.get('y0', idx)), yScale.parse(areaData.get('y1', idx))];
+            xPoint.sort();
+            yPoint.sort();

Review comment:
       There is a helper to sort an array to asc order. https://github.com/apache/echarts/blob/master/src/util/number.ts#L145
   
   Default compare function in sort will convert the values to strings and use Unicode to compare. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#parameters




----------------------------------------------------------------
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] [echarts] Nick22nd commented on a change in pull request #14343: fix(markArea): markArea background color disappeared. close #13647

Posted by GitBox <gi...@apache.org>.
Nick22nd commented on a change in pull request #14343:
URL: https://github.com/apache/echarts/pull/14343#discussion_r582567194



##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
             const points = map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
             });
+            const xScale = coordSys.getAxis('x').scale;
+            const yScale = coordSys.getAxis('y').scale;
+            const xAxis = xScale.getExtent();
+            const yAxis = yScale.getExtent();
+            const xPoint = [xScale.parse(areaData.get('x0', idx)), xScale.parse(areaData.get('x1', idx))];
+            const yPoint = [yScale.parse(areaData.get('y0', idx)), yScale.parse(areaData.get('y1', idx))];
+            xPoint.sort();
+            yPoint.sort();

Review comment:
       thanks for helping!




----------------------------------------------------------------
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] [echarts] echarts-bot[bot] commented on pull request #14343: fix(markArea): markArea background color disappeared. close #13647

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


   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] [echarts] pissang merged pull request #14343: fix(markArea): markArea background color disappeared. close #13647

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


   


----------------------------------------------------------------
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] [echarts] Nick22nd commented on a change in pull request #14343: fix(markArea): markArea background color disappeared. close #13647

Posted by GitBox <gi...@apache.org>.
Nick22nd commented on a change in pull request #14343:
URL: https://github.com/apache/echarts/pull/14343#discussion_r582565949



##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
             const points = map(dimPermutations, function (dim) {
                 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
             });
+            const xAxis = coordSys.getAxis('x').scale.getExtent();
+            const yAxis = coordSys.getAxis('y').scale.getExtent();
+            const xPoint = [coordSys.getAxis('x').scale.parse(areaData.get('x0', idx)),

Review comment:
       thanks for your advice :-)




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