Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(typing): Fix inaccurate selection_interval signature #3662

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
)
from altair.utils.display import MimeBundleType

from .schema._config import BrushConfigKwds, DerivedStreamKwds, MergedStreamKwds
from .schema._typing import (
AggregateOp_T,
AutosizeType_T,
Expand Down Expand Up @@ -107,6 +108,7 @@
BindRadioSelect,
BindRange,
BinParams,
BrushConfig,
DateTime,
Expr,
ExprRef,
Expand All @@ -122,7 +124,6 @@
JoinAggregateFieldDef,
LayerRepeatMapping,
LookupSelection,
Mark,
NamedData,
ParameterName,
PointSelectionConfig,
Expand Down Expand Up @@ -1503,11 +1504,11 @@ def selection_interval(
bind: Optional[Binding | str] = Undefined,
empty: Optional[bool] = Undefined,
expr: Optional[str | Expr | Expression] = Undefined,
encodings: Optional[list[SingleDefUnitChannel_T]] = Undefined,
on: Optional[str] = Undefined,
clear: Optional[str | bool] = Undefined,
encodings: Optional[Sequence[SingleDefUnitChannel_T]] = Undefined,
on: Optional[str | MergedStreamKwds | DerivedStreamKwds] = Undefined,
clear: Optional[str | bool | MergedStreamKwds | DerivedStreamKwds] = Undefined,
resolve: Optional[SelectionResolution_T] = Undefined,
mark: Optional[Mark] = Undefined,
mark: Optional[BrushConfig | BrushConfigKwds] = Undefined,
translate: Optional[str | bool] = Undefined,
zoom: Optional[str | bool] = Undefined,
**kwds: Any,
Expand All @@ -1517,33 +1518,33 @@ def selection_interval(

Parameters
----------
name : string (optional)
name : str (optional)
The name of the parameter. If not specified, a unique name will be
created.
value : any (optional)
value : Any (optional)
The default value of the parameter. If not specified, the parameter
will be created without a default value.
bind : :class:`Binding`, str (optional)
Binds the parameter to an external input element such as a slider,
selection list or radio button group.
empty : boolean (optional)
empty : bool (optional)
For selection parameters, the predicate of empty selections returns
True by default. Override this behavior, by setting this property
'empty=False'.
expr : :class:`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.
encodings : List[str] (optional)
encodings : Sequence[str] (optional)
A list of encoding channels. The corresponding data field values
must match for a data tuple to fall within the selection.
on : string (optional)
on : str (optional)
A Vega event stream (object or selector) that triggers the selection.
For interval selections, the event stream must specify a start and end.
clear : string or boolean (optional)
clear : str, bool (optional)
Clears the selection, emptying it of all values. This property can
be an Event Stream or False to disable clear. Default is 'dblclick'.
resolve : enum('global', 'union', 'intersect') (optional)
resolve : Literal['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.
Expand All @@ -1559,11 +1560,11 @@ def selection_interval(
brushes.

The default is 'global'.
mark : :class:`Mark` (optional)
mark : :class:`BrushConfig` (optional)
An interval selection also adds a rectangle mark to depict the
extents of the interval. The mark property can be used to
extents of the interval. The ``mark`` property can be used to
customize the appearance of the mark.
translate : string or boolean (optional)
translate : str, bool (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
Expand All @@ -1574,7 +1575,7 @@ def selection_interval(
[pointerdown, window:pointerup] > window:pointermove!
This default allows users to click and drag within an interval
selection to reposition it.
zoom : string or boolean (optional)
zoom : str, bool (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,
Expand All @@ -1584,7 +1585,7 @@ def selection_interval(
The default value is True, which corresponds to wheel!. This
default allows users to use the mouse wheel to resize an interval
selection.
**kwds :
**kwds : Any
Additional keywords to control the selection.

Returns
Expand Down