vega / datalib

JavaScript data utility library.
http://vega.github.io/datalib/
BSD 3-Clause "New" or "Revised" License
731 stars 133 forks source link

renaming in field definition #83

Closed pcornier closed 7 years ago

pcornier commented 7 years ago

Hi, do you plan to support renaming in field definitions? I'd like to do something like:

dl.groupby(['YEAR', {name: 'CTRY_CDE', as: 'COUNTRY_CODE'}, 'ORG']).count().execute(data);

Thank you!

jheer commented 7 years ago

Sorry for the delayed response. Yes, you can use entries like this:

dl.groupby(['YEAR', {get: dl.$('CTRY_CDE'), name: 'COUNTRY_CODE'}, 'ORG']).count().execute(data);