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 2021/11/18 20:07:16 UTC

[GitHub] [echarts] 100pah commented on issue #16083: Efficient way to chart from a dataset that is a list of records, not a pivot table

100pah commented on issue #16083:
URL: https://github.com/apache/echarts/issues/16083#issuecomment-973218416


   @LeaVerou Thanks for the very details investigation and  description!
   
   It's a very good case that echarts should better to enhance.
   
   You mentioned
   > In the database world, it's more common to represent data as records
   
   For years the data format (both `series.data` and `dataset`) that echarts can accept are relatively "near" the display of charts but "far from" the format that users and data storage commonly used. That cause that users need to write some data transformation code themselves.
   
   Since echarts v5.0, a new mechanism [data-transform](https://echarts.apache.org/handbook/en/concepts/data-transform/#data-transform) is introduced, which aims to provide a plugin mechanism to embed data transformation code into echarts workflow, so that end users can use some transformation code (no matter from third-party or official) in out-of-box way, rather than write them themselves.
   
   But this mechanism is still at a start-up phase. The pro of the mechanism is the convenience for end user. But the con, where I am worried about IMO, might be that transformers may introduce complex configurations, which brings to users extra cost of investigating how to use them, and after that investigation, some of the users may find it's not what they want, and still need to write some transformation code to match their specific requirements.
   
   But your issue and some other relevant issues provide that there are real needs of it and we should better move forward on it, probably marking more out-of-box transformations and see what them will bring to users.
   
   ---
   
   Go back to the case:
   
   ```js
   dataset: {
   	  dimensions: [
   		    'Country', 'Year', 'Population'
   	  ],
   	  source: [
   		    ['Brazil', 2011, 18203],
   		    ['Brazil', 2012, 19325],
   		    ['Indonesia', 2011, 23489],
   		    ['Indonesia', 2012, 23438],
   		    ['USA', 2011, 29034],
   		    ['USA', 2012, 31000]
   	  ]
   },
   ```
   
   Yes, at present inside echarts there is no way to convert this format of data to its pivot table. The built-in transformers can only filter and sort, and some other transformers like [echarts-simple-transform](https://github.com/100pah/echarts-simple-transform) and only do simple aggregation by one dimension. 
   
   It's a good case that echarts probably need to add pivot table transformer to accept that kind of format.
   
   ---
   
   About detail of the implementation, I think it could be either integrated with an aggregation transformer, or standalone and possible to be piped after an aggregation transformer, taking the aggregation output (aggregated by two specified dimensions) as the input.
   
   
   
   
   


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