From 66f219903a75d6a1edc3f6c226792f45cd7135e5 Mon Sep 17 00:00:00 2001 From: Douglas Date: Fri, 26 Feb 2016 11:09:55 -0600 Subject: [PATCH] Add test for crossfilter.groupAll() --- crossfilter/crossfilter-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crossfilter/crossfilter-tests.ts b/crossfilter/crossfilter-tests.ts index 745ed3aa4..8d98bef06 100644 --- a/crossfilter/crossfilter-tests.ts +++ b/crossfilter/crossfilter-tests.ts @@ -24,6 +24,11 @@ var payments = crossfilter([ {date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa"} ]); +var total_payments : number = payments.groupAll().reduce( + function(p,v) { return p+=v; }, + function(p,v) { return p-=v; }, + function() { return 0; } ).value(); + var paymentsByTotal = payments.dimension((d) => d.total); // Filters