Skip to contents

Adds an input to select from the entered options, allowing for multiple selection, dynamic filtering, and custom entries.

Usage

input_combobox(label, options, default = -1, display = options,
  id = label, ..., strict = TRUE, numeric = FALSE, search = TRUE,
  multi = FALSE, accordion = FALSE, clearable = FALSE, note = NULL,
  group_feature = NULL, variable = NULL, dataset = NULL,
  depends = NULL, dataview = NULL, subset = "filtered",
  selection_subset = "full_filter", filters = NULL, reset_button = FALSE,
  button_class = NULL, as.row = FALSE, floating_label = TRUE)

Arguments

label

Label of the input for the user.

options

A vector of options, the name of a variable from which to pull levels, or "datasets", "variables", "ids", or "palettes" to select names of datasets, variables, entity ids, or color palettes. If there is a map with overlay layers with properties, can also be "overlay_properties", to select between properties.

default

Which of the options to default to; either its index or value.

display

A display version of the options.

id

Unique ID of the element to be created.

...

Additional attributes to set on the input element.

strict

Logical; if FALSE, allows arbitrary user input, rather than limiting input to the option set.

numeric

Logical; if TRUE, will treat all numeric inputs as custom values, rather than as potential option indices.

search

Logical; if FALSE, does not dynamically filter the option set on user input.

multi

Logical; if TRUE, allows multiple options to be selected.

accordion

Logical; if TRUE, option groups will be collapsible.

clearable

Logical; if TRUE, adds a button to clear the selection.

note

Text to display as a tooltip for the input.

group_feature

Name of a measure or entity feature to use as a source of option grouping, if options is "variables" or "ids".

variable

The name of a variable from which to get levels (overwritten by depends).

dataset

The name of an included dataset, where variable should be looked for; only applies when there are multiple datasets with the same variable name.

depends

The ID of another input on which the options depend; this will take president over dataset and variable, depending on this type of input depends points to.

dataview

The ID of an input_dataview, used to filter the set of options, and potentially specify dataset if none is specified here.

subset

Determines the subset of options shown if options is "ids"; mainly "filtered" (default) to apply all filters, including the current selection, or "full_filter" to apply all feature and variable filters, but not the current selection. "siblings" is a special case given a selection, which will show other IDs with the same parent.

selection_subset

Subset to use when a selection is made; defaults to "full_filter".

filters

A list with names of meta entries (from variable entry in data_add's meta list), and values of target values for those entries, or the IDs of value selectors.

reset_button

If specified, adds a button after the input element that will revert the selection to its default; either TRUE, or text for the reset button's label.

button_class

Class name to add to the reset button.

as.row

Logical; if TRUE, the label and input are in separate columns within a row.

floating_label

Logical; if FALSE or as.row is TRUE, labels are separate from their inputs.

Value

A character vector of the contents to be added.

See also

See input_select for a more standard select input, or input_text for a free-form input.

Examples

if (FALSE) {
input_combobox("Options", c("a", "b"))
}