SelectTagMeta
Last updated
Last updated
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.
default
str
Tag
name
project_id
int
Determine Project
from which Tags
will be selected.
project_meta
ProjectMeta
Determine ProjectMeta
from which Tags
will be selected
allowed_types
List[str]
Determine Tags
types witch will be available to select from all Project
Tags
multiselect
bool
Allows to select multiple Tags
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size
widget_id
str
ID of the widget
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
get_selected_name()
Return selected tag name. If multiselect is True
raise RuntimeError
.
get_selected_names()
Return List
with selected Tag
names. If multiselect is False
raise RuntimeError
.
get_tag_meta_by_name(name: str)
Return TagMeta
by Tag
name.
get_selected_item()
Return TagMeta
for selected Tag
.
get_selected_items()
Return List
, containing TagMeta
for selected tags.
set_name(name: str)
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
.
You can find this example in our Github repository:
ui-widgets-demos/selection/007_select_tag_meta/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Project
IDSelectTagMeta
widgetPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.