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/04/18 07:59:35 UTC

[GitHub] [echarts] pissang opened a new pull request, #16903: [feature] [transform] add new aggregate transform and id transform

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

   <!-- 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?
   
   This PR migrates the aggregate and id transform from https://github.com/100pah/echarts-simple-transform , which is a experiment repo maintained by one of our maintainers @100pah.  The API design is mainly keeped same but code are refactored to be more clear and neater. 
   
   Also in this PR the old `seriesLayoutBy` option is renamed to `sourceLayout` to be more clear.
   
   ## Details
   
   ### Aggregate transform
   
   ```ts
   const option = {
       dataset: [{
           source: [
               ['aa', 'bb', 'cc', 'tag'],
               [12, 0.33, 5200, 'AA'],
               [21, 0.65, 7100, 'AA'],
               [51, 0.15, 1100, 'BB'],
               [71, 0.75, 9100, 'BB'],
               ...
           ]
       }, {
           transform: {
               type: 'aggregate',
               config: {
                   output: [
                       // by default, use the same name with `from`.
                       { from: 'aa', method: 'sum' },
                       { from: 'bb', method: 'count' },
                       { from: 'cc' }, // method by default: use the first value.
                       { from: 'dd', method: 'Q1' },
                       { from: 'tag' }
                   ],
                   groupBy: 'tag'
               }
           }
           // Then the result data will be:
           // [
           //     ['aa', 'bb', 'cc', 'tag'],
           //     [12, 0.33, 5200, 'AA'],
           //     [21, 0.65, 8100, 'BB'],
           //     ...
           // ]
       }],
       // ...
   };
   ```
   
   ### ID transform
   ```ts
   const option = {
       dataset: [{
           source: [
               ['aa', 'bb', 'cc', 'tag'],
               [12, 0.33, 5200, 'AA'],
               [21, 0.65, 8100, 'AA'],
               ...
           ]
       }, {
           transform: {
               type: 'id',
               config: {
                   dimensionIndex: 4,
                   dimensionName: 'ID'
               }
           }
           // Then the result data will be:
           // [
           //     ['aa', 'bb', 'cc', 'tag', 'ID'],
           //     [12, 0.33, 5200, 'AA', 0],
           //     [21, 0.65, 8100, 'BB', 1],
           //     ...
           // ]
       }],
       // ...
   };
   ```
   
   ## Misc
   
   <!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
   
   - [x] The API has been changed (apache/echarts-doc#xxx).
   - [ ] 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] echarts-bot[bot] commented on pull request #16903: [feature] [transform] add new aggregate transform and id transform

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

   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).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.
   
   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