Hi everyone, I am working on a react application using the Chartfactor toolkit and I need to identify when a specific filter is applied and execute an action when that happens, my question is: is it possible to know the type of filter applied and the value it contains using the interaction manager?
Identify the use of specific filters
emoya
#2
Hi @davisg, sounds like you need to subscribe to an event, the chart factor widgets have many events that you can subscribe to, but I don’t understand what kind of filter you want to detect, in any case, the interaction manager has a list of events that you could use, for example the filter called filter:added:
im.on('filter:added', e => {/* do something*/})
is this what you are looking for?
dani
#3
Hi @davisg i was trying something similar, that was mi solution:
- Get the IM (Interaction manager) instance:
- You can do this:
const im = cf.AktiveInstances.find(instance => instance.get('visualization') === "Interaction Manager")
- Or this:
const im = cf.getVisualization("your_im_id");
- Get all the IM filters:
im.get('api').getFilters()
// it returns all filters and their values
- Evaluate the filter content you need.
davisg
#4
Yes @emoya i saw that event in the documentation, thanks for reply, but the thing is… i want to evaluate the filters in other event.