Struct vega_lite::SingleSelectionConfig
source · pub struct SingleSelectionConfig {
pub bind: Option<HashMap<String, BindValue>>,
pub empty: Option<VgLayoutAlign>,
pub encodings: Option<Vec<SingleDefChannel>>,
pub fields: Option<Vec<String>>,
pub nearest: Option<bool>,
pub on: Option<Value>,
pub resolve: Option<SelectionResolution>,
}
Expand description
The default definition for a
single
selection. All
properties and transformations
for a single selection definition (except type
) may be specified here.
For instance, setting single
to {"on": "dblclick"}
populates single selections on
double-click by default.
Fields§
§bind: Option<HashMap<String, BindValue>>
Establish a two-way binding between a single selection and input elements (also known as dynamic query widgets). A binding takes the form of Vega’s input element binding definition or can be a mapping between projected field/encodings and binding definitions.
See the bind transform documentation for more information.
empty: Option<VgLayoutAlign>
By default, all data values are considered to lie within an empty selection.
When set to none
, empty selections contain no data values.
encodings: Option<Vec<SingleDefChannel>>
An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.
fields: Option<Vec<String>>
An array of field names whose values must match for a data tuple to fall within the selection.
nearest: Option<bool>
When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value nearest the mouse cursor is added to the selection.
See the nearest transform documentation for more information.
on: Option<Value>
A Vega event stream (object or selector) that triggers the selection. For interval selections, the event stream must specify a start and end.
resolve: Option<SelectionResolution>
With layered and multi-view displays, a strategy that determines how selections’ data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.