Type Alias: BaseTreemapTrace
ts
type BaseTreemapTrace = Omit<CommonTraceAttributes, 'hoverinfo'> & DomainTraceAttributes & object;Treemap: a hierarchy as nested rectangles sized by value, with a path bar and drill-down.
Type Declaration
| Name | Type | Description |
|---|---|---|
branchvalues? | "remainder" | "total" | How values of branches are read: remainder adds each node's value to its descendants' (a branch is bigger than its children), total takes it as the branch's total, which must not be less than its children's sum (the trace is not drawn otherwise). |
count? | "branches" | "leaves" | "branches+leaves" | "leaves+branches" | Without values: what a node counts to size it — the leaves below it, its branches, or both. |
hoverinfo? | PerPoint< | "label" | "text" | "value" | "name" | "current path" | "percent root" | "percent entry" | "percent parent" | `${"label" | "text" | "value" | "name" | "current path" | "percent root" | "percent entry" | "percent parent"}+${string}` | "all" | "none" | "skip"> | Which fields hover labels show, in a fixed order (percentages read '25% of Eve'); 'skip' also turns hover events off for this trace. |
insidetextfont? | TreemapTraceInsidetextfont | Font of labels inside nodes. Defaults to textfont, with a color contrasting the node. |
labels? | DataColumn | Label of each tile. Without ids, labels are also the node ids parents refer to, so they must be unique among parents. |
level? | unknown | Id of the node shown as the root (the entry): '' or unset for the whole hierarchy. Clicking a node sets it (drill-down); clicking the entry goes back up. |
marker? | TreemapTraceMarker | Tile style. |
maxdepth? | number | Levels drawn from the entry down, the entry included; -1 draws them all. Deeper nodes appear when drilling in. |
outsidetextfont? | TreemapTraceOutsidetextfont | Font of the root's label when the root is transparent (it sits on the background; not with a colorscale or several roots). Defaults to textfont. |
parents? | DataColumn | Parent of each node: its id (an ids entry, else a labels entry). '' marks a root; several roots get a generated root above them. Without any '', the one parent that is not a node becomes the root. |
pathbar? | TreemapTracePathbar | The path bar: where the current root sits in the hierarchy. |
root? | TreemapTraceRoot | Root style. |
sort? | boolean | Order siblings by value, largest first; otherwise in data order. |
text? | DataColumn | Text per tile, shown with the text flag of textinfo, and in hover labels unless hovertext is set. |
textfont? | TreemapTraceTextfont | Font of node labels. Defaults to layout.font. |
textinfo? | | "label" | "text" | "value" | "current path" | "percent root" | "percent entry" | "percent parent" | `${"label" | "text" | "value" | "current path" | "percent root" | "percent entry" | "percent parent"}+${string}` | "none" | What node labels show, one per line in a fixed order: label, value, current path, the percentages (of the parent, the entry, the root; '25% of parent' when several), text. Default 'label', 'text+label' when text is an array. Use texttemplate for other layouts. |
textposition? | | "top left" | "top center" | "top right" | "middle left" | "middle center" | "middle right" | "bottom left" | "bottom center" | "bottom right" | Where labels sit in their tiles. Branch labels (headers) sit in the top padding, or the bottom one for the bottom positions. |
texttemplate? | PerPoint<string | number> | Template for node labels, overriding textinfo: %{label}, %{value}, %{currentPath}, %{percentParent}, %{parent}, %{percentEntry}, %{entry}, %{percentRoot}, %{root}, %{text}, %{color}, %{customdata}, %{meta}, with optional d3 formats (%{percentRoot:.1%}). |
tiling? | TreemapTraceTiling | How tiles are laid out. |
type | "treemap" | Trace type. |
values? | DataColumn | Value of each tile, a number ≥ 0 (rows with other values are dropped). How branches add up is branchvalues; without values, nodes are sized by count. |