TreemapChart
Introduction
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.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
|
|
|
| Determines colors for cells in series in |
|
| Determines tooltip for cells in series in |
title
Determines TreemapChart
title.
type: str
colors
Determines colors for cells in series in TreemapChart
. The colors should be in hex
format (e.g. #ff0000
).
type: List[str]
default value: None
tooltip
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
Methods and attributes
Methods and attributes | Description |
---|---|
| Adds a new series to the |
| Sets a series to the |
| Returns a series from the |
| Deletes a series from the |
| Returns the clicked datapoint from the |
Mini app example
You can find this example in our GitHub repository:
supervisely-ecosystem/ui-widgets-demos/charts-and-plots/008_treemap_chart/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize TreemapChart widget
Prepare names and values for series
Set series to TreemapChart widget
Using @click event
Create app layout
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 using the layout
Create an app object with the layout parameter.
Last updated