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(
data: Data | None = None,
*,
filter_by: Selection | None = None,
column: str | None = None,
options: Sequence[str | bool | float]
| Mapping[str, str | bool | float]
| None = None,
value: Literal["all", "auto"] | str | list[str] = "all",
multiple: bool = False,
target: Param | Selection | None = None,
field: str | None = None,
label: str | None = None,
width: float | None = None,
) -> ComponentdataData | None-
The data source (used in conjunction with the
columnparameter). Ifdatais not specified, you must provide explcitoptions. filter_bySelection | None-
A selection to filter the data source indicated by the
dataparameter. columnstr | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
dataparameter. optionsSequence[str | bool | float] | Mapping[str, str | bool | float] | None-
A
listordictof options (provide adictif you want values to map to alternate labels). Alternative to populating options from a database column viadataandcolumn. valueLiteral['all', 'auto'] | str | list[str]-
Initial value for selection. Pass “all” (the default) for no filtering, “auto” to select the first element in the list, or value(s) for an explicit initial selection. Applies only when
targetis a Selection (as Param carries its own default value). multiplebool-
Enable selection of multiple values (defaults to
False) targetParam | 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.
fieldstr | None-
The data column name to use within generated selection clause predicates. Defaults to the
columnparameter. labelstr | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
widthfloat | None-
Width in pixels (defaults to 150).
slider
Select input widget.
def slider(
data: Data | None = None,
*,
filter_by: Selection | None = None,
label: str | None = None,
column: str | None = None,
field: str | None = None,
target: Param | Selection | None = None,
select: Literal["point", "interval"] | None = None,
value: float | tuple[float, float] | None = None,
min: float | None = None,
max: float | None = None,
step: float | None = None,
width: float = 150,
) -> ComponentdataData | None-
The data source for this widget. Used in conjunction with the
columnproperty. The minimum and maximum values of the column determine the slider range. filter_bySelection | None-
A selection to filter the data source indicated by the
dataproperty. labelstr | None-
A text label for this input (optional).
columnstr | None-
The name of a database column whose values determine the slider range. Used in conjunction with the
dataproperty. The minimum and maximum values of the column determine the slider range. fieldstr | None-
The database column name to use within generated selection clause predicates. Defaults to the
columnproperty. targetParam | 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"). selectLiteral['point', 'interval'] | None-
The type of selection clause predicate to generate when
selectionis 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. valuefloat | tuple[float, float] | None-
The initial slider value. Either a single numeric value or a tuple of two values representing a range.
minfloat | None-
The minumum slider value.
maxfloat | None-
The maximum slider value.
stepfloat | None-
The slider step, the amount to increment between consecutive values.
widthfloat-
The width of the slider in screen pixels (defaults to 200)
search
Text search input widget
def search(
data: Data,
*,
filter_by: Selection | None = None,
column: str | None = None,
field: str | None = None,
target: Param | Selection | None = None,
type: Literal["contains", "prefix", "suffix", "regexp"] | None = None,
label: str | None = None,
placeholder: str | None = None,
width: float | None = None,
) -> ComponentdataData-
The data source for input selections (used in conjunction with the
columnproperty). filter_bySelection | None-
A selection to filter the data source indicated by the
dataproperty. columnstr | 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
dataproperty. fieldstr | None-
The data column name to use within generated selection clause predicates. Defaults to the
columnproperty. targetParam | 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
typeoption will be added to the selection. typeLiteral['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 labelstr | None-
A text label for this input (optional).
placeholderstr | None-
Placeholder text for empty search box.
widthfloat | 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(
data: Data | None = None,
*,
label: str | None = None,
target: Param | Selection | None = None,
field: str | None = None,
checked: bool = False,
values: tuple[str | float | bool | None, str | float | bool | None] = (True, False),
) -> ComponentdataData | None-
The data source (required when specifying the
fieldparameter to target a data source selection). labelstr | None-
A text label for the input (required)
targetParam | Selection | None-
A Param or Selection that this checkbox should interact with (use
valuesto customize the values that are used in thetarget). fieldstr | None-
The data column name to use within generated selection clause predicates (required if
targetis not a Param). checkedbool-
Should the checkbox be in the checked state by default.
valuestuple[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(
data: Data | None = None,
*,
column: str | None = None,
options: Sequence[str | bool | float]
| Mapping[str, str | bool | float]
| None = None,
target: Param | Selection | None = None,
field: str | None = None,
label: str | None = None,
filter_by: Selection | None = None,
) -> ComponentdataData | None-
The data source (used in conjunction with the
columnparameter). Ifdatais not specified, you must provide explcitoptions. columnstr | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
dataparameter. optionsSequence[str | bool | float] | Mapping[str, str | bool | float] | None-
A
listordictof options (provide adictif you want values to map to alternate labels). Alternative to populating options from a database column viadataandcolumn. targetParam | 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.
fieldstr | None-
The data column name to use within generated selection clause predicates. Defaults to the
columnparameter. labelstr | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
filter_bySelection | None-
A selection to filter the data source indicated by the
dataparameter.
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(
data: Data | None = None,
*,
column: str | None = None,
options: Sequence[str | bool | float] | dict[str, str | bool | float] | None = None,
target: Param | Selection | None = None,
field: str | None = None,
label: str | None = None,
filter_by: Selection | None = None,
) -> ComponentdataData | None-
The data source (used in conjunction with the
columnparameter). Ifdatais not specified, you must provide explcitoptions. columnstr | None-
The name of a column from which to pull options. The unique column values are used as options. Used in conjunction with the
dataparameter. optionsSequence[str | bool | float] | dict[str, str | bool | float] | None-
A
listordictof options (provide adictif you want values to map to alternate labels). Alternative to populating options from a database column viadataandcolumn. targetParam | 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.
fieldstr | None-
The data column name to use within generated selection clause predicates. Defaults to the
columnparameter. labelstr | None-
A text label for the input. If unspecified, the column name (if provided) will be used by default.
filter_bySelection | None-
A selection to filter the data source indicated by the
dataparameter.