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 2022/06/15 02:35:37 UTC

[GitHub] [echarts] jiawulin001 opened a new pull request, #17217: fix: fix the error caused by setting markArea x/y

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

   <!-- 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 ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   Fix the error that occurs when declaring area with x/y in `markArea`
   
   
   ### Fixed issues
   
   
   - #5832
   - #7055
   - #10074
   
   
   
   ## Details
   
   ### Before: What was the problem?
   
   As is described in issues, when setting x and y to denote an area for `markArea`, the error occurs. This is caused becasue `lt` and `rb` returned by `dataTransform()` has no attribute `coord` when user does not specify `coord` in `markArea.data`. So when running the following code, Echarts reads `lt.coord` and throw an error.
   https://github.com/apache/echarts/blob/11a9247e7fab2e6ff9c60b545ba775e8c1b2412f/src/component/marker/MarkAreaView.ts#L69-L79
   ![image](https://user-images.githubusercontent.com/14244944/173723997-ebc8e78e-4a1a-4e2f-9a27-3f9b6a9605b6.png)
   
   
   ### After: How does it behave after the fixing?
   
   Now before `dataTransform()` return an `item`, a check is added and make sure there's a `coord` attribute in it (even `coord` is not needed). And there will be no errors caused by this.
   
   ## 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
   
   - [x] Please squash the commits into a single one when merging.
   
   ### 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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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 #17217: fix: fix the error caused by setting markArea x/y

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

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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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 #17217: fix(marker): fix `markArea` doesn't show when using `x/y` pixel but `coord` is not defined

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

   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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] plainheart commented on a diff in pull request #17217: fix(marker): fix `markArea` doesn't show when using `x/y` pixel but `coord` is not defined

Posted by GitBox <gi...@apache.org>.
plainheart commented on code in PR #17217:
URL: https://github.com/apache/echarts/pull/17217#discussion_r1018797161


##########
src/component/marker/markerHelper.ts:
##########
@@ -147,6 +147,9 @@ export function dataTransform(
             item.coord = coord;
         }
     }
+    if (item.coord == null) {
+        item.coord = [];

Review Comment:
   I think it's fine to return an empty array. But I found another potential bug when `coord` includes the special type string like [`min/max/median/average`](https://echarts.apache.org/zh/option.html#series-bar.markArea.data:~:text=%7D%0A%20%20%20%20%5D%2C%20%5B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20name%3A%20%27-,%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE%E8%8C%83%E5%9B%B4%E5%8C%BA%E9%97%B4,-%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20coord%3A%20%5B). Just fixed it and added a test case.



-- 
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: commits-unsubscribe@echarts.apache.org

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] Ovilia commented on a diff in pull request #17217: fix: fix the error caused by setting markArea x/y

Posted by GitBox <gi...@apache.org>.
Ovilia commented on code in PR #17217:
URL: https://github.com/apache/echarts/pull/17217#discussion_r978246509


##########
src/component/marker/markerHelper.ts:
##########
@@ -147,6 +147,9 @@ export function dataTransform(
             item.coord = coord;
         }
     }
+    if (item.coord == null) {
+        item.coord = [];

Review Comment:
   I'm not sure but returning an array with 0 element doesn't seem to be *valid* by logic for the `coord`. What do you think if it returns `[null, null]`? Can you help test if it works?



-- 
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: commits-unsubscribe@echarts.apache.org

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] plainheart merged pull request #17217: fix(marker): fix `markArea` doesn't show when using `x/y` pixel but `coord` is not defined

Posted by GitBox <gi...@apache.org>.
plainheart merged PR #17217:
URL: https://github.com/apache/echarts/pull/17217


-- 
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: commits-unsubscribe@echarts.apache.org

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