TagsListSelector
Introduction
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.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Supervisely tag metas collection or list of tag metas |
|
| Enable multiple tags selection |
|
| Notification that will be displayed when there are no tags in widget |
|
| ID of the widget |
tag_metas
List of TagMeta
objects or Supervisely object class collection (TagMetaCollection
).
type: Union[List[TagMeta], TagMetaCollection]
multiple
If True
then multiple tags can be selected. Otherwise, only one tag can be selected.
type: bool
default False
empty_notification
Notification that will be displayed when there are no tags in widget
type: NotificationBox
default None
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Set tags to widget. |
| Return list of selected tags. |
| Select all tags. |
| Deselect all tags. |
| Select tags by names. |
| Deselect tags by names. |
| Set multiple flag. |
| Return list of all tags. |
| Callback triggers when selection is changed. |
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/017_tags_list_selector/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Create list of tag metas
Initialize TagsListSelector
widget, NotificationBox
widget for custom notification and Text
widget for displaying selected tags count
TagsListSelector
widget, NotificationBox
widget for custom notification and Text
widget for displaying selected tags countCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created into the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from python code
Last updated