TagsListSelector
Last updated
Was this helpful?
Last updated
Was this helpful?
Tags List Selector
widget allows users to view a list of tag metas and change it dynamically using widget methods. This widget can be used for visualizing and selecting tags in Supervisely.
tag_metas
Union[List[TagMeta], TagMetaCollection]
Supervisely tag metas collection or list of tag metas
multiple
bool
Enable multiple tags selection
empty_notification
NotificationBox
Notification that will be displayed when there are no tags in widget
widget_id
str
ID of the widget
List of TagMeta
objects or Supervisely object class collection (TagMetaCollection
).
type: Union[List[TagMeta], TagMetaCollection]
If True
then multiple tags can be selected. Otherwise, only one tag can be selected.
type: bool
default False
Notification that will be displayed when there are no tags in widget
type: NotificationBox
default None
ID of the widget.
type: str
default value: None
set()
Set tags to widget.
get_selected_tags()
Return list of selected tags.
select_all()
Select all tags.
deselect_all()
Deselect all tags.
select()
Select tags by names.
deselect()
Deselect tags by names.
set_multiple()
Set multiple flag.
get_all_tags()
Return list of all tags.
@selection_changed
Callback triggers when selection is changed.
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/017_tags_list_selector/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
TagsListSelector
widget, NotificationBox
widget for custom notification and Text
widget for displaying selected tags countPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created into the Container
widget.
Create an app object with layout parameter.