Element: <oj-treemap>

Oracle® JavaScript Extension Toolkit (JET)
17.0.0

F92240-01

Since:
  • 0.7.0
Module:
  • ojtreemap

QuickNav

Attributes


Context Objects

JET Treemap

Treemaps are used to display hierarchical data across two dimensions, represented by the size and color of the treemap nodes. Treemaps are generally preferred over sunbursts when emphasizing the data for the leaf nodes.


<oj-treemap
   data="[[treeDataProvider]]">
</oj-treemap>

Accessibility

The application is responsible for populating the shortDesc value in the component properties object with meaningful descriptors when the component does not provide a default descriptor. Since component terminology for keyboard and touch shortcuts can conflict with those of the application, it is the application's responsibility to provide these shortcuts, possibly via a help popup.

The application is also responsible for including contextual information for screen readers using one or more the following methods as appropriate: aria-label, aria-labelledby, aria-describedby.

Touch End User Information

Target Gesture Action
Node Tap Select when selectionMode is enabled.
Press & Hold Display tooltip.
Display context menu on release.

Gesture End User Information

Key Action
Tab Move focus to next element.
Shift + Tab Move focus to previous element.
UpArrow Move focus and selection up to the nearest tile or header in same level.
DownArrow Move focus and selection down to the nearest tile or header in same level.
LeftArrow Move focus and selection to the left to nearest tile or header in same level.
RightArrow Move focus and selection to the right to nearest tile or header in same level.
] or Alt + UpArrow Move focus and selection from tile or header to group header in level above.
[ or Alt + DownArrow Move focus and selection from tile or header to group header in level below.
Shift + UpArrow Move focus and extend selection up to the nearest tile or header in same level.
Shift + DownArrow Move focus and extend selection down to the nearest tile or header in same level.
Shift + LeftArrow Move focus and extend selection to the left to nearest tile or header in same level.
Shift + RightArrow Move focus and extend selection to the right to nearest tile or header in same level.
Shift + ] or Shift + Alt + UpArrow Move focus and extend selection from tile or header to group header in level above.
Shift + [ or Shift + Alt + DownArrow Move focus and extend selection from tile or header to group header in level below.
Ctrl + UpArrow Move focus up to the nearest tile or header in same level, without changing the current selection.
Ctrl + DownArrow Move focus down to the nearest tile or header in same level, without changing the current selection.
Ctrl + LeftArrow Move focus to the left to nearest tile or header in same level, without changing the current selection.
Ctrl + RightArrow Move focus to the right to nearest tile or header in same level, without changing the current selection.
Ctrl + ] or Ctrl + Alt + UpArrow Move focus from tile or header to group header in level above, without changing the current selection.
Ctrl + [ or Ctrl + Alt + DownArrow Move focus from tile or header to group header in level below, without changing the current selection.
Ctrl + Spacebar Multi-select tiles or headers with focus.
Ctrl + Enter Maximize/Restore on a group header.
Enter Drill on a node when drilling is enabled.

Performance

Animation

Animation should only be enabled for visualizations of small to medium data sets. Alternate visualizations should be considered if identifying data changes is important, since all nodes will generally move and resize on any data change.

Data Set Size

As a rule of thumb, it's recommended that applications only set usable data densities on this element. Applications can enable progressive reveal of data through drilling or aggregate small nodes to reduce the displayed data set size.

Styling

Use the highest level property available. For example, consider setting styling properties on nodeDefaults, instead of styling properties on the individual nodes. The treemap can take advantage of these higher level properties to apply the style properties on containers, saving expensive DOM calls.

Tracking Resize

By default, the element will track resizes and render at the new size. This functionality adds a small overhead to the initial render for simple elements like gauges or spark charts, which become noticable when using large numbers of these simple elements. To disable resize tracking, set trackResize to off. The application can manually request a re-render at any time by calling the refresh function.

Reading direction

As with any JET component, in the unusual case that the directionality (LTR or RTL) changes post-init, the component must be refresh()ed.


Usage

Signature:

interface TreemapElement<K, D extends ojTreemap.Node<K>|any>

Generic Parameters
ParameterDescription
KType of key of the dataprovider
DType 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-menu within 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 nodeContentTemplate slot 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
bounds object 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
height number The height of the node area.
width number The width of the node area.
x number The x coordinate relative to the top, left corner of the element.
y number The y coordinate relative to the top, left corner of the element.
componentElement Element The treemap element.
data ojTreemap.Node<K> The data object of the node.
id K The id of the node.
itemData D The row data object for the node. This will only be set if a DataProvider is being used.

nodeTemplate

The nodeTemplate slot 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
componentElement Element The <oj-treemap> custom element
data Object The data object of the node
index number The zero-based index of the current node
key any The key of the current node
parentData Array An array of data objects of the outermost to innermost parents of the node
parentKey any The key of the parent node

tooltipTemplate

The tooltipTemplate slot 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
color string The color of the hovered node.
componentElement Element The treemap element.
data ojTreemap.Node<K> The data object of the hovered node.
id K The id of the hovered node.
itemData D The row data object for the hovered node. This will only be set if a DataProvider is being used.
label string The label of the hovered node.
parentElement Element The tooltip element. The function can directly modify or append content to this element.
value number 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 animationDuration
Property change event animationDurationChanged
Property 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.
Supported Values:
Value
auto
none
Default Value:
  • "none"
Names
Item Name
Property animationOnDataChange
Property change event animationOnDataChangeChanged
Property 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.
Supported Values:
Value
auto
none
Default Value:
  • "none"
Names
Item Name
Property animationOnDisplay
Property change event animationOnDisplayChanged
Property 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 animationUpdateColor
Property change event animationUpdateColorChanged
Property 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.0 Set the alias directly on the template element using the data-oj-as attribute instead.
Default Value:
  • ""
Names
Item Name
Property as
Property change event asChanged
Property 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 colorLabel
Property change event colorLabelChanged
Property 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 data
Property change event dataChanged
Property 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 displayLevels
Property change event displayLevelsChanged
Property 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 ojBeforeDrill and ojDrill event 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.
Supported Values:
Value
off
on
Default Value:
  • "off"
Names
Item Name
Property drilling
Property change event drillingChanged
Property 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.
Supported Values:
Value
all
none
outer
Default Value:
  • "outer"
Names
Item Name
Property groupGaps
Property change event groupGapsChanged
Property 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 hiddenCategories
Property change event hiddenCategoriesChanged
Property 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.
Supported Values:
Value
all
any
Default Value:
  • "all"
Names
Item Name
Property highlightMatch
Property change event highlightMatchChanged
Property 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
Supported Values:
Value
categories
descendants
Default Value:
  • "categories"
Names
Item Name
Property highlightMode
Property change event highlightModeChanged
Property 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 highlightedCategories
Property change event highlightedCategoriesChanged
Property 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.
Supported Values:
Value
dim
none
Default Value:
  • "none"
Names
Item Name
Property hoverBehavior
Property change event hoverBehaviorChanged
Property 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 hoverBehaviorDelay
Property change event hoverBehaviorDelayChanged
Property 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 isolatedNode
Property change event isolatedNodeChanged
Property 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.
Supported Values:
Value
sliceAndDiceHorizontal
sliceAndDiceVertical
squarified
Default Value:
  • "squarified"
Names
Item Name
Property layout
Property change event layoutChanged
Property 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 nodeContent
Property change event nodeContentChanged
Property 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 nodeDefaults
Property change event nodeDefaultsChanged
Property 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.
Supported Values:
Value
header
node
off
Default Value:
  • "header"
Names
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.
Supported Values:
Value
off
on
Default Value:
  • "on"
Names
Item Name
Property nodeDefaults.header.isolate

node-defaults.header.label-halign :"center"|"end"|"start"

The horizontal alignment of the header title.
Supported Values:
Value
center
end
start
Default Value:
  • "start"
Names
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.
Supported Values:
Value
off
on
Default Value:
  • "off"
Names
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.
Supported Values:
Value
node
off
Default Value:
  • "node"
Names
Item Name
Property nodeDefaults.labelDisplay

node-defaults.label-halign :"start"|"end"|"center"

The horizontal alignment for labels displayed within the node.
Supported Values:
Value
center
end
start
Default Value:
  • "center"
Names
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.
Supported Values:
Value
bottom
center
top
Default Value:
  • "center"
Names
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.
Supported Values:
Value
bevels
gaps
Default Value:
  • "gaps"
Names
Item Name
Property nodeSeparators
Property change event nodeSeparatorsChanged
Property 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 nodes
Property change event nodesChanged
Property 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 rootNode
Property change event rootNodeChanged
Property 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 selection
Property change event selectionChanged
Property 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 single or multiple is specified, selection gestures will be enabled, and the treemap's selection styling will be applied to all items specified by the selection attribute. If none is 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.

Supported Values:
Value Description
multiple Multiple items can be selected at the same time.
none Selection is disabled.
single Only a single item can be selected at a time.
Default Value:
  • "multiple"
Names
Item Name
Property selectionMode
Property change event selectionModeChanged
Property 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 sizeLabel
Property change event sizeLabelChanged
Property 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.
Supported Values:
Value
off
on
Default Value:
  • "off"
Names
Item Name
Property sorting
Property change event sortingChanged
Property 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 tooltip
Property change event tooltipChanged
Property 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.
Supported Values:
Value
auto
touchStart
Default Value:
  • "auto"
Names
Item Name
Property touchResponse
Property change event touchResponseChanged
Property 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 calling refresh to render the element at the new size.
Supported Values:
Value
off
on
Default Value:
  • "on"
Names
Item Name
Property trackResize
Property change event trackResizeChanged
Property 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 null if 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 translations
Property change event translationsChanged
Property 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
indexPath Array 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
data ojTreemap.Node<K> the data object of the drilled node.
id K the id of the drilled object
itemData D 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
data ojTreemap.Node<K> the data object of the drilled node.
id K the id of the drilled object
itemData D 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
node Element <not nullable>
The child DOM node
Returns:

The context for the DOM node, or null when 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
subIdPath Array The array of indices in the subId for the desired node
Deprecated:
Since Description
7.0.0 The 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
property string 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
properties Object 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
property string The property name to set. Supports dot notation for subproperty access.
value any 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
color string The fill color of the node.
label string The label for this node.
selected boolean True is the node is selected, false otherwise
size number The relative size of the node.
tooltip string The tooltip string.

Node<K,D=any>

Properties:
Name Type Argument Default Description
categories Array.<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.
color string <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.
groupLabelDisplay string <optional>
The label display behavior for group nodes.
header Object <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.
labelStyle Partial<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.
id K <optional>
The id of the node. For the DataProvider case, the key for the node will be used as the id.
label string <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.
labelStyle Partial<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.
nodes Array.<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.
svgClassName string <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.
svgStyle Partial<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.
value number The value of the node, which determines the relative size of the node.

NodeContentContext<K, D>

Properties:
Name Type Description
bounds object 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
height number The height of the node area.
width number The width of the node area.
x number The x coordinate relative to the top, left corner of the element.
y number The y coordinate relative to the top, left corner of the element.
componentElement Element The treemap element.
data ojTreemap.Node<K> The data object of the node.
id K The id of the node.
itemData D The row data object for the node. This will only be set if a DataProvider is being used.

NodeContext

Properties:
Name Type Description
indexPath Array.<number> The array of numerical indices for the node.
subId string The subId string to identify the particular DOM node.

NodeShortDescContext<K,D>

Properties:
Name Type Description
data ojTreemap.Node<K> The data object of the hovered node.
id K The id of the hovered node.
itemData D The row data object for the hovered node. This will only be set if a DataProvider is being used.
label string The label of the hovered node.
value number The value of the hovered node.

NodeTemplateContext

Properties:
Name Type Description
componentElement Element The <oj-treemap> custom element
data Object The data object of the node
index number The zero-based index of the current node
key any The key of the current node
parentData Array An array of data objects of the outermost to innermost parents of the node
parentKey any The key of the parent node

TooltipContext<K, D>

Properties:
Name Type Description
color string The color of the hovered node.
componentElement Element The treemap element.
data ojTreemap.Node<K> The data object of the hovered node.
id K The id of the hovered node.
itemData D The row data object for the hovered node. This will only be set if a DataProvider is being used.
label string The label of the hovered node.
parentElement Element The tooltip element. The function can directly modify or append content to this element.
value number The value of the hovered node.