You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "WojciechKrakowiak (via GitHub)" <gi...@apache.org> on 2024/08/12 13:21:35 UTC

[PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

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

   **Please review if the gap change between the labels and visual map is acceptable**
   
   ## 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. -->
   It switches visualMap handle label vertical align property basing on the visual map orientation and layout.
   
   
   ### Fixed issues
   
   - #20248  
   
   
   ## Details
   
   ### Before: What was the problem?
   
   Label for handle at minimum position collides with the handle. The reason is that the distance between label and handle is based on the handle size and it changes depending on handle position. Currently label has always verticalAlign set to "middle", which is the cause of the collision (when distance is less than the half of the label height, the items collide). For labels below, vertical align could be "top" and for labels above, vertical align could be "bottom".
   
   <img width="1103" alt="before" src="https://github.com/user-attachments/assets/7bf2b7c9-ee11-4268-8432-42b3a59d3543">
   
   
   ### After: How does it behave after the fixing?
   
   The fix is changing the verticalAlign of the label basing on the layout:
   - middle (as it was) for vertical visualMap
   - top for horizontal visualMap with labels below
   - bottom for horizontal visualMap with labels above
   
   this behavior matches the setting of the text (horizontal) align. The thing to consider is the bigger gap for bigger handle.
   
   <img width="1103" alt="Screenshot 2024-08-12 at 15 02 26" src="https://github.com/user-attachments/assets/43f3af76-2ca5-47c7-9175-317417462bf4">
   
   
   
   ## 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
   
   - visualMap-layout.html – duplicated cases for color visualMap, to cover all cases for size visualMap
   - visualMap-continuous.html – added a case that gathers color and size visualMap in all positions on single chart (the case presented in examples)
   
   
   ## Others
   
   ### Merging options
   
   - [ ] 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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "WojciechKrakowiak (via GitHub)" <gi...@apache.org>.
WojciechKrakowiak commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2285890039

   Better review the test file changes with the ignore of the whitespace enabled (refactor affected the indentations).


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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2283978977

   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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia merged PR #20249:
URL: https://github.com/apache/echarts/pull/20249


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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "WojciechKrakowiak (via GitHub)" <gi...@apache.org>.
WojciechKrakowiak commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2285886622

   > It seems to break down some default label positions. You may check them by running `npm run test:visual` and run the demos containing "visualMap".
   > 
   > <img alt="image" width="935" src="https://private-user-images.githubusercontent.com/779050/357308988-191c92f1-4f74-4b57-b634-f94ff52a5098.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1NDM5MTksIm5iZiI6MTcyMzU0MzYxOSwicGF0aCI6Ii83NzkwNTAvMzU3MzA4OTg4LTE5MWM5MmYxLTRmNzQtNGI1Ny1iNjM0LWY5NGZmNTJhNTA5OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgxM1QxMDA2NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYzk2Y2QxMmRhMGU4YWE2ZjgyNWJmMjBjMTEyZTQ0MDJjYTUwMmFiZmQzODJjZTYzZWQ5YjNlZDFlYmQ1OTRkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Pf5oi8U8LLDq4ufmer-I_Ey_MJzbpHZZUylwqe7zlkg">
   
   Thank you for quick review. I implemented other solution, that affects only cases, where the labels collide. I updated the description and the screenshots.
   
   I also noticed, that visualMap-continuous displays only one case in automated tests (while the file consists of 5 tests now). I fixed that issue, by changing the container height from relative to absolute (also did some minor refactor of the test code).
   
   BEFORE (only first test case rendered):
   ![Screenshot 2024-08-13 at 12 02 41](https://github.com/user-attachments/assets/fc9183e6-01ec-4c1a-92c8-d23a78c47855)
   
   AFTER (all test cases rendered):
   ![Screenshot 2024-08-13 at 12 03 53](https://github.com/user-attachments/assets/53df011b-7c2f-48a5-a9d4-303dda891bec)
   


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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2285488880

   The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20249@3ad256a
   <!-- ECHARTS_PR_PREVIEW -->


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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "WojciechKrakowiak (via GitHub)" <gi...@apache.org>.
WojciechKrakowiak commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2416598873

   @Ovilia is there anything more I should do, or anyone I should consult with regarding these changes?


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


Re: [PR] fix(visualMap): handle label collides with horizontal size visualMap [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #20249:
URL: https://github.com/apache/echarts/pull/20249#issuecomment-2418993738

   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