square/crossfilter — pull request #124 by wssbck (2014-09-11 21:34:28+00:00)
Title: Allows reduce() to accept object containing three functions

This is a bit hacky but here is the intent. If reduce() could accept not only three functions but also an object containing three functions, it would be easier to build custom aggregations for crossfilter.

For example, a function:

```javascript
weightedMean(freq, weight)
```

with "freq" being frequencies accessor function and "weight" being weights accessor function, would return something along the lines of:

```javascript
{
add : weightedMeanAdd,
remove : weightedMeanRemove,
initial : weightedMeanInitial
}
```

All fields of this object would be functions, similar to

```javascript
crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero
```