Table
Introduction
Table
widget in Supervisely allows for displaying and manipulating data in a table format.
It supports data in the Pandas DataFrame format or a Python dictionary with a specific structure.
The Table
widget allows searching, sorting by column and direction, and the ability to download or customize data before downloading. It also allows for the creation of buttons in table cells and updating table data in real-time through Python code.
Function signature
or
Parameters
data
Data of table in different formats:
Pandas Dataframe:
Python dict with structure:
columns
List of columns names.
type: Optional[list]
default value: None
fixed_cols
Number of fixed colums (left to right).
type: Optional[int]
default value: None
per_page
Default per page value.
type: Optional[int]
default value: 10
page_sizes
Page sizes presets.
type: Optional[List[int]]
default value: [10, 15, 30, 50, 100]
width
Width of table.
type: Optional[str]
default value: auto
sort_column_id
Column ID by which the table will be sorted.
type: int
default value: 0
sort_direction
Table sorting direction.
type: Optional[Literal["asc", "desc"]]
default value: asc
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/tables/001_table/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare function that creates example pandas table
Create data for table.
Initialize Table
widget
Table
widgetor you can initialize empty table and set data later.
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 functions to control widget from python code
Last updated