Hello, I have a somewhat complex situation, I need to apply a filter and intercept it before it is applied to the visualizations and thus be able to change its value according to a certain criteria, is it possible?
Changing filters before applying to the visualizations
emoya
#2
Hey @dani yes it is, yo have to use some event in theInteraction manager, just let me show you an example:
if you donβt wnat to apply that filter you just have to use this:
const im = cf.getIManager();
im.on('filter:before-add', (data) => {
const myFilter = data.filters.find(
(f) => f._sender.type === 'Slicer'
);
if (myFilter) {
im.get('api').stopExecution();
}
}
but if you want to change something and apply your own filter you can do this:
const im = cf.getIManager();
im.on('filter:before-add', (data) => {
const slicerFilter = data.filters.find(
(f) => f._sender.type === 'Slicer'
);
if (slicerFilter && slicerFilter._values.includes('myCriteria')) {
// do something
}
}
emoya
#4
Great!, that ssounds really good, and actually we are working on some new stuff each moth, so you are goint to se more interesting things