Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crossfilter - how to find min/max

Tags:

crossfilter

I am probably missing something trivial. I guess I still do not fully understand some basic crossfilter concepts

Anyway, I created a crossfilter with a few dimensions with filters on the dimensions. I now want to know the min/max of the filtered values (not the keys).

How would I achieve this?

All tips welcomed.

Thanks

Peter

like image 849
Peter Avatar asked Jul 16 '13 10:07

Peter


1 Answers

If you are using d3.js, you can use the "extent" method. I am just starting to play around with Cross filter to do some charting and here is a snippet that I have been using.

var strmDateAccessor = function (d){return d.strmDate;};
strmDateExtent = [];
strmDateExtent = d3.extent(data, strmDateAccessor);

// strmDateExtent[0] will equal min
// strmDateExtent[1] will equal max
like image 105
Chris Malek Avatar answered Oct 23 '22 20:10

Chris Malek