Given a group g
in Crossfilter, what's the best way to get the value of a particular key k
?
1 Answer
The best I can come up with so far is:
g.all().filter(function(item) { return item.key === k; })[0].value;
It works, but seems a bit roundabout.
-
1That's correct. It's worth noting that if you assign g.all().filter(function(item) { return item.key === k; })[0] to a variable, it's value property will continue to change as you apply filters to the Crossfilter. Nov 5, 2015 at 23:27