ClassicTable
Introduction
ClassicTable
is a widget in Supervisely that is used for displaying and manipulating data in a table format. It is similar to the Table
widget but with fewer customization options and functionalities.
Note, that this is a legacy version. It is recommended to use the newer Table
widget instead.
Function signature
or
Parameters
Parameters | Type | Description |
---|---|---|
|
| Data of table |
|
| List of columns names |
|
| Number of fixed columns (left to right) |
|
| ID of the widget |
data
Data of table in different formats:
Pandas Dataframe:
Python dict with structure:
columns
List of columns names.
type: list
default value: None
fixed_columns_num
Number of fixed colums (left to right).
type: int
default value: None
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Get or set number of fixed columns (left to right) property. |
| Convert table data to json. |
| Convert table data to pandas dataframe. |
| Read and set table data from json. |
| Read and set table data from pandas dataframe. |
| Insert new row in table. |
| Remove row from table by index. |
| Get selected table cell info. |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/tables/002_classic_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 ClassicTable
widget
ClassicTable
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.
Last updated