As I write this issue, I am not fully confident that I am using all the vocabulary correctly (or even that it is titled correctly). I will be happy to revise and refine this request accordingly.
Currently when I make an interval selection, the selection works on the x and y encodings. Conditioning on such a selection will highlight those observations that fall within those x and y intervals. Here's an example: https://bl.ocks.org/ijlyttle/81c392ed462aec3cf1837dc2633200e3
(In this example, I think I may have used the word key badly, as the value of key is not unique within this dataset. Please think of key as a generic variable.)
I would like to be able to have access to the "selected" dataset of those observations that fall inside the "little grey box".
Within a filtering expression (or other transformation expression), we have a pronoun datum to denote the current dataset. As a first idea, could there be a pronoun to denote the dataset filtered using selector002?
In this example, I would want to either filter or condition on the expression, something like
{"field": "key", "oneOf": "selector002.key"}
This may be a separate issue, but for this idea to work as I imagine, the selection would have to be aware of which facet it is in. Using the blocks example, if I make an interval selection in the "cos" group, I want to select only those observations that are in the "cos" group, not those that fall in the x and y intervals in the other facets. Perhaps this is already the case.
Thank you for a very clearly articulated feature request, @ijlyttle! Your terminology is exactly right -- our original research paper described being able to customize selection predicate functions for exactly these kinds of use cases. The language design issues proved to be trickier than anticipated once we moved to a full, production ready implementation so we ended up getting rid of it in Vega-Lite 2.0.
With the refactoring to selections' internal mechanisms I recently introduced, it would be a good time to reconsider how we might reintroduce customization for predicates. So your request is very timely and I hope to have more to say soon :)
This is great news, @arvind (and thanks for your kind words)! If I can be of help, please let me know.
Closing in favor of #4740 which includes additional variants of a possible syntax for supporting this feature.
Most helpful comment
Thank you for a very clearly articulated feature request, @ijlyttle! Your terminology is exactly right -- our original research paper described being able to customize selection predicate functions for exactly these kinds of use cases. The language design issues proved to be trickier than anticipated once we moved to a full, production ready implementation so we ended up getting rid of it in Vega-Lite 2.0.
With the refactoring to selections' internal mechanisms I recently introduced, it would be a good time to reconsider how we might reintroduce customization for predicates. So your request is very timely and I hope to have more to say soon :)