| 148258 | } |
| 148259 | DataScope.prototype = { |
| 148260 | countsRef (scope, field6, sort) { |
| 148261 | const ds = this, cache2 = ds.counts || (ds.counts = {}), k = fieldKey(field6); |
| 148262 | let v, a, p; |
| 148263 | if (k != null) { |
| 148264 | scope = ds.scope; |
| 148265 | v = cache2[k]; |
| 148266 | } |
| 148267 | if (!v) { |
| 148268 | p = { |
| 148269 | groupby: scope.fieldRef(field6, "key"), |
| 148270 | pulse: ref(ds.output) |
| 148271 | }; |
| 148272 | if (sort && sort.field) addSortField(scope, p, sort); |
| 148273 | a = scope.add(Aggregate(p)); |
| 148274 | v = scope.add(Collect({ |
| 148275 | pulse: ref(a) |
| 148276 | })); |
| 148277 | v = { |
| 148278 | agg: a, |
| 148279 | ref: ref(v) |
| 148280 | }; |
| 148281 | if (k != null) cache2[k] = v; |
| 148282 | } else if (sort && sort.field) addSortField(scope, v.agg.params, sort); |
| 148283 | return v.ref; |
| 148284 | }, |
| 148285 | tuplesRef () { |
| 148286 | return ref(this.values); |
| 148287 | }, |