Input: a line brush FROM TO (dates), then a CSV date,district,pm25.
Build in Altair: an interval selection named brush on the x encoding, added to a line chart (x = date, y = pm25, colour = district); and a bar chart of mean pm25 per district filtered by the brush; combine them with &.
From the specification print selection 'brush': interval on ['x'], defined in ['view_1'] and, for each view of the vconcat, view 1 (line): defines the brush or view 2 (bar): filtered by brush. Then simulate the interaction with pandas: brushed 2026-03-02..2026-03-03: 6 of 12 rows, bars: Longwan 28.0, Lucheng 58.0, Ouhai 39.0 (means of the brushed rows, alphabetical) and without brush: … (means of all rows).