Interaction manager custom filters


#1

Hello, I am trying to apply some filters to specific visualizations manually without using Interaction Manager, for this I am registering a mouse event on each item in a html list, in this event I build the filter based on the item that is being selected, then I send it to a bar chart and a heat map, but in the Interaction manager I have configured certain rules to apply or not apply certain filters, my question is: is there any function of the Interaction manager that allows me to know which filters are correct for a specific visualization?


#2

Hey @jessica, yes there is a function in the Interaction manager API, it is called getFiltersConditions, just set the filters in the Interaction manager and then call the function, here is an example:

async getValidFilters() {
    const viz = root.cf.getVisualization('your_visualization');

    const IM = root.cf.getIManager();
    const api = IM.get('api');
    const filterConditions = await api.getFiltersConditions(viz);

    const currentAQl = viz.getCurrentAQL();
    const validFilters = filterConditions.validFilters[currentAQl._id];

    return validFilters;
}


#3

I tried, and i worked good for me, thanks for your help