I've been trying to understand crossfilter filtering and I was finally able to get it right in my code but I can't seem to understand why CrossFilter does what it does.
So here's what I get from here Crossfilter filters not filtering (dc.js):
As Jeffrey Biles says in it "So it turns out crossfilter doesn't apply the filter to the dimension you put the filter on. It applies it to everything else."
Okay, I don't understand why it's done like that but okay, filter applies to everything else, got it.
But then I found this Custom Text filter for DC.js dataTable:
And in here, rbristow is using a text filter box to filter his code. BUT filters on his companyDimension
dimension. And that seems to be the dimension that is filtered as well.
So... I have two questions:
- Why is it that CrossFilter made it so that a filter will be applied to all dimensions except the one you call it on?
- Why does rbristow's code work if that's the case?
Thanks a ton in advance!