Usage
Signature:
interface TreemapElement<K, D extends ojTreemap.Node<K>|any>
Generic Parameters
Parameter Description K Type of key of the dataprovider D Type of data from the dataprovider
Typescript Import Format
//To typecheck the element APIs, import as below.
import { TreemapElement } from "ojs/ojtreemap";
//For the transpiled javascript to load the element's module, import as below
import "ojs/ojtreemap";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Slots
JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
-
contextMenu
-
The contextMenu slot is set on the
oj-menuwithin this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.
To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc of the individual components for details.
Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.
-
nodeContentTemplate
-
The
nodeContentTemplateslot is used to specify custom node content for leaf nodes of a treemap. The slot content must be a single <template> element. This slot takes precedence over the nodeContent.renderer property if specified.When the template is executed, the component's binding context is extended with the following properties:
- $current - an object that contains information for the current node. (See oj.ojTreemap.NodeContentContext or the table below for a list of properties available on $current)
Properties of $current:
Name Type Description boundsobject Object containing information on the node area. The x and y coordinates are relative to the top, left corner of the element. Properties
Name Type Description heightnumber The height of the node area. widthnumber The width of the node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. componentElementElement The treemap element. dataojTreemap.Node<K> The data object of the node. idK The id of the node. itemDataD The row data object for the node. This will only be set if a DataProvider is being used. -
nodeTemplate
-
The
nodeTemplateslot is used to specify the template for creating nodes of the treemap. The slot content must be wrapped in a single <template> element. The content of the template should be a single <oj-treemap-node> element. See the oj-treemap-node doc for more details.When the template is executed for each node, it will have access to the components's binding context containing the following properties:
- $current - an object that contains information for the current node. (See oj.ojTreemap.NodeTemplateContext or the table below for a list of properties available on $current)
- alias - if data-oj-as attribute was specified, the value will be used to provide an application-named alias for $current.
Properties of $current:
Name Type Description componentElementElement The <oj-treemap> custom element dataD The data object of the node indexnumber The zero-based index of the current node keyK The key of the current node parentDataD[] An array of data objects of the outermost to innermost parents of the node parentKeyK The key of the parent node -
tooltipTemplate
-
The
tooltipTemplateslot is used to specify custom tooltip content. The slot content must be a single <template> element. This slot takes precedence over the tooltip.renderer property if specified.When the template is executed, the component's binding context is extended with the following properties:
- $current - an object that contains information for the current node. (See oj.ojTreemap.TooltipContext or the table below for a list of properties available on $current)
Properties of $current:
Name Type Description colorstring The color of the hovered node. componentElementElement The treemap element. dataojTreemap.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. parentElementElement The tooltip element. The function can directly modify or append content to this element. valuenumber The value of the hovered node.
Attributes
-
animation-duration :number
-
Specifies the animation duration in milliseconds. For data change animations with multiple stages, this attribute defines the duration of each stage. For example, if an animation contains two stages, the total duration will be two times this attribute's value. The default value comes from the CSS and varies based on theme.
Names
Item Name Property animationDurationProperty change event animationDurationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-duration-changed -
animation-on-data-change :"auto"|"none"
-
Specifies the animation that is applied on data changes.
- Default Value:
"none"
Supported Values:
Value autononeNames
Item Name Property animationOnDataChangeProperty change event animationOnDataChangeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-on-data-change-changed -
animation-on-display :"auto"|"none"
-
Specifies the animation that is shown on initial display.
- Default Value:
"none"
Supported Values:
Value autononeNames
Item Name Property animationOnDisplayProperty change event animationOnDisplayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-on-display-changed -
animation-update-color :string
-
The color that is displayed during a data change animation when a node is updated.
- Default Value:
""
Names
Item Name Property animationUpdateColorProperty change event animationUpdateColorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-update-color-changed -
as :string
-
An alias for the $current context variable passed to slot content for the nodeTemplate slot.
- Deprecated:
-
Since Description 6.2.0Set the alias directly on the template element using the data-oj-as attribute instead.
- Default Value:
""
Names
Item Name Property asProperty change event asChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-as-changed -
color-label :string
-
Specifies the label describing the color metric of the treemap. This label will be used in the legend.
- Default Value:
""
Names
Item Name Property colorLabelProperty change event colorLabelChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-color-label-changed -
data :(DataProvider.<K, D>|null)
-
The DataProvider for the nodes of the treemap. It should provide a data tree where each node in the data tree corresponds to a node in the treemap. The row key will be used as the id for treemap nodes. Note that when using this attribute, a template for the nodeTemplate slot should be provided. The DataProvider can either have an arbitrary data shape, in which case an
element must be specified in the nodeTemplate slot or it can have oj.oj.ojTreemap.Node as its data shape, in which case no template is required. A progressive loading indicator is shown by the component when the data provider fetch takes longer than a certain time. - Default Value:
null
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
display-levels :number
-
The number of levels of nodes to display. By default all nodes are displayed.
- Default Value:
Number.MAX_VALUE
Names
Item Name Property displayLevelsProperty change event displayLevelsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-levels-changed -
drilling :"on"|"off"
-
Specifies whether drilling is enabled. Drillable nodes will show a pointer cursor on hover and fire an
ojBeforeDrillandojDrillevent on click (double click if selection is enabled). Drilling on a node causes a property change to the rootNode attribute. The displayLevels attribute can be used in conjunction with drilling to display very deep hieracrchies. Use "on" to enable drilling for all nodes. To enable or disable drilling on individual nodes use the drilling attribute in each node.- Default Value:
"off"
Supported Values:
Value offonNames
Item Name Property drillingProperty change event drillingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-drilling-changed -
group-gaps :"all"|"none"|"outer"
-
Specifies whether gaps are displayed between groups. Gaps can be useful for drawing attention to the differences between groups.
- Default Value:
"outer"
Supported Values:
Value allnoneouterNames
Item Name Property groupGapsProperty change event groupGapsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-group-gaps-changed -
hidden-categories :Array.<string>
-
An array of category strings used for filtering. Nodes with any category matching an item in this array will be filtered.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property hiddenCategoriesProperty change event hiddenCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hidden-categories-changed -
highlight-match :"any"|"all"
-
The matching condition for the highlightedCategories property. By default, highlightMatch is 'all' and only items whose categories match all of the values specified in the highlightedCategories array will be highlighted. If highlightMatch is 'any', then items that match at least one of the highlightedCategories values will be highlighted.
- Default Value:
"all"
Supported Values:
Value allanyNames
Item Name Property highlightMatchProperty change event highlightMatchChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlight-match-changed -
highlight-mode :"categories"|"descendants"
-
Controls which nodes are highlighted when hoverBehavior is set to 'dim'. If highlight-mode is set to 'categories', nodes with the same category as the hovered node will be highlighted. If highlight-mode is set to 'descendants', descendants of the hovered node will be highlighted; the highlighted-categories attribute will also be ignored in this case. If hover-behavior is set to 'none', highlighting can only be done by setting highlight-mode to 'categories' and populating the highlighted-categories attribute
- Default Value:
"categories"
Supported Values:
Value categoriesdescendantsNames
Item Name Property highlightModeProperty change event highlightModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlight-mode-changed -
highlighted-categories :Array.<string>
-
An array of category strings used for highlighting. Nodes matching categories in this array will be highlighted.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property highlightedCategoriesProperty change event highlightedCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlighted-categories-changed -
hover-behavior :"dim"|"none"
-
Defines the behavior applied when hovering over the nodes.
- Default Value:
"none"
Supported Values:
Value dimnoneNames
Item Name Property hoverBehaviorProperty change event hoverBehaviorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hover-behavior-changed -
hover-behavior-delay :number
-
Specifies initial hover delay in milliseconds for highlighting nodes.
- Default Value:
200
Names
Item Name Property hoverBehaviorDelayProperty change event hoverBehaviorDelayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hover-behavior-delay-changed -
isolated-node :any
-
The id of the initially isolated node.
- Default Value:
""
- Supports writeback:
true
Names
Item Name Property isolatedNodeProperty change event isolatedNodeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-isolated-node-changed -
layout :"sliceAndDiceHorizontal"|"sliceAndDiceVertical"|"squarified"
-
Specifies the layout of the treemap. The squarified layout results in nodes that are as square as possible, for easier comparison of node sizes. The sliceAndDice layouts are useful for animation, as the ordering of the data is maintained. SliceAndDice layouts are also useful for small form factor treemaps.
- Default Value:
"squarified"
Supported Values:
Value sliceAndDiceHorizontalsliceAndDiceVerticalsquarifiedNames
Item Name Property layoutProperty change event layoutChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-layout-changed -
node-content :Object
-
An object defining custom node content for the treemap. Only leaf nodes with no child nodes will have the custom content rendered.
Names
Item Name Property nodeContentProperty change event nodeContentChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-node-content-changed -
node-content.renderer :((context: ojTreemap.NodeContentContext<K, D>) => ({insert: Element|string}))
-
A function that returns custom node content. The function takes a NodeContentContext argument, provided by the treemap. The function should return an Object with the following property:
- insert: HTMLElement - An HTML element, which will be overlaid on top of the treemap. This HTML element will block interactivity of the treemap by default, but the CSS pointer-events property can be set to 'none' on this element if the treemap's interactivity is desired.
- Default Value:
null
Names
Item Name Property nodeContent.renderer -
node-defaults :Object
-
An object defining default properties for the nodes. Component CSS classes should be used to set component wide styling. This API should be used only for styling a specific instance of the component. Properties specified on this object may be overridden by specifications on the treemap nodes. Some property default values come from the CSS and varies based on theme.
Names
Item Name Property nodeDefaultsProperty change event nodeDefaultsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-node-defaults-changed -
node-defaults.group-label-display :"node"|"off"|"header"
-
The label display behavior for group nodes.
- Default Value:
"header"
Supported Values:
Value headernodeoffNames
Item Name Property nodeDefaults.groupLabelDisplay -
node-defaults.header :Object
-
An object defining default properties for the node header. Component CSS classes should be used to set component wide styling. This API should be used only for styling a specific instance of the component. Some property default values come from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header -
node-defaults.header.background-color :string
-
The background color of the node headers. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.backgroundColor -
node-defaults.header.border-color :string
-
The border color of the node headers. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.borderColor -
node-defaults.header.hover-background-color :string
-
The background color of the node hover feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.hoverBackgroundColor -
node-defaults.header.hover-inner-color :string
-
The inner color of the node hover feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.hoverInnerColor -
node-defaults.header.hover-outer-color :string
-
The outer color of the node hover feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.hoverOuterColor -
node-defaults.header.isolate :"off"|"on"
-
Specifies whether isolate behavior is enabled on the node.
- Default Value:
"on"
Supported Values:
Value offonNames
Item Name Property nodeDefaults.header.isolate -
node-defaults.header.label-halign :"center"|"end"|"start"
-
The horizontal alignment of the header title.
- Default Value:
"start"
Supported Values:
Value centerendstartNames
Item Name Property nodeDefaults.header.labelHalign -
node-defaults.header.label-style :Partial<CSSStyleDeclaration>
-
The CSS style string defining the style of the header title. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.labelStyle -
node-defaults.header.selected-background-color :string
-
The background color of the node selection feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.selectedBackgroundColor -
node-defaults.header.selected-inner-color :string
-
The inner color of the node selection feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.selectedInnerColor -
node-defaults.header.selected-outer-color :string
-
The outer color of the node selection feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.header.selectedOuterColor -
node-defaults.header.use-node-color :"on"|"off"
-
Specifies whether the node color should be displayed in the header.
- Default Value:
"off"
Supported Values:
Value offonNames
Item Name Property nodeDefaults.header.useNodeColor -
node-defaults.hover-color :string
-
The color of the node hover feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.hoverColor -
node-defaults.label-display :"off"|"node"
-
The label display behavior for leaf nodes.
- Default Value:
"node"
Supported Values:
Value nodeoffNames
Item Name Property nodeDefaults.labelDisplay -
node-defaults.label-halign :"start"|"end"|"center"
-
The horizontal alignment for labels displayed within the node.
- Default Value:
"center"
Supported Values:
Value centerendstartNames
Item Name Property nodeDefaults.labelHalign -
node-defaults.label-min-length :number
-
The minimum number of visible characters needed in order to render a truncated label. If the minimum is not met when calculating the truncated label then the label is not displayed.
- Default Value:
1
Names
Item Name Property nodeDefaults.labelMinLength -
node-defaults.label-style :Partial<CSSStyleDeclaration>
-
The CSS style object defining the style of the label. The CSS white-space property can be defined with value "nowrap" to disable default text wrapping. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.labelStyle -
node-defaults.label-valign :"top"|"bottom"|"center"
-
The vertical alignment for labels displayed within the node.
- Default Value:
"center"
Supported Values:
Value bottomcentertopNames
Item Name Property nodeDefaults.labelValign -
node-defaults.selected-inner-color :string
-
The inner color of the node selection feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.selectedInnerColor -
node-defaults.selected-outer-color :string
-
The outer color of the node selection feedback. The default value comes from the CSS and varies based on theme.
Names
Item Name Property nodeDefaults.selectedOuterColor -
node-separators :"bevels"|"gaps"
-
Specifies the visual effect for separating the nodes from each other. This allows for adjacent nodes of the same color to be distinguished.
- Default Value:
"gaps"
Supported Values:
Value bevelsgapsNames
Item Name Property nodeSeparatorsProperty change event nodeSeparatorsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-node-separators-changed -
nodes :(Array.<oj.ojTreemap.Node.<K>>|Promise.<Array.<oj.ojTreemap.Node.<K>>>|null)
-
An array of objects with the following properties that defines the data for the nodes. Also accepts a Promise for deferred data rendering. No data will be rendered if the Promise is rejected.
Type details
Setter Type (Array.<oj.ojTreemap.Node.<K>>|Promise.<Array.<oj.ojTreemap.Node.<K>>>|null) Getter Type (Promise.<Array.<oj.ojTreemap.Node.<K>>>|null) - Default Value:
null
Names
Item Name Property nodesProperty change event nodesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-nodes-changed -
root-node :any
-
The id of the root node. When specified, only the root node and children of the root will be displayed.
- Default Value:
""
Names
Item Name Property rootNodeProperty change event rootNodeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-root-node-changed -
selection :Array.<any>
-
An array containing the ids of the initially selected nodes.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed -
selection-mode :"none"|"single"|"multiple"
-
The type of selection behavior that is enabled on the treemap. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
singleormultipleis specified, selection gestures will be enabled, and the treemap's selection styling will be applied to all items specified by the selection attribute. Ifnoneis specified, selection gestures will be disabled, and the treemap's selection styling will not be applied to any items specified by the selection attribute.Changing the value of this attribute will not affect the value of the selection attribute.
- Default Value:
"multiple"
Supported Values:
Value Description multipleMultiple items can be selected at the same time. noneSelection is disabled. singleOnly a single item can be selected at a time. Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changed -
size-label :string
-
Specifies the label describing the size metric of the treemap. This label will be used in the legend.
- Default Value:
""
Names
Item Name Property sizeLabelProperty change event sizeLabelChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-size-label-changed -
sorting :"on"|"off"
-
Specifies whether the nodes are sorted by size. When sorting is enabled, nodes that have the same parent are sorted in order of descending size.
- Default Value:
"off"
Supported Values:
Value offonNames
Item Name Property sortingProperty change event sortingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-sorting-changed -
tooltip :Object
-
An object containing an optional callback function for tooltip customization.
Names
Item Name Property tooltipProperty change event tooltipChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-tooltip-changed -
tooltip.renderer :((context: ojTreemap.TooltipContext<K, D>) => ({insert: Element|string}|{preventDefault: boolean}))
-
A function that returns a custom tooltip. The function takes a TooltipContext argument, provided by the treemap. The function should return an Object that contains only one of the two properties:
- insert: HTMLElement | string - An HTML element, which will be appended to the tooltip, or a tooltip string.
- preventDefault:
true- Indicates that the tooltip should not be displayed. It is not necessary to return {preventDefault:false} to display tooltip, since this is a default behavior.
- Default Value:
null
Names
Item Name Property tooltip.renderer -
touch-response :"touchStart"|"auto"
-
Data visualizations require a press and hold delay before triggering tooltips and rollover effects on mobile devices to avoid interfering with page panning, but these hold delays can make applications seem slower and less responsive. For a better user experience, the application can remove the touch and hold delay when data visualizations are used within a non scrolling container or if there is sufficient space outside of the visualization for panning. If touchResponse is touchStart the element will instantly trigger the touch gesture and consume the page pan events. If touchResponse is auto, the element will behave like touchStart if it determines that it is not rendered within scrolling content and if panning is not available for those elements that support the feature.
- Deprecated:
-
Since Description 18.0.0This attribute is deprecated and no longer recommended in the Redwood Design system. The "auto" value behavior will be applied instead.
- Default Value:
"auto"
Supported Values:
Value autotouchStartNames
Item Name Property touchResponseProperty change event touchResponseChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-touch-response-changed -
track-resize :"on"|"off"
-
Defines whether the element will automatically render in response to changes in size. If set to
off, then the application is responsible for callingrefreshto render the element at the new size.- Default Value:
"on"
Supported Values:
Value offonNames
Item Name Property trackResizeProperty change event trackResizeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-track-resize-changed -
translations :object|null
-
A collection of translated resources from the translation bundle, or
nullif this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.If the component does not contain any translatable resource, the default value of this attribute will be
null. If not, an object containing all resources relevant to the component.If this component has translations, their documentation immediately follows this doc entry.
Names
Item Name Property translationsProperty change event translationsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changed -
(nullable) translations.accessible-contains-controls :string
-
Used to describe a container that contains controls.
See the translations attribute for usage examples.
- Since:
- 13.0.0
Names
Item Name Property translations.accessibleContainsControls -
(nullable) translations.component-name :string
-
Used to describe the data visualization type for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Treemap"
Names
Item Name Property translations.componentName -
(nullable) translations.label-and-value :string
-
Used to display a label and its value.
See the translations attribute for usage examples.
- Default Value:
"{0}: {1}"
Names
Item Name Property translations.labelAndValue -
(nullable) translations.label-clear-selection :string
-
Text shown for clearing multiple selection on touch devices.
See the translations attribute for usage examples.
- Default Value:
"Clear Selection"
Names
Item Name Property translations.labelClearSelection -
(nullable) translations.label-color :string
-
Used for the color label.
See the translations attribute for usage examples.
- Default Value:
"Color"
Names
Item Name Property translations.labelColor -
(nullable) translations.label-count-with-total :string
-
Used to display a count out of a total.
See the translations attribute for usage examples.
- Default Value:
"{0} of {1}"
Names
Item Name Property translations.labelCountWithTotal -
(nullable) translations.label-data-visualization :string
-
Label for data visualizations used for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Data Visualization"
Names
Item Name Property translations.labelDataVisualization -
(nullable) translations.label-invalid-data :string
-
Text shown when the component receives invalid data.
See the translations attribute for usage examples.
- Default Value:
"Invalid data"
Names
Item Name Property translations.labelInvalidData -
(nullable) translations.label-no-data :string
-
Text shown when the component receives no data.
See the translations attribute for usage examples.
- Default Value:
"No data to display"
Names
Item Name Property translations.labelNoData -
(nullable) translations.label-size :string
-
Used for the size label.
See the translations attribute for usage examples.
- Default Value:
"Size"
Names
Item Name Property translations.labelSize -
(nullable) translations.state-collapsed :string
-
Used to describe the collapsed state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Collapsed"
Names
Item Name Property translations.stateCollapsed -
(nullable) translations.state-drillable :string
-
Used to describe a drillable object for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Drillable"
Names
Item Name Property translations.stateDrillable -
(nullable) translations.state-expanded :string
-
Used to describe the expanded state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Expanded"
Names
Item Name Property translations.stateExpanded -
(nullable) translations.state-hidden :string
-
Used to describe the hidden state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Hidden"
Names
Item Name Property translations.stateHidden -
(nullable) translations.state-isolated :string
-
Used to describe the isolated state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Isolated"
Names
Item Name Property translations.stateIsolated -
(nullable) translations.state-loaded :string
-
Used by the component when data is loaded.
See the translations attribute for usage examples.
- Default Value:
"Loaded"
- Since:
- 17.0.0
Names
Item Name Property translations.stateLoaded -
(nullable) translations.state-loading :string
-
Used by the component when waiting for data.
See the translations attribute for usage examples.
- Default Value:
"Loading"
- Since:
- 17.0.0
Names
Item Name Property translations.stateLoading -
(nullable) translations.state-maximized :string
-
Used to describe the maximized state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Maximized"
Names
Item Name Property translations.stateMaximized -
(nullable) translations.state-minimized :string
-
Used to describe the minimized state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Minimized"
Names
Item Name Property translations.stateMinimized -
(nullable) translations.state-selected :string
-
Used to describe the selected state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Selected"
Names
Item Name Property translations.stateSelected -
(nullable) translations.state-unselected :string
-
Used to describe the unselected state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Unselected"
Names
Item Name Property translations.stateUnselected -
(nullable) translations.state-visible :string
-
Used to describe the visible state for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Visible"
Names
Item Name Property translations.stateVisible -
(nullable) translations.tooltip-isolate :string
-
Used for the isolate tooltip.
See the translations attribute for usage examples.
- Default Value:
"Isolate"
Names
Item Name Property translations.tooltipIsolate -
(nullable) translations.tooltip-restore :string
-
Used for the restore tooltip.
See the translations attribute for usage examples.
- Default Value:
"Restore"
Names
Item Name Property translations.tooltipRestore
Context Objects
Each context object contains, at minimum, a subId property,
whose value is a string that identifies a particular DOM node in this element. It can have additional properties to further specify the desired node. See getContextByNode for more details.
Properties:
| Name | Type | Description |
|---|---|---|
subId |
string | Sub-id string to identify a particular dom node. |
Following are the valid subIds:
-
oj-treemap-node
-
Context for treemap nodes indexed by their position in the hierarchy.
Properties:
Name Type Description indexPathArray The array of numerical indices for the node.
Events
-
ojBeforeDrill
-
Triggered immediately before any node in the treemap is drilled into. The drill event can be vetoed if the beforeDrill callback returns false.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description dataojTreemap.Node<K> the data object of the drilled node. idK the id of the drilled object itemDataD The row data object for the drilled node. This will only be set if a DataProvider is being used. -
ojDrill
-
Triggered during a drill gesture (double click if selection is enabled, single click otherwise).
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description dataojTreemap.Node<K> the data object of the drilled node. idK the id of the drilled object itemDataD The row data object for the drilled node. This will only be set if a DataProvider is being used.
Methods
-
getContextByNode(node) : {(oj.ojTreemap.NodeContext|null)}
-
Returns an object with context for the given child DOM node. This will always contain the subid for the node, defined as the 'subId' property on the context object. Additional component specific information may also be included. For more details on returned objects, see context objects.
Parameters:
Name Type Argument Description nodeElement <not nullable>
The child DOM node Returns:
The context for the DOM node, or
nullwhen none is found.- Type
- (oj.ojTreemap.NodeContext|null)
-
getNode(subIdPath) : {(oj.ojTreemap.DataContext|null)}
-
Returns an object with the following properties for automation testing verification of the node with the specified subid path.
Parameters:
Name Type Description subIdPathArray The array of indices in the subId for the desired node Deprecated:
Since Description 7.0.0The use of this function is no longer recommended. Returns:
An object containing properties for the node, or null if none exists.
- Type
- (oj.ojTreemap.DataContext|null)
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty. The return type will be the same as the type of the property as specified in this API document. If the method is invoked with an incorrect property/subproperty name, it returns undefined.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh : {void}
-
Refreshes the component.
Returns:
- Type
- void
-
setProperties(properties) : {void}
-
Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value) : {void}
-
Sets a property or a subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");
Type Definitions
-
DataContext
-
Properties:
Name Type Description colorstring The fill color of the node. labelstring The label for this node. selectedboolean True is the node is selected, false otherwise sizenumber The relative size of the node. tooltipstring The tooltip string. -
Node<K,D=any>
-
- Deprecated:
-
Since Description 18.1.0The svgStyle property is deprecated. This API is not recommended in Redwood theme. Use other customization APIs where appropriate.
Properties:
Name Type Argument Default Description categoriesArray.<string> <optional>
An optional array of category strings corresponding to this data item. This enables highlighting and filtering of individual data items through interactions with the legend and other visualization elements. The categories array of each node is required to be a superset of the categories array of its parent node. If not specified, the ids of the node and its ancestors will be used. colorstring <optional>
The fill color of the node. drilling"inherit" | "off" | "on" <optional>
"inherit" Specifies whether drilling is enabled for the node. Drillable nodes will show a pointer cursor on hover and fire an ojDrill event on click (double click if selection is enabled). To enable drilling for all nodes at once, use the drilling attribute in the top level. groupLabelDisplaystring <optional>
The label display behavior for group nodes. headerObject <optional>
An object defining the properties for the node header. Properties
Name Type Argument Default Description isolate"off" | "on" <optional>
"on" Specifies whether isolate behavior is enabled on the node. labelHalign"center" | "end" | "start" <optional>
"start" The horizontal alignment of the header title. labelStylePartial<CSSStyleDeclaration> <optional>
The CSS style object defining the style of the header title. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration. useNodeColor"off" | "on" <optional>
"off" Specifies whether the node color should be displayed in the header. idK <optional>
The id of the node. For the DataProvider case, the key for the node will be used as the id. labelstring <optional>
The label for this node. labelDisplay"node" | "off" <optional>
"node" The label display behavior for leaf nodes. labelHalign"center" | "end" | "start" <optional>
"center" The horizontal alignment for labels displayed within the node. labelStylePartial<CSSStyleDeclaration> <optional>
The CSS style object defining the style of the label. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration. labelValign"bottom" | "center" | "top" <optional>
"center" The vertical alignment for labels displayed within the node. nodesArray.<ojTreemap.Node<K>>= <optional>
An array of objects with properties for the child nodes. pattern"largeChecker" | "largeCrosshatch" | "largeDiagonalLeft" | "largeDiagonalRight" | "largeDiamond" | "largeTriangle" | "none" | "smallChecker" | "smallCrosshatch" | "smallDiagonalLeft" | "smallDiagonalRight" | "smallDiamond" | "smallTriangle" <optional>
"none" The pattern used to fill the node. selectable"auto" | "off" <optional>
"auto" Specifies whether or not the node will be selectable. shortDesc?(string | ((context: ojTreemap.NodeShortDescContext<K,D>) => string)) <optional>
The description of this element. Will be lazily created if a function is used. This is used for accessibility and also for customizing the tooltip text. svgClassNamestring <optional>
The CSS style class to apply to the node. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the node color attribute. svgStylePartial<CSSStyleDeclaration> <optional>
The inline style to apply to the node. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the node color attribute. Only SVG CSS style properties are supported. valuenumber The value of the node, which determines the relative size of the node. -
NodeContentContext<K, D>
-
Properties:
Name Type Description boundsobject Object containing information on the node area. The x and y coordinates are relative to the top, left corner of the element. Properties
Name Type Description heightnumber The height of the node area. widthnumber The width of the node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. componentElementElement The treemap element. dataojTreemap.Node<K> The data object of the node. idK The id of the node. itemDataD The row data object for the node. This will only be set if a DataProvider is being used. -
NodeContext
-
Properties:
Name Type Description indexPathArray.<number> The array of numerical indices for the node. subIdstring The subId string to identify the particular DOM node. -
NodeShortDescContext<K,D>
-
Properties:
Name Type Description dataojTreemap.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. valuenumber The value of the hovered node. -
NodeTemplateContext<K,D>
-
Properties:
Name Type Description componentElementElement The <oj-treemap> custom element dataD The data object of the node indexnumber The zero-based index of the current node keyK The key of the current node parentDataD[] An array of data objects of the outermost to innermost parents of the node parentKeyK The key of the parent node -
TooltipContext<K, D>
-
Properties:
Name Type Description colorstring The color of the hovered node. componentElementElement The treemap element. dataojTreemap.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. parentElementElement The tooltip element. The function can directly modify or append content to this element. valuenumber The value of the hovered node.