Interaction mappings
Connect a selection in one view to the queries that should respond
An interaction mapping connects a selectable view to the queries that should respond to it. When a user clicks a row or bar in one view, the mapped queries are filtered by that selection.
Cross-filtering
When a user clicks a region in the breakdown, the frontend selects that row and executes the app. The mapping applies the selection to trend:
const byRegion = app.createQuery('byRegion', {
dataset: 'sales',
dimensions: { region: { field: 'users.region' } },
measures: { revenue: { field: 'revenue' } },
})
app.mapCrossFilter(byRegion, trend)
regionChart.on('click', (row) => {
byRegion.select([row])
app.execute()
})Your subscription can then redraw both views from byRegion.result and trend.result.
The page decides how the views look and how they handle clicks. Anfra runs the queries and applies the mapped filters through the semantic model, so the page contains no filter logic.