Let me say that I have this data and dimension:
var data = [
{"fruit": "apple", "amount": "12"},
{"fruit": "orange", "amount": "6"},
{"fruit": "grape", "amount": "11"},
{"fruit": "melon", "amount": "26"},
{"fruit": "lemon", "amount": "15"}
]
var ndx = crossfilter(data);
var fruitDimension = ndx.dimension(function (d) {
return d.fruit;
});
...and now, I want to filter just "apple","lemon" and "orange" just by using code. By now, I am trying to do something like.
fruitDimension.filter(["apple","lemon","orange"])
...but it does not work it all.
I know that the function # dimension.filterExact(value) works for one value.
If I apply # dimension.filter(value) passing a vector as parameter, it deals with it as # dimension.filterRange(range)
I could not find which filter works for different values.
references from: https://github.com/square/crossfilter/wiki/API-Reference
Someone has a hint about what I could be doing in order to filter different elements (that do not follow a range order) of a dimension?
Thanks in advance, Roger