TreemapChart
Last updated
Last updated
TreemapChart
widget in Supervisely is a widget used for displaying a treemap chart. It allows users to visualize data for comparison distribution of different objects. The TreemapChart widget allows easily visualize data to determine the distribution of objects in comparison to each other.
title
str
TreemapChart
title
colors
List[str]
Determines colors for cells in series in TreemapChart
tooltip
str
Determines tooltip for cells in series in TreemapChart
Determines TreemapChart
title.
type: str
Determines colors for cells in series in TreemapChart
. The colors should be in hex
format (e.g. #ff0000
).
type: List[str]
default value: None
Determines the tooltip for cells in series in TreemapChart
. The tooltip should be in str
format and may contain {x}
and {y}
placeholders. The name of the cell will be shown instead of {x}
and the value of the cell will be shown instead of {y}
. If not specified, the default tooltip will be used (e.g. name: value
)
type: str
default value: None
add_series(names: List[str], values: List[Union[int, float]])
Adds a new series to the TreemapChart
widget.
set_series(names: List[str], values: List[Union[int, float]])
Sets a series to the TreemapChart
widget, removing all previous series.
get_series(index: int))
Returns a series from the TreemapChart
widget by index.
delete_series(index: int)
Deletes a series from the TreemapChart
widget by index.
get_clicked_datapoint()
Returns the clicked datapoint from the TreemapChart
widget as namedtuple.
You can find this example in our GitHub repository:
supervisely-ecosystem/ui-widgets-demos/charts-and-plots/008_treemap_chart/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare a layout for the 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 the layout parameter.