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

[PR] Aria omit columns [echarts]

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

   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [x] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   Allows omitting columns from the data in aria-label. 
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   All data was present in the aria-label. My use case was for a map chart, where the coordinates should be excluded.
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   Add column indexes to be excluded to aria.data.columnsToExclude and they will not appear in the data in aria.label.
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] This PR doesn't relate to document changes
   - [x] 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


Re: [PR] Aria omit columns [echarts]

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

   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).
   
   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


-- 
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] Aria omit columns [echarts]

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

   <!-- ECHARTS_PR_PREVIEW -->
   The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20038@a67fd83
   <!-- 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] Aria omit columns [echarts]

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

   Yes, that should be good.


-- 
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] Aria omit columns [echarts]

Posted by "semla (via GitHub)" <gi...@apache.org>.
semla commented on code in PR #20038:
URL: https://github.com/apache/echarts/pull/20038#discussion_r1692895619


##########
src/visual/aria.ts:
##########
@@ -218,11 +218,13 @@ export default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) {
 
                     const middleSeparator = labelModel.get(['data', 'separator', 'middle']);
                     const endSeparator = labelModel.get(['data', 'separator', 'end']);
+                    const columnsToExclude = labelModel.get(['data', 'columnsToExclude']);
                     const dataLabels = [];
                     for (let i = 0; i < data.count(); i++) {
                         if (i < maxDataCnt) {
                             const name = data.getName(i);
-                            const value = data.getValues(i);
+                            const value = !columnsToExclude ? data.getValues(i)
+                                : data.getValues(i).filter((value, j) => !columnsToExclude?.includes(j));

Review Comment:
   [50339df](https://github.com/apache/echarts/pull/20038/commits/50339df94a089d3c055aae8fdc11e2ed9c495fec)



-- 
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] Aria omit columns [echarts]

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

   > Is this PR ready for review?
   
   I think so


-- 
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] Aria omit columns [echarts]

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

   https://github.com/apache/echarts/pull/20218


-- 
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] Aria omit columns [echarts]

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on code in PR #20038:
URL: https://github.com/apache/echarts/pull/20038#discussion_r1692423683


##########
src/visual/aria.ts:
##########
@@ -218,11 +218,13 @@ export default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) {
 
                     const middleSeparator = labelModel.get(['data', 'separator', 'middle']);
                     const endSeparator = labelModel.get(['data', 'separator', 'end']);
+                    const columnsToExclude = labelModel.get(['data', 'columnsToExclude']);
                     const dataLabels = [];
                     for (let i = 0; i < data.count(); i++) {
                         if (i < maxDataCnt) {
                             const name = data.getName(i);
-                            const value = data.getValues(i);
+                            const value = !columnsToExclude ? data.getValues(i)
+                                : data.getValues(i).filter((value, j) => !columnsToExclude?.includes(j));

Review Comment:
   Use `zrUtil.filter` and `zrUtil.indexOf` instead.



##########
src/util/types.ts:
##########
@@ -1733,7 +1733,8 @@ export interface AriaLabelOption {
         separator?: {
             middle?: string;
             end?: string;
-        }
+        },
+        columnsToExclude?: number[]

Review Comment:
   I see other places in the code use `excludeSeriesId`, so perhaps here we should use `excludeDataId` instead.



-- 
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] Aria omit columns [echarts]

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia closed pull request #20038: Aria omit columns
URL: https://github.com/apache/echarts/pull/20038


-- 
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] Aria omit columns [echarts]

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

   > There seems to be a lot of commits included in this PR. Please make sure you merged master correctly.
   
   How about I delete this PR and create a new "clean" one?


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