TagMetasList

Introduction

TagMetasList widget allows users to view a list of tag metas, it provide a flexible display option with a choice of single-column or multiple-column layouts. It also allows users to select or deselect one or more tags, making it easy to manage and organize object classes. This widget is a useful tool for visualizing and selecting tags in Supervisely.

Function signature

tag_metas_list = TagMetasList(
    tag_metas=project_meta.tag_metas,
    show_type_text=True,
    limit_long_names=True,
    selectable=True,
    columns=1,
    widget_id=None
)

Parameters

Parameters
Type
Description

tag_metas

Union[TagMetasCollection, List[TagMeta]]

Supervisely object class collection or list of object classes

show_type_text

bool

If True display tag value type

limit_long_names

bool

If False show the entire tag name if the name is quite lengthy

selectable

bool

Enable classes selection

columns

int

Number of columns

widget_id

str

ID of the widget

tag_metas

Supervisely object class collection (TagMetaCollection) or list of TagMeta.

type: Union[TagMetaCollection, List[TagMeta]]

show_type_text

If True display tag value type next to tag name.

type: bool

default value: True

limit_long_names

If False show the entire tag name if the name is quite lengthy

type: bool

default value: False

selectable

Enable tags selection.

type: bool

default False

columns

Number of columns.

type: int

default 1

widget_id

ID of the widget.

type: str

default value: None

Methods and attributes

Attributes and Methods
Description

get_selected_tag_names()

Return list of selected tag names.

Mini App Example

You can find this example in our Github repository:

supervisely-ecosystem/ui-widgets-demos/media/014_tag_metas_list/src/main.py

Import libraries

Init API client

First, we load environment variables with credentials and init API for communicating with Supervisely Instance:

Initialize Project ID

Get Project info and meta

Initialize TagMetasList widget

Add button and preview

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.

Add button click event to update preview

Last updated

Was this helpful?