d3.js - Size of a filtered dimension in Crossfilter? -
i've read through crossfilter api docs several times can't see how following.
suppose have set up
crossfilter(event);
and dimension foo:
var foo = event.dimension(function(d) { return d.foo; }), foos = foo.group(function(d) { return math.floor(d) ; });
then, before filters applied, event.size()
give me number of records in event, , foos.size()
give me number of distinct records in foo dimension
great! apply filters sliding brushes around. event.groupall().value()
gives me current number of records in event selected. great again.
now how current number of distinct records in foo dimension? i've tried many different combinations of api primitives, none seem work.
any ideas?
this should trick
var n = foo.top(number.positive_infinity).length;
Comments
Post a Comment