You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "linghaoSu (via GitHub)" <gi...@apache.org> on 2023/07/01 16:23:09 UTC

[GitHub] [echarts] linghaoSu opened a new pull request, #18835: fix(select): fix selection key get, use id before use name

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

   <!-- 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?
   
   Using id before name as selection key, to avoid want to select only one, but other element with same name has selected too.
   
   **But I'm not sure this is an appropriate way to go about modifying the base selection method**
   
   <img width="1057" alt="image" src="https://github.com/apache/echarts/assets/56526981/0978d4f6-8a6d-4ada-b0ac-ce6bad1dd755">
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   
   - fix #18794
   
   
   ## Details
   
   ### Before: What was the problem?
   Want to select only one, but other element with same name has selected too.
   
   <img width="1057" alt="image" src="https://github.com/apache/echarts/assets/56526981/0978d4f6-8a6d-4ada-b0ac-ce6bad1dd755">
   
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   Using id before name as selection key, can select element more specified.
   
   <img width="1633" alt="image" src="https://github.com/apache/echarts/assets/56526981/18bfd0ad-1ad4-4d78-95d8-b2188ad6e81c">
   
   
   and only these visual regression test not passed
   
   <img width="362" alt="image" src="https://github.com/apache/echarts/assets/56526981/45bf6412-801a-4685-9f0e-3963ad082925">
   
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## 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
   
   - [ ] 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] linghaoSu commented on pull request #18835: fix(select): fix selection key get, use id before use name

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

   > According to [this review comment](https://github.com/apache/echarts/pull/17281#issuecomment-1168862346), checking id before name is not correct. As for our case, are the elements of the same x value share the same name?
   
   Yes, I agree with that. We should not change the order in which the elements are fetched. For our case, elements with the same X value share the same name because they get the name from the original value of the category scale.
   
   For this example, the coordinate system consists of two category type scales, so can we make the logic of getting the names to get the original values of all the category type scales? e.g. name: `11a` -> `11a_Sunday`
   
   Not sure it's the right thing to do, but it's a change that gets the behavior right. [code](https://github.com/linghaoSu/echarts/pull/1/files)
   
   <img width="1798" alt="image" src="https://github.com/apache/echarts/assets/56526981/3ef771b1-c726-49c8-8ca7-fd1bdad2e776">
   
   The current approach only works for the current scenario, and is still unavoidable for scenarios with duplicate data in a single category type scale
   
    <img width="1781" alt="image" src="https://github.com/apache/echarts/assets/56526981/c1cd5043-bee0-4fe4-a875-bae0d3552f39">
   
   [sample](https://echarts.apache.org/examples/zh/editor.html?c=bar-background&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdAtWAuiQC-fdORz4iqUmUo1ZAN0YANkq0Dk6weFRGVISwovzEnoLCYgCMAEwADDywmVmwKQCseQAceQDseSkplQDMlZk2YZ4U1HQARowcvPHoEQFU9CwCUgI-tHgQ0Kz93Z494VT9g-7z6BAsALYmFP0riYltnKMcAMLAAZx0HBqz-6SHHMeqEAJg2kQ1q7D2847zeNpgAB3ABCjHoAGtWBxgJYBEQwBwlE17uCoTC4dtyLsEnd6OdLrIOKwOgAKFKlbIUyqU2AZAB0aQAlCF9j9POzYHZ7ABuIA)
   
   


-- 
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 #18835: fix(select): fix selection key get, use id before use name

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

   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] github-actions[bot] commented on pull request #18835: fix(select): fix selection key get, use id before use name

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

   <!-- ECHARTS_PR_PREVIEW -->
   The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-18835@c3771f5
   <!-- 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


[GitHub] [echarts] Ovilia commented on pull request #18835: fix(select): fix selection key get, use id before use name

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

   Data/series with the same name are expected to be focused/blurred at the same time. So don't worry about that.
   
   I'm not sure if we could change like https://github.com/linghaoSu/echarts/pull/1/files @100pah Can you give some suggestion?
   


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