src/Pivot.js
function aggregateParams(_, pulse) {
  var key    = _.field,
  value  = _.value,
      op     = (_.op === 'count' ? '__count__' : _.op) || 'sum',
      fields = accessorFields(key).concat(accessorFields(value)),
      keys   = pivotKeys(key, _.limit || 0, pulse);

  return {
    key:      _.key,
    groupby:  _.groupby,
    ops:      keys.map(function() { return op; }),
    fields:   keys.map(function(k) { return get(k, key, value, fields); }),
    as:       keys.map(function(k) { return k + ''; }),
    modified: _.modified.bind(_)
  };
}
function aggregateParams(_, pulse) {
  var key    = _.field,
  value  = _.value,
      op     = (_.op === 'count' ? '__count__' : _.op) || 'sum',
      fields = accessorFields(key).concat(accessorFields(value)),
      keys   = pivotKeys(key, _.limit || 0, pulse);

  return {
    key:      _.key,
    groupby:  _.groupby,
    ops:      keys.map(function() { return op; }),
    fields:   keys.map(function(k) { return get(k, key, value, fields); }),
    as:       keys.map(function(k) { return k + ''; }),
    modified: _.modified.bind(_)
  };
}
function aggregateParams ( _ , pulse ) { var key = _ . field , value = _ . value , op = ( _ . op === 'count' ? '__count__' : _ . op ) || 'sum' , fields = accessorFields ( key ) . concat ( accessorFields ( value ) ) , keys = pivotKeys ( key , _ . limit || 0 , pulse ) ; return { key : _ . key , groupby : _ . groupby , ops : keys . map ( function ( ) { return op ; } ) , fields : keys . map ( function ( k ) { return get ( k , key , value , fields ) ; } ) , as : keys . map ( function ( k ) { return k + '' ; } ) , modified : _ . modified . bind ( _ ) } ; }
Shoehorn a pivot transform into an aggregate transform! First collect all unique pivot field values. Then generate aggregate fields for each output pivot field.
Shoehorn a pivot transform into an aggregate transform! First collect all unique pivot field values . Then generate aggregate fields for each output pivot field .