Revise whether to blend selection into parameter
See original GitHub issueAs I start working on documentation, I start questioning whether this is a good idea.
At the conceptual level, selection seems to be a distinct concept from parameter as there are several commands that only work with selections:
transform": [
{"filter": {"selection": "brush"}}
]
"scale": {"domain": {"selection": "brush", "encoding": "x"}}
"selection": {"or": ["alex", {"not": "morgan"}]}
For this reason, it might make sense that we keep selection as a separate thing, but mention that declaring a selection will also produce a parameter that can be referred.
(We should still consider consolidating point selection and changing selection from key-value object to a flat object with names so it’s consistent with parameters.)
Also, we should consider if we want selections: or selection: as the key. (Right now we use params:, but if we want to keep selection:, then we should rename params to a singular parameter:.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
We have now found a way to cleanly unify them (by making params works in place that selection used to work with boolean coercion).
I think there is value in merging selections and params. Besides what @arvind wrote above, I think there is enough commonality (especially to a user) that the two should not be separate. For example, both are implemented with signals and both can (or will be) readable/writable from the outside. At some point Vega will support selections and then we might have to adjust things here in Vega-Lite as well but until then I think we should move forward with what we have.
Side note. To me, the
selectionin the code below is just a shortcut for an expression that correctly handles the fact that a selection (which can be more than a single value).