(_, pulse)
| 91451 | |
| 91452 | |
| 91453 | function aggregateParams(_, pulse) { |
| 91454 | var key = _.field, |
| 91455 | value = _.value, |
| 91456 | op = (_.op === 'count' ? '__count__' : _.op) || 'sum', |
| 91457 | fields = (0, _vegaUtil.accessorFields)(key).concat((0, _vegaUtil.accessorFields)(value)), |
| 91458 | keys = pivotKeys(key, _.limit || 0, pulse); // if data stream content changes, pivot fields may change |
| 91459 | // flag parameter modification to ensure re-initialization |
| 91460 | |
| 91461 | if (pulse.changed()) _.set('__pivot__', null, null, true); |
| 91462 | return { |
| 91463 | key: _.key, |
| 91464 | groupby: _.groupby, |
| 91465 | ops: keys.map(function () { |
| 91466 | return op; |
| 91467 | }), |
| 91468 | fields: keys.map(function (k) { |
| 91469 | return get(k, key, value, fields); |
| 91470 | }), |
| 91471 | as: keys.map(function (k) { |
| 91472 | return k + ''; |
| 91473 | }), |
| 91474 | modified: _.modified.bind(_) |
| 91475 | }; |
| 91476 | } // Generate aggregate field accessor. |
| 91477 | // Output NaN for non-existent values; aggregator will ignore! |
| 91478 | |
| 91479 |
no test coverage detected