inspect_viz.input
select
Select input.
Select inputs can be populated either from a database table (via the data
and column
parameters) or from a static set of options (via the options
parameter).
Select inputs can produce either a single value or multiple values when multiple=True
is specified.
Select inputs have a target
which is either a Param or Selection. In the latter case, the field
parameter determines the data column name to use within generated selection clause predicates (defaulting to column
). If no target
is specified then the data source’s selection is used as the target.
The intitial selected value will be “All” when target
is a Selection (indicating select all records) and the param value when target
is a Param.
def select(
| None = None,
data: Data *,
| None = None,
filter_by: Selection str | None = None,
column: list[str | bool | float] | dict[str, str | bool | float] | None = None,
options: "all"] | str | list[str] = "all",
value: Literal[bool = False,
multiple: | Selection | None = None,
target: Param str | None = None,
field: str | None = None,
label: float | None = None,
width: -> Component )
data
Data | None-
The data source (used in conjunction with the
column
parameter). Ifdata
is not specified, you must provide explcitoptions
. filter_by
Selection | None-
A selection to filter the data source indicated by the
data
parameter. column
str | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
data
parameter. options
list[str | bool | float] | dict[str, str | bool | float] | None-
A
list
ordict
of options (provide adict
if you want values to map to alternate labels). Alternative to populating options from a database column viadata
andcolumn
. value
Literal['all'] | str | list[str]-
Initial value for selection. Pass “all” (the default) for no filtering, or value(s) for an explicit initial selection. Applies only when
target
is a Selection (as Param carries its own default value). multiple
bool-
Enable selection of multiple values (defaults to
False
) target
Param | Selection | None-
A Param or Selection that this select input should update. For a Param, the selected value is set to be the new param value. For a Selection, a predicate of the form column = value will be added to the selection.
field
str | None-
The data column name to use within generated selection clause predicates. Defaults to the
column
parameter. label
str | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
width
float | None-
Width in pixels (defaults to 150).
slider
Select input widget.
def slider(
| None = None,
data: Data *,
| None = None,
filter_by: Selection str | None = None,
label: str | None = None,
column: str | None = None,
field: | Selection | None = None,
target: Param "point", "interval"] | None = None,
select: Literal[float | tuple[float, float] | None = None,
value: min: float | None = None,
max: float | None = None,
float | None = None,
step: float = 150,
width: -> Component )
data
Data | None-
The data source for this widget. Used in conjunction with the
column
property. The minimum and maximum values of the column determine the slider range. filter_by
Selection | None-
A selection to filter the data source indicated by the
data
property. label
str | None-
A text label for this input (optional).
column
str | None-
The name of a database column whose values determine the slider range. Used in conjunction with the
data
property. The minimum and maximum values of the column determine the slider range. field
str | None-
The database column name to use within generated selection clause predicates. Defaults to the
column
property. target
Param | Selection | None-
A Param or Selection that this select input should update. For a Param, the selected value is set to be the new param value. For a Selection, a predicate that does an equality check (for
select=="point"
) or range check (forselect=="interval"
). select
Literal['point', 'interval'] | None-
The type of selection clause predicate to generate when
selection
is specified. If'point'
(the default for a single value), the selection predicate is an equality check for the slider value. If'interval'
(the default for a pair of values), the predicate checks the slider value interval. value
float | tuple[float, float] | None-
The initial slider value. Either a single numeric value or a tuple of two values representing a range.
min
float | None-
The minumum slider value.
max
float | None-
The maximum slider value.
step
float | None-
The slider step, the amount to increment between consecutive values.
width
float-
The width of the slider in screen pixels (defaults to 200)
search
Text search input widget
def search(
data: Data,*,
| None = None,
filter_by: Selection str | None = None,
column: str | None = None,
field: | Selection | None = None,
target: Param type: Literal["contains", "prefix", "suffix", "regexp"] | None = None,
str | None = None,
label: str | None = None,
placeholder: float | None = None,
width: -> Component )
data
Data-
The data source for input selections (used in conjunction with the
column
property). filter_by
Selection | None-
A selection to filter the data source indicated by the
data
property. column
str | None-
TThe name of a database column from which to pull valid search results. The unique column values are used as search autocomplete values. Used in conjunction with the
data
property. field
str | None-
The data column name to use within generated selection clause predicates. Defaults to the
column
property. target
Param | Selection | None-
A Param or Selection that this search box should update. For a Param, the textbox value is set as the new param value. For a Selection, a predicate based on the
type
option will be added to the selection. type
Literal['contains', 'prefix', 'suffix', 'regexp'] | None-
The type of text search query to perform. One of: -
"contains"
(default): the query string may appear anywhere in the text -"prefix"
: the query string must appear at the start of the text -"suffix"
: the query string must appear at the end of the text -"regexp"
: the query string is a regular expression the text must match label
str | None-
A text label for this input (optional).
placeholder
str | None-
Placeholder text for empty search box.
width
float | None-
Width in pixels (defaults to 150).
checkbox
Checkbox.
Checkboxes have a target
which is either a Param or Selection. In the latter case, the field
parameter determines the data column name to use within generated selection clause predicates (defaulting to column
). If no target
is specified then the data source’s selection is used as the target.
The values
tuple enables you to determine what value is communicated to the target for checked and unchecked states (by default, this is True
and False
).
def checkbox(
| None = None,
data: Data *,
str | None = None,
label: | Selection | None = None,
target: Param str | None = None,
field: bool = False,
checked: tuple[str | float | bool | None, str | float | bool | None] = (True, False),
values: -> Component )
data
Data | None-
The data source (required when specifying the
field
parameter to target a data source selection). label
str | None-
A text label for the input (required)
target
Param | Selection | None-
A Param or Selection that this checkbox should interact with (use
values
to customize the values that are used in thetarget
). field
str | None-
The data column name to use within generated selection clause predicates (required if
target
is not a Param). checked
bool-
Should the checkbox be in the checked state by default.
values
tuple[str | float | bool | None, str | float | bool | None]-
What value is communicated to the target for checked and unchecked states.
radio_group
Radio group.
Radio groups can be populated either from a database table (via the data
and column
parameters) or from a static set of options (via the options
parameter).
Radio groups have a target
which is either a Param or Selection. In the latter case, the field
parameter determines the data column name to use within generated selection clause predicates (defaulting to column
). If no target
is specified then the data source’s selection is used as the target.
The intitial selected value will be “All” when target
is a Selection (indicating select all records) and the param value when target
is a Param.
def radio_group(
| None = None,
data: Data *,
str | None = None,
column: list[str | bool | float] | dict[str, str | bool | float] | None = None,
options: | Selection | None = None,
target: Param str | None = None,
field: str | None = None,
label: | None = None,
filter_by: Selection -> Component )
data
Data | None-
The data source (used in conjunction with the
column
parameter). Ifdata
is not specified, you must provide explcitoptions
. column
str | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
data
parameter. options
list[str | bool | float] | dict[str, str | bool | float] | None-
A
list
ordict
of options (provide adict
if you want values to map to alternate labels). Alternative to populating options from a database column viadata
andcolumn
. target
Param | Selection | None-
A Param or Selection that this radio group should update. For a Param, the selected value is set to be the new param value. For a Selection, a predicate of the form column = value will be added to the selection.
field
str | None-
The data column name to use within generated selection clause predicates. Defaults to the
column
parameter. label
str | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
filter_by
Selection | None-
A selection to filter the data source indicated by the
data
parameter.
checkbox_group
Checkbox group.
Radio groups can be populated either from a database table (via the data
and column
parameters) or from a static set of options (via the options
parameter).
Checkbox groups have a target
which is either a Param or Selection. In the latter case, the field
parameter determines the data column name to use within generated selection clause predicates (defaulting to column
). If no target
is specified then the data source’s selection is used as the target.
The intitial selected values will be empty when target
is a Selection (indicating select all records) and the param value(s) when target
is a Param (param values should be an array with one or more checkbox values).
def checkbox_group(
| None = None,
data: Data *,
str | None = None,
column: list[str | bool | float] | dict[str, str | bool | float] | None = None,
options: | Selection | None = None,
target: Param str | None = None,
field: str | None = None,
label: | None = None,
filter_by: Selection -> Component )
data
Data | None-
The data source (used in conjunction with the
column
parameter). Ifdata
is not specified, you must provide explcitoptions
. column
str | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
data
parameter. options
list[str | bool | float] | dict[str, str | bool | float] | None-
A
list
ordict
of options (provide adict
if you want values to map to alternate labels). Alternative to populating options from a database column viadata
andcolumn
. target
Param | Selection | None-
A Param or Selection that this radio group should update. For a Param, the selected value is set to be the new param value. For a Selection, a predicate of the form column IN (values) will be added to the selection.
field
str | None-
The data column name to use within generated selection clause predicates. Defaults to the
column
parameter. label
str | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
filter_by
Selection | None-
A selection to filter the data source indicated by the
data
parameter.