The Treemap component for Retool Apps
A content area to display treemaps.
The Treemap component renders hierarchical data as nested rectangles. Treemap is useful for visualizing data with many categories and comparing the size and relationship of those categories.
For more information about using the Treemap component, refer to the charts guide.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
chartType
The type of chart to display.
Type | string | ||||||||||||||||||||||||||||||||||||||||||
Format | Plain Text | ||||||||||||||||||||||||||||||||||||||||||
Mutability |
| ||||||||||||||||||||||||||||||||||||||||||
Allowed Values |
|
Examples
"bar"
clearOnEmptyData
Whether to clear the chart when the data is empty.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
colorArray
A list of colors to use when colorInputMode
is colorArray
.
Type | array | ||||
Format | Color | ||||
Array values | string | ||||
Mutability |
|
Examples
["#ff0000", "#00ff00", "#0000ff"]
colorArrayDropDown
A list of colors to use when colorInputMode
is colorArrayDropDown
.
Type | array | ||||
Format | Color | ||||
Array values | string | ||||
Mutability |
|
Examples
["#ff0000", "#00ff00", "#0000ff"]
colorInputMode
The mode for the color input.
Type | string | ||||||||||||
Format | Plain Text | ||||||||||||
Mutability |
| ||||||||||||
Allowed Values |
| ||||||||||||
Default |
|
Examples
"colorArray"
datasource
The source data when using UI Form.
Type | array | ||||
Array values | object | ||||
Mutability |
|
datasourceMode
The data source mode.
Type | string | ||||||
Mutability | Read-only | ||||||
Allowed Values |
|
gradientColorArray
A list of colors to use when colorInputMode
is gradientColorArray
.
Type | array | ||||
Format | Color | ||||
Array values | string | ||||
Mutability |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
hoverTemplate
The tooltip template for displaying information when you hover over a point.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
%{value}<br>%{percent}<extra></extra>
hoverTemplateMode
Whether the hover tooltip text maps from available options or is manually specified.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
|
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
labelData
A list of labels for each node.
Type | array | ||||
Array values | string | ||||
Mutability |
| ||||
Default |
|
Examples
["Node 1", "Node 2", "Node 3"]
labelDataMode
Whether labels map from a selected option or are manually specified.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
|
legendPosition
The position of the legend.
Type | string | ||||||||||||||||||
Mutability |
| ||||||||||||||||||
Allowed Values |
|
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
parentData
The parent to which a given node is associated.
Type | array | ||||
Array values | string | ||||
Mutability |
|
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
textTemplate
The format to use for data labels, constructed in Plotly template format.
Type | string | ||||
Mutability |
|
textTemplateMode
Whether the text template is in manual mode.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability | Read-only | ||||||
Allowed Values |
|
toolbar
The toolbar configuration.
Type | object | ||||
Mutability |
|
Object Properties
showAutoscale
Whether to show the Autoscale button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showBoxSelect
Whether to show the Box select button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showLassoSelect
Whether to show the Lasso select button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showPan
Whether to show the Pan button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showResetViews
Whether to show the Reset view button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showToImage
Whether to show the Download as PNG button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showZoomIn
Whether to show the Zoom in button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showZoomOut
Whether to show the Zoom out button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showZoomSelect
Whether to show the Zoom select button.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
valueData
The value for a specific node.
Type | array | ||||
Array values | number | ||||
Mutability |
|
valueDataMode
Whether values map from a selected option or are manually specified.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
treemap.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
treemap.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring treemap
into view.
treemap.scrollIntoView({behavior: 'auto', block: 'nearest'});
treemap.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
treemap.setHidden(hidden)
Parameters
Examples
true
Examples
Hide treemap
.
treemap.setHidden(true);
Unhide treemap
.
treemap.setHidden(false);
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Clear | A value is cleared. |
Hover | An item is hovered over. |
Legend Click | A legend item is clicked or pressed. |
Legend Double Click | A legend item is double-clicked or pressed. |
Select | A value is selected. |
Unhover | An item is no longer hovered over. |