SelectTagMeta widget in Supervisely is a drop down menu that allows users to select a TagMeta from a list of available tag metadatas. The widget can be customized with various parameters, such as the default selected tag metadata, default project ID, size, allowed types, multiple selection, label showing.
Function signature
Copy SelectTagMeta (
default = None ,
project_id = None ,
project_meta = None ,
allowed_types = None ,
multiselect = False ,
show_label = True ,
size = None ,
widget_id = None ,
) Parameters
Type
Description
Determine Project from which Tags will be selected.
Determine ProjectMeta from which Tags will be selected
Determine Tags types witch will be available to select from all Project Tags
Allows to select multiple Tags
Literal["large", "small", "mini", None]
Determine Tag will be selected by default.
type: str
default value: None
Determine Project from which Tags will be selected.
type: int
default value: None
Determine ProjectMeta from which Tags will be selected.
type: ProjectMeta
default value: None
Determine Tags types witch will be available to select from all Project Tags. Possible Tag types: any_number, any_string, one_of_string, none.
type: List[str]
default value: None
Allows to select multiple Tags.
type: bool
default value: False
Determine show text Tag on widget or not.
type: bool
default value: True
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods
Description
Return selected tag name. If multiselect is True raise RuntimeError.
Return List with selected Tag names. If multiselect is False raise RuntimeError.
get_tag_meta_by_name(name: str)
Return TagMeta by Tag name.
Return TagMeta for selected Tag.
Return List, containing TagMeta for selected tags.
Set Tag with given name as selected.
set_names(names: List[str])
Set Tags from given list of Tag names as selected. If multiselect is False raise RuntimeError.
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/007_select_tag_meta/src/main.pyarrow-up-right
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare Project ID
Create app layout
Prepare a layout for app using Card widget with the content parameter and place widget that we've just created in the Container widget.
Create app using layout
Create an app object with layout parameter.