RadioTable
Last updated
Last updated
RadioTable
widget in Supervisely is a user interface element that allows creating a table of options, each with a corresponding radio button. With RadioTable
widget, developer can define multiple rows of options, and only one row option can be selected. The RadioTable widget provides a convenient and intuitive way to navigate and make selections within the table.
columns
List[str]
RadioTable
columns names
rows
List[List[str]]
RadioTable
rows content
subtitles
Union[Dict[str, str], List]
Determine subtitles for columns
column_formatters
Dict
Determine format of output RadioTable
widget_id
str
ID of the widget
Determine RadioTable
columns names.
type: List[str]
Determine RadioTable
rows content.
type: List[List[str]]
Determine subtitles for columns.
type: Union[Dict[str, str], List]
default value: {}
Determine format of output RadioTable
.
type: Dict
default value: {}
ID of the widget.
type: str
default value: None
columns
Get or set columns
property.
subtitles
Get or set subtitles
property.
rows
Get or set rows
property.
format_value(column_name: str, value: list)
Return column formatter function by given column name.
default_formatter(value: list)
Return default column formatter.
get_selected_row()
Return selected row data.
get_selected_row_index()
Return selected row index.
set_columns(columns: List[str], subtitles: Union[Dict[str, str], List[str]])
Set table columns by given list of column names.
set_data(columns: List[str], rows: List[List[str]], subtitles: Union[Dict[str, str], List[str]])
Set table data.
select_row(row_index: int)
Set row selected by given index. If row with given index does not exist raise ValueError
.
@value_changed
Decorator function is handled when widget value is changed
You can find this example in our Github repository:
ui-widgets-demos/tables/003_radio_table/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
RadioTable
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.