altair.selection_interval#
- altair.selection_interval(name=None, value=Undefined, bind=Undefined, empty=Undefined, expr=Undefined, encodings=Undefined, on=Undefined, clear=Undefined, resolve=Undefined, mark=Undefined, translate=Undefined, zoom=Undefined, **kwds)#
Create an interval selection parameter. Selection parameters define data queries that are driven by direct manipulation from user input (e.g., mouse clicks or drags). Interval selection parameters are used to select a continuous range of data values on drag, whereas point selection parameters (selection_point) are used to select multiple discrete data values.)
- Parameters:
- namestring (optional)
The name of the parameter. If not specified, a unique name will be created.
- valueany (optional)
The default value of the parameter. If not specified, the parameter will be created without a default value.
- bind
Binding
(optional) Binds the parameter to an external input element such as a slider, selection list or radio button group.
- emptyboolean (optional)
For selection parameters, the predicate of empty selections returns True by default. Override this behavior, by setting this property ‘empty=False’.
- expr
Expr
(optional) An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.
- encodingsList[str] (optional)
A list of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.
- onstring (optional)
A Vega event stream (object or selector) that triggers the selection. For interval selections, the event stream must specify a start and end.
- clearstring or boolean (optional)
Clears the selection, emptying it of all values. This property can be an Event Stream or False to disable clear. Default is ‘dblclick’.
- resolveenum(‘global’, ‘union’, ‘intersect’) (optional)
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. One of:
‘global’: only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.
‘union’: each cell contains its own brush, and points are highlighted if they lie within any of these individual brushes.
‘intersect’: each cell contains its own brush, and points are highlighted only if they fall within all of these individual brushes.
The default is ‘global’.
- mark
Mark
(optional) An interval selection also adds a rectangle mark to depict the extents of the interval. The mark property can be used to customize the appearance of the mark.
- translatestring or boolean (optional)
When truthy, allows a user to interactively move an interval selection back-and-forth. Can be True, False (to disable panning), or a Vega event stream definition which must include a start and end event to trigger continuous panning. Discrete panning (e.g., pressing the left/right arrow keys) will be supported in future versions. The default value is True, which corresponds to [mousedown, window:mouseup] > window:mousemove! This default allows users to click and drag within an interval selection to reposition it.
- zoomstring or boolean (optional)
When truthy, allows a user to interactively resize an interval selection. Can be True, False (to disable zooming), or a Vega event stream definition. Currently, only wheel events are supported, but custom event streams can still be used to specify filters, debouncing, and throttling. Future versions will expand the set of events that can trigger this transformation. The default value is True, which corresponds to wheel!. This default allows users to use the mouse wheel to resize an interval selection.
- **kwds
Additional keywords to control the selection.
- Returns:
- parameter: Parameter
The parameter object that can be used in chart creation.