Im referring square crossfilter plugin for javascript
https://github.com/square/crossfilter
In my app, users are be able to select specific date ranges and each time the date is changed, an ajax request creates a json object which is fed into crossfilter.
I want to be able to remove the existing crossfilter (objects on screen as well as events) and start a new with the newly created json object.
According to the documentation, you should be able to undo a filter either by applying
.filter(null)
or
.filterAll()
to your object.
However, I have found this does not necessarily work, so perhaps the better thing to do would be to apply a fresh filter to a new crossfilter object.
If you can provide some code for better context that would be helpful.
You need to reset the filters on all dimensions derived from the crossfilter to reset it. For example, if you have applied the following filters
payments_by_quantity.filter([1, Infinity]);
payments_by_total.filter(90);
payments_by_tip.filter(0);
payments_by_type.filter("tab");
you need to reset each single one to return to the original state:
payments_by_quantity.filter(null);
payments_by_total.filter(null);
payments_by_tip.filter(null);
payments_by_type.filter(null);
This makes sense, as it allows you to selectively activate/deactivate filters on the dimensions you have defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With