Rate
Last updated
Last updated
Rate
widget in Supervisely that allows users to provide a rating using a graphical interface. It provides a customizable rating scale and supports features like disabling the widget, allowing half ratings, and displaying text labels.
Parameters | Type | Description |
---|---|---|
|
| Rating score |
|
| Max rating score |
|
| Whether |
|
| Whether picking half start is allowed |
|
| Text array |
|
| Whether to display texts |
|
| Color of texts |
|
| Text template when the component is read-only |
|
| Color array for icons |
|
| Color of unselected icons |
|
| Color of unselected read-only icons |
|
| ID of the widget |
Determine max rating score.
type: int
default value: 5
Determine color array for icons. It should have 3 elements, each of which corresponds with a score level
type: List[str]
default value: ["#F7BA2A", "#F7BA2A", "#F7BA2A"]
Determine whether Rate
is read-only.
type: bool
default value: False
Determine whether picking half start is allowed.
type: bool
default value: False
Determine text array for each star. Available if show_text
is True
type: List[str]
default value: []
Determine whether to display texts.
type: bool
default value: False
Determine color of texts.
type: str
default value: "#1F2D3D"
Determine color of unselected icons.
type: str
default value: "#C6D1DE"
Determine color of unselected read-only icons.
type: str
default value: "#C6D1DE"
Attributes and Methods | Description |
---|---|
| Property return |
| Get |
| Set |
| Get max rating score. |
| Set max rating score. |
| Get color array for icons. |
| Set color array for icons. |
| Enable rate`s read-only property. |
| Disable rate`s read-only property. |
| Enable picking half star. |
| Disable picking half star. |
| Return text array for each star. |
| Set text for each star. |
| Enable displaying texts. |
| Disable displaying texts. |
| Get color of texts. |
| Set color of texts. |
| Get color of unselected icons. |
| Set color of unselected icons. |
| Get color of unselected read-only icons. |
| Set color of unselected read-only icons. |
| Decorator function is handled when input |
You can find this examples in our Github repository:
supervisely-ecosystem/ui-widgets-demos/status-elements/008_rate/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
In this guide, let's look at 3 examples of using the widget Rate
in the one app.
Initialize Rate
widget
Prepare InputNumber
, Button
and Card
widgets we will use in this example
Add functions to control widgets from python code
Create app
Prepare a layout for app using Card
widget with the content
parameter.
Create an app object with layout parameter.
Initialize Rate
widget
Prepare InputNumber
, Button
and Card
widgets we will use in this example
Add functions to control widgets from python code
Create app
Prepare a layout for app using Card
widget with the content
parameter.
Create an app object with layout parameter.
Initialize Rate
widget
Prepare Input
, Field
, Text
, Button
and Card
widgets we will use in this example
Add functions to control widgets from python code
Create app
Prepare a layout for app using Card
widget with the content
parameter.
Create an app object with layout parameter.