Skip to main content

Inputs

Allows users to handle input data for visualization.

🔗 Explore Inputs: Use Cases

Parameters​

1. Menu​

  • A dropdown menu input widget.
  • It returns a new menu component with the provided options.

Function Signature

app.mosaic(
vg.inputs.menu(
as_, column, field, filterBy,
from_, label, options, value
)
)
ParametersDescription
as_ (Parameter)The output selection. A selection clause is added for the currently selected menu option.
field (str)The database column name to use within generated selection clause predicates. Defaults to the column property.
from_ (Relation)The name of a database table to use as a data source for this widget. Used in conjunction with the column property.
column (str)The name of a database column from which to pull menu options. The unique column values are used as menu options. Used in conjunction with the from property.
filterBy (Parameter)A selection to filter the database table indicated by the from property.
label (str)A text label for this input.
options (Union[List[Union[str, int, float, bool]], List[MenuEntry]])An array of menu options, as literal values or option objects. Option objects have a value property and an optional label property. If no label is provided, the string-coerced value is used.
value (Union[str, int, float, bool])The initial selected menu value.
  • A text searchbox input widget.
  • It returns a new search component with the provided options.

Function Signature

app.mosaic(
vg.inputs.search(
as_, column, field, filterBy,
from_, label, type
)
)
ParametersDescription
as_ (Parameter)The output selection. A selection clause is added for the current text search query.
field (str)The database column name to use within generated selection clause predicates. Defaults to the column property.
type (Literal["contains", "prefix", "suffix", "regexp"])The type of text search query to perform. Options include: "contains" (default), "prefix", "suffix", "regexp".
from_ (Relation)The name of a database table to use as an autocomplete data source for this widget. Used in conjunction with the column property.
column (str)The 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 from property.
filterBy (Parameter)A selection to filter the database table indicated by the from property.
label (str)A text label for this input.

3. Slider​

  • A slider input widget.
  • It returns a new slider component with the provided options.

Function Signature

app.mosaic(
vg.inputs.slider(
as_, column, field, filterBy, from_, label,
max, min, select, step, value, width
)
)
ParametersDescription
as_ (Parameter)The output selection. A selection clause is added for the currently selected slider option.
field (str)The database column name to use within generated selection clause predicates. Defaults to the column property.
select (Literal["point", "interval"])The type of selection clause predicate to generate if the as option is a Selection. Options include 'point' (default) for equality check or 'interval' for checking an interval from the minimum to the current slider value.
from_ (Relation)A database table to use as a data source for this widget. Used in conjunction with the column property. The minimum and maximum values of the column determine the slider range.
column (str)The name of a database column whose values determine the slider range. Used in conjunction with the from property. The minimum and maximum values of the column determine the slider range.
filterBy (Parameter)A selection to filter the database table indicated by the from property.
min (Union[int, float])The minimum slider value.
max (Union[int, float])The maximum slider value.
step (Union[int, float])The slider step, the amount to increment between consecutive values.
label (str)A text label for this input.
value (Union[int, float])The initial slider value.
width (int)The width of the slider in screen pixels.

4. Table​

  • A sortable, scrollable table component that loads data on demand from a backing database table.
  • It returns a new table component with the provided options.

Function Signature

app.mosaic(
vg.inputs.table(
align, columns, filterBy, from_,
height, maxWidth, rowBatch, width
)
)
ParametersDescription
from_ (Relation)The name of a database table to use as a data source for this widget.
columns (List[str])A list of column names to include in the table grid. If unspecified, all table columns are included.
filterBy (Parameter)A selection to filter the database table indicated by the from property.
align (Dict[str, Literal["left", "right", "center", "justify"]])An object of per-column alignment values. Column names should be object keys, which map to alignment values. Valid alignment values are "left", "right", "center", and "justify". By default, numbers are right-aligned and other values are left-aligned.
width (Union[int, Dict[str, int]])If a number, sets the total width of the table widget in pixels. If an object, provides per-column pixel width values. Column names should be object keys, mapped to numeric width values.
maxWidth (int)The maximum width of the table widget in pixels.
height (int)The height of the table widget in pixels.
rowBatch (int)The number of rows loaded in a new batch upon table scroll.