The dataset has the following columns:
key
used to associate related observations, has values from 1 to 32x
, sample data for x, approximately evenly spaced from 0 to 2 * piy
, sample data for y, response to x, varies from -1 to 1group
indicates the function used to relate y to xI have set up an interval selection that works on the x and y encodings; the selection resolves globally.
As it currently works, points are highlighted if they are inside the x and y extents of the selection, regardless of the facet that it is in.
I would like for my interval selection to know which facet it is "inside" (perhaps it does already) such that I could:
Identify the value of key
for each point that falls inside the selection interval and has the value of group
for the facet used for the selection. In essence, identify only those observations that fall inside the "little grey box". Again, I realize this may already be the case.
Use a condition expression (or a filter expression, if I need to use the filter + layer technique used for the crossfilter example) that identifies those observations where datum.key
is in selection.key
, where selection
is the "selected" part of the dataset from part 1.
Part of my problem is that I don't see that there is a way to use an expression like selection.key
.
I can work around this by using "wide" data, rather than "tall" data. The problem is that once I do this, my Vega-Lite spec is no longer generalizable becuse it will depend on given values for group
to be part of the column names.
https://cdn.jsdelivr.net/npm/vega@4.0.0-rc.3
https://cdn.jsdelivr.net/npm/vega-lite@2.6.0
https://cdn.jsdelivr.net/npm/vega-embed@3.16.0