Filter visuals under external conditions

I see your point and I agree, rules work at visualizations level, which means that the Interaction Manager takes the filter, process it, and if it is a valid filter then it will be stored and then it’ll try to apply to the visuals, but the filter will be shown in the Interaction Manager anyways.

What you need then is the the combination of two Interaction Manager events and one api method:

var api = im.get('api');
var yourValidation = function(event) {
  // If your conditions are not met
  api.stopExecution()
}
im.on('filter:before-add', yourValidation),
im.on('filter:before-remove', yourValidation)

These two events are triggered before the Interaction Manager does any filter processing or anything, so it’s the best moment to validate if it should continue with the usual flow or not. api.stopExecution() is what will completely stop that flow.