SelectWorkspace
Last updated
Last updated
SelectWorkspace
widget in Supervisely is a dropdown menu that allows users to select a workspace from a list of available workspaces. Clicking on it can be processed from python code. This widget is particularly useful when working with multiple workspaces in Supervisely and allows to easily switch between workspaces in applications.
Determine Workspace
will be selected by default.
type: int
default value: None
Determine Team
will be selected by default.
type: int
default value: None
Show only Workspace
select.
type: bool
default value: false
Determine show text Workspace
on widget or not, work only if compact
is True.
type: bool
default value: True
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
ID of the widget.
type: str
default value: None
You can find this example in our Github repository:
ui-widgets-demos/selection/003_select_workspace/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
team_id
and workspace_id
SelectWorkspace
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.
Parameters | Type | Description |
---|---|---|
Attributes and Methods | Description |
---|---|
default_id
int
Workspace
ID
team_id
int
Team
ID
compact
bool
Show only workspace select
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size (large/small/mini)
widget_id
str
ID of the widget
get_selected_id()
Return selected workspace id.