Project a SelectionEdit this page
A selection’s type determines which data values fall within it by default:
multiselections, only values that have been directly interacted with (i.e., those that have been clicked on) are considered to be “selected.”
intervalselections, values that fall within both the horizontal (
x) and vertical (
y) extents are considered to be “selected.”
These default inclusion criteria can be modified with the project selection transformation, which offers the following two properties:
An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.
An array of field names whose values must match for a data tuple to fall within the selection.
In the scatterplot example below, use the project transformation to highlight : .
With interval selections, the project transformation can be used to restrict the region to just the and/or dimensions.
- Selections projected over aggregated
encodingscan only be used within the same view they are defined in.
- Interval selections can only be projected using
- Interval selections projected over binned or
timeUnitfields remain continuous selections. Thus, if the visual encoding discretizes them, conditional encodings will no longer work. Instead, use a layered view as shown in the example below. The bar mark discretizes the binned
Accelerationfield. As a result, to highlight selected bars, we use a second layered view rather than a conditional color encoding within the same view.