Element: <oj-sunburst>

Oracle® JavaScript Extension Toolkit (JET)
4.2.0

E91398-01

QuickNav

Attributes


Context Objects

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 4.2.0
Since:
  • 0.7

JET Custom Elements

JET components are implemented as custom HTML elements. A detailed description of working with these elements can be found in: JET Custom Element Usage.

JET Sunburst

Sunbursts are used to display hierarchical data across two dimensions, represented by the size and color of the sunburst nodes.


<oj-sunburst
   nodes='[{"value": 100, "color": "#FFFF00", "label": "Total Sales",
            "nodes": [{"value": 75, "color": "#00FF00", "label": "Candy"},
                      {"value": 20, "color": "#FFFF00", "label": "Fruit"},
                      {"value": 15, "color": "#FF0000", "label": "Vegetables"}]}]'>
</oj-sunburst>

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.

Touch End User Information

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

Keyboard End User Information

Key Action
Tab Move focus to next element.
Shift + Tab Move focus to previous element.
UpArrow Move focus and selection to the first adjacent sector in an inner or outer layer (ring). In the northern hemisphere of the sunburst, this will move away from the center, while it will move towards the center in the southern hemisphere of the sunburst.
DownArrow Move focus and selection to the first adjacent sector in an inner or outer layer (ring). In the northern hemisphere of the sunburst, this will move towards the center, while it will move away from the center in the southern hemisphere of the sunburst.
LeftArrow Move focus and selection counterclockwise to adjacent sector in the same layer (ring).
RightArrow Move focus and selection clockwise to adjacent sector in the same layer (ring).
Shift + UpArrow Move focus and extend selection to the first adjacent sector in an inner or outer layer (ring). In the northern hemisphere of the sunburst, this will move away from the center, while it will move towards the center in the southern hemisphere of the sunburst.
Shift + DownArrow Move focus and extend selection to the first adjacent sector in an inner or outer layer (ring). In the northern hemisphere of the sunburst, this will move towards the center, while it will move away from the center in the southern hemisphere of the sunburst.
Shift + LeftArrow Move focus and extend selection counterclockwise to adjacent sector in the same layer (ring).
Shift + RightArrow Move focus and extend selection clockwise to adjacent sector in the same layer (ring).
Ctrl + UpArrow Move focus to the first adjacent sector in an inner or outer layer (ring), without changing the current selection. In the northern hemisphere of the sunburst, this will move away from the center, while it will move towards the center in the southern hemisphere of the sunburst.
Ctrl + DownArrow Move focus to the first adjacent sector in an inner or outer layer (ring), without changing the current selection. In the northern hemisphere of the sunburst, this will move towards the center, while it will move away from the center in the southern hemisphere of the sunburst.
Ctrl + LeftArrow Move focus counterclockwise to adjacent sector in the same layer (ring), without changing the current selection.
Ctrl + RightArrow Move focus clockwise to adjacent sector in the same layer (ring), without changing the current selection.
Ctrl + Spacebar Multi-select sectors with focus.
Shift + Alt + LeftArrow Rotate 5 degrees counterclockwise.
Shift + Alt + RightArrow Rotate 5 degrees clockwise.
Enter Drill on a node when drilling is enabled.
+ Expand a node when showDisclosure is enabled and the node is expandable.
- Collapse a node when showDisclosure is enabled and the node is collapsable.

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 sunburst 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.

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 elements can have up to two types of child content:

  • Any child element with a slot attribute will be moved into that named slot, e.g. <span slot='startIcon'>...</span>. All supported named slots are documented below. Child elements with unsupported named slots will be removed from the DOM.
  • Any child element lacking a slot attribute will be moved to the default slot, also known as a regular child.

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 and demos 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.

Example

Initialize the component with a context menu:

<oj-some-element>
    <-- use the contextMenu slot to designate this as the context menu for this component -->
    <oj-menu slot="contextMenu" style="display:none" aria-label="Some element's context menu">
...
    </oj-menu>
</oj-some-element>

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.
Default Value:
  • null
Names
Item Name
Property animationDuration
Property change event animationDurationChanged
Property change listener attribute (must be of type function) on-animation-duration-changed

animation-on-data-change :string

Specifies the animation that is applied on data changes.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDataChange
Property change event animationOnDataChangeChanged
Property change listener attribute (must be of type function) on-animation-on-data-change-changed

animation-on-display :string

Specifies the animation that is shown on initial display.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDisplay
Property change event animationOnDisplayChanged
Property change listener attribute (must be of type function) 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:
  • null
Names
Item Name
Property animationUpdateColor
Property change event animationUpdateColorChanged
Property change listener attribute (must be of type function) on-animation-update-color-changed

color-label :string

Specifies the label describing the color metric of the sunburst. This label will be used in the legend.
Default Value:
  • null
Names
Item Name
Property colorLabel
Property change event colorLabelChanged
Property change listener attribute (must be of type function) on-color-label-changed

display-levels :number

The number of levels of nodes to display. By default all nodes are displayed.
Default Value:
  • null
Names
Item Name
Property displayLevels
Property change event displayLevelsChanged
Property change listener attribute (must be of type function) on-display-levels-changed

drilling :string

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:
Name Type
"off" string
"on" string
Default Value:
  • "off"
Names
Item Name
Property drilling
Property change event drillingChanged
Property change listener attribute (must be of type function) on-drilling-changed

expanded :KeySet

Specifies the key set containing the ids of sunburst nodes that should be expanded on initial render. By default, all sunburst nodes are expanded.
Default Value:
  • new keySet.ExpandAllKeySet()
Names
Item Name
Property expanded
Property change event expandedChanged
Property change listener attribute (must be of type function) on-expanded-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:
  • null
Supports writeback:
  • true
Names
Item Name
Property hiddenCategories
Property change event hiddenCategoriesChanged
Property change listener attribute (must be of type function) on-hidden-categories-changed

highlight-match :string

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:
Name Type
"all" string
"any" string
Default Value:
  • "all"
Names
Item Name
Property highlightMatch
Property change event highlightMatchChanged
Property change listener attribute (must be of type function) on-highlight-match-changed

highlighted-categories :Array.<string>

An array of category strings used for highlighting. Nodes matching all categories in this array will be highlighted.
Default Value:
  • null
Supports writeback:
  • true
Names
Item Name
Property highlightedCategories
Property change event highlightedCategoriesChanged
Property change listener attribute (must be of type function) on-highlighted-categories-changed

hover-behavior :string

Defines the behavior applied when hovering over the nodes.
Supported Values:
Name Type
"dim" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property hoverBehavior
Property change event hoverBehaviorChanged
Property change listener attribute (must be of type function) on-hover-behavior-changed

hover-behavior-delay :number

Specifies initial hover delay in ms for highlighting nodes.
Default Value:
  • null
Names
Item Name
Property hoverBehaviorDelay
Property change event hoverBehaviorDelayChanged
Property change listener attribute (must be of type function) on-hover-behavior-delay-changed

node-defaults :object

An object defining default properties for the nodes.
Default Value:
  • null
Names
Item Name
Property nodeDefaults
Property change event nodeDefaultsChanged
Property change listener attribute (must be of type function) on-node-defaults-changed

node-defaults.border-color :string

The default border color of the nodes.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.borderColor

node-defaults.border-width :number

The default border width of the nodes.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.borderWidth

node-defaults.hover-color :string

The color of the node hover feedback.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.hoverColor

node-defaults.label-display :string

The label display behavior for the nodes. More labels are generally displayed when using rotation, with the trade off of readability. When auto is used, rotated or horizontal labels will be used based on the client browser and platform.
Supported Values:
Name Type
"auto" string
"horizontal" string
"off" string
"rotated" string
Default Value:
  • "auto"
Names
Item Name
Property nodeDefaults.labelDisplay

node-defaults.label-halign :string

The horizontal alignment for labels displayed within the node. Only applies to rotated text.
Supported Values:
Name Type
"center" string
"inner" string
"outer" string
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 :object

The CSS style object defining the style of the label.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.labelStyle

node-defaults.selected-inner-color :string

The inner color of the node selection feedback.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.selectedInnerColor

node-defaults.selected-outer-color :string

The outer color of the node selection feedback.
Default Value:
  • null
Names
Item Name
Property nodeDefaults.selectedOuterColor

node-defaults.show-disclosure :string

Specifies whether to display the expand/collapse button on hover. If the button is clicked, the expanded attribute is updated with the new array of node ids.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "off"
Names
Item Name
Property nodeDefaults.showDisclosure

nodes :Array.<object>|Promise

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.
Default Value:
  • null
Names
Item Name
Property nodes
Property change event nodesChanged
Property change listener attribute (must be of type function) on-nodes-changed

nodes[].borderColor :string

The border color of the node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].borderWidth :number

The border width of the node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].categories :Array.<string>

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.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].color :string

The fill color of the node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].drilling :string

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.
Supported Values:
Name Type
"inherit" string
"off" string
"on" string
Default Value:
  • "inherit"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].id :string

The id of the node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].label :string

The label for this node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].labelDisplay :string

The label display behavior for the nodes. More labels are generally displayed when using rotation, with the trade off of readability. When auto is used, rotated or horizontal labels will be used based on the client browser and platform.
Supported Values:
Name Type
"auto" string
"horizontal" string
"off" string
"rotated" string
Default Value:
  • "auto"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].labelHalign :string

The horizontal alignment for labels displayed within the node. Only applies to rotated text.
Supported Values:
Name Type
"center" string
"inner" string
"outer" string
Default Value:
  • "center"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].labelStyle :object

The CSS style object defining the style of the label.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].nodes :Array.<object>

An array of objects with properties for the child nodes.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].pattern :string

The pattern used to fill the node.
Supported Values:
Name Type
"largeChecker" string
"largeCrosshatch" string
"largeDiagonalLeft" string
"largeDiagonalRight" string
"largeDiamond" string
"largeTriangle" string
"none" string
"smallChecker" string
"smallCrosshatch" string
"smallDiagonalLeft" string
"smallDiagonalRight" string
"smallDiamond" string
"smallTriangle" string
Default Value:
  • "none"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].radius :number

The radius of the node relative to the other nodes.
Default Value:
  • 1
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].selectable :string

Specifies whether or not the node will be selectable.
Supported Values:
Name Type
"auto" string
"off" string
Default Value:
  • "auto"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].shortDesc :string

The description of this node. This is used for accessibility and also for customizing the tooltip text.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].showDisclosure :string

Specifies whether to display the expand/collapse button on hover for a specific node. If the button is clicked, the expanded attribute is updated with the new array of node ids.
Supported Values:
Name Type
"inherit" string
"off" string
"on" string
Default Value:
  • "inherit"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].svgClassName :string

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.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].svgStyle :object

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.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

nodes[].value :number

The relative size of the node.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

root-node :string

The id of the root node. When specified, only the root node and children of the root will be displayed.
Default Value:
  • null
Names
Item Name
Property rootNode
Property change event rootNodeChanged
Property change listener attribute (must be of type function) on-root-node-changed

root-node-content :object

An object defining custom root node content for the sunburst.
Default Value:
  • null
Names
Item Name
Property rootNodeContent
Property change event rootNodeContentChanged
Property change listener attribute (must be of type function) on-root-node-content-changed

root-node-content.renderer :function(object)

A function that returns custom root node content. The function takes a dataContext argument, provided by the sunburst, with the following properties:
  • outerBounds: Object containing (x, y, width, height) of the rectangle circumscribing the root node area. The x and y coordinates are relative to the top, left corner of the element.
  • innerBounds: Object containing (x, y, width, height) of the rectangle inscribed in the root node area. The x and y coordinates are relative to the top, left corner of the element.
  • id: The id of the root node.
  • data: The data object of the root node.
  • componentElement: The sunburst element.
The function should return an Object with the following property:
  • insert: HTMLElement - HTML element, which will be overlaid on top of the sunburst. This HTML element will block interactivity of the sunburst by default, but the CSS pointer-events property can be set to 'none' on this element if the sunburst's interactivity is desired.
Default Value:
  • null
Names
Item Name
Property rootNodeContent.renderer

rotation :string

Specifies whether client side rotation is enabled.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property rotation
Property change event rotationChanged
Property change listener attribute (must be of type function) on-rotation-changed

selection :Array.<string>

An array containing the ids of the initially selected nodes.
Default Value:
  • null
Supports writeback:
  • true
Names
Item Name
Property selection
Property change event selectionChanged
Property change listener attribute (must be of type function) on-selection-changed

selection-mode :string

Specifies the selection mode.
Supported Values:
Name Type
"multiple" string
"none" string
"single" string
Default Value:
  • "multiple"
Names
Item Name
Property selectionMode
Property change event selectionModeChanged
Property change listener attribute (must be of type function) on-selection-mode-changed

size-label :string

Specifies the label describing the size metric of the sunburst. This label will be used in the legend.
Default Value:
  • null
Names
Item Name
Property sizeLabel
Property change event sizeLabelChanged
Property change listener attribute (must be of type function) on-size-label-changed

sorting :string

Specifies whether 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:
Name Type
"off" string
"on" string
Default Value:
  • "off"
Names
Item Name
Property sorting
Property change event sortingChanged
Property change listener attribute (must be of type function) on-sorting-changed

start-angle :number

Specifies the starting angle of the sunburst. Valid values are numbers between 0 and 360.
Default Value:
  • 90
Supports writeback:
  • true
Names
Item Name
Property startAngle
Property change event startAngleChanged
Property change listener attribute (must be of type function) on-start-angle-changed

tooltip :object

An object containing an optional callback function for tooltip customization.
Default Value:
  • null
Names
Item Name
Property tooltip
Property change event tooltipChanged
Property change listener attribute (must be of type function) on-tooltip-changed

tooltip.renderer :function(object)

A function that returns a custom tooltip. The function takes a dataContext argument, provided by the sunburst, with the following properties:
  • parentElement: The tooltip element. The function can directly modify or append content to this element.
  • id: The id of the hovered node.
  • label: The label of the hovered node.
  • value: The value of the hovered node.
  • radius: The radius of the hovered node.
  • color: The color of the hovered node.
  • data: The data object of the hovered node.
  • componentElement: The sunburst element.
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 :string

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:
Name Type
"auto" string
"touchStart" string
Default Value:
  • "auto"
Names
Item Name
Property touchResponse
Property change event touchResponseChanged
Property change listener attribute (must be of type function) on-touch-response-changed

track-resize :string

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:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property trackResize
Property change event trackResizeChanged
Property change listener attribute (must be of type function) on-track-resize-changed
Examples

Initialize the data visualization element with the track-resize attribute specified:

<oj-some-dvt track-resize='off'></oj-some-dvt>

Get or set the trackResize property after initialization:

// getter
var value = myComponent.trackResize;

// setter
myComponent.trackResize="off";

translations :Object

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 this component has translations, their documentation immediately follows this doc entry.

Default Value:
  • an object containing all resources relevant to the component, or null if none
Names
Item Name
Property translations
Property change event translationsChanged
Property change listener attribute (must be of type function) on-translations-changed
Examples

Initialize the component, overriding some translated resources and leaving the others intact:

<!-- Using dot notation -->
<oj-some-element translations.some-key='some value' translations.some-other-key='some other value'></oj-some-element>

<!-- Using JSON notation -->
<oj-some-element translations='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-some-element>

Get or set the translations property after initialization:

// Get one
var value = myComponent.translations.someKey;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myComponent.setProperty('translations.someKey', 'some value');

// Get all
var values = myComponent.translations;

// Set all.  Must list every resource key, as those not listed are lost.
myComponent.translations = {
    someKey: 'some value',
    someOtherKey: 'some other value'
};

translations.component-name :string

Used to describe the data visualization type for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Sunburst"
Names
Item Name
Property translations.componentName

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

translations.tooltip-collapse :string

Used for the collapse tooltip.

See the translations attribute for usage examples.

Default Value:
  • "Collapse"
Names
Item Name
Property translations.tooltipCollapse

translations.tooltip-expand :string

Used for the expand tooltip.

See the translations attribute for usage examples.

Default Value:
  • "Expand"
Names
Item Name
Property translations.tooltipExpand

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-sunburst-node

Context for sunburst nodes indexed by their position in the hierarchy.

Properties:
Name Type Description
indexPath Array The array of numerical indices for the node.

Events

ojBeforeCollapse

Triggered immediately before any container node in the sunburst is collapsed. The collapse event can be vetoed if the beforeCollapse callback returns false.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
id string the id of the node to collapse
data Object the data object of the node to collapse
Examples

Specify an ojBeforeCollapse listener via the DOM attribute:

<oj-sunburst on-oj-before-collapse='[[listener]]'></oj-sunburst>

Specify an ojBeforeCollapse listener via the JavaScript property:

mySunburst.onOjBeforeCollapse = listener;

Add an ojBeforeCollapse listener via the addEventListener API:

mySunburst.addEventListener('ojBeforeCollapse', listener);

ojBeforeDrill

Triggered immediately before any node in the sunburst 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.

Name Type Description
id string the id of the drilled node
data Object the data object of the drilled node
Examples

Specify an ojBeforeDrill listener via the DOM attribute:

<oj-sunburst on-oj-before-drill='[[listener]]'></oj-sunburst>

Specify an ojBeforeDrill listener via the JavaScript property:

mySunburst.onOjBeforeDrill = listener;

Add an ojBeforeDrill listener via the addEventListener API:

mySunburst.addEventListener('ojBeforeDrill', listener);

ojBeforeExpand

Triggered immediately before any node in the sunburst is expanded. The expand event can be vetoed if the beforeExpand callback returns false.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
id string the id of the node to expand
data Object the data object of the node to expand
Examples

Specify an ojBeforeExpand listener via the DOM attribute:

<oj-sunburst on-oj-before-expand='[[listener]]'></oj-sunburst>

Specify an ojBeforeExpand listener via the JavaScript property:

mySunburst.onOjBeforeExpand = listener;

Add an ojBeforeExpand listener via the addEventListener API:

mySunburst.addEventListener('ojBeforeExpand', listener);

ojCollapse

Triggered when a node has been collapsed.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
id string the id of the collapsed node
data Object the data object of the collapsed node
Examples

Specify an ojCollapse listener via the DOM attribute:

<oj-sunburst on-oj-collapse='[[listener]]'></oj-sunburst>

Specify an ojCollapse listener via the JavaScript property:

mySunburst.onOjCollapse = listener;

Add an ojCollapse listener via the addEventListener API:

mySunburst.addEventListener('ojCollapse', listener);

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.

Name Type Description
id string the id of the drilled node
data Object the data object of the drilled node
Examples

Specify an ojDrill listener via the DOM attribute:

<oj-sunburst on-oj-drill='[[listener]]'></oj-sunburst>

Specify an ojDrill listener via the JavaScript property:

mySunburst.onOjDrill = listener;

Add an ojDrill listener via the addEventListener API:

mySunburst.addEventListener('ojDrill', listener);

ojExpand

Triggered when a node has been expanded. The ui object contains one property, "nodeId", which is the id of the node that has been expanded.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
id string the id of the expanded node
data Object the data object of the expanded node
Examples

Specify an ojExpand listener via the DOM attribute:

<oj-sunburst on-oj-expand='[[listener]]'></oj-sunburst>

Specify an ojExpand listener via the JavaScript property:

mySunburst.onOjExpand = listener;

Add an ojExpand listener via the addEventListener API:

mySunburst.addEventListener('ojExpand', listener);

ojRotateInput

Triggered during user rotation of the sunburst.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
value number the start angle of the sunburst, in degrees
Examples

Specify an ojRotateInput listener via the DOM attribute:

<oj-sunburst on-oj-rotate-input='[[listener]]'></oj-sunburst>

Specify an ojRotateInput listener via the JavaScript property:

mySunburst.onOjRotateInput = listener;

Add an ojRotateInput listener via the addEventListener API:

mySunburst.addEventListener('ojRotateInput', listener);

Methods

getContextByNode(node) → {Object|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 Description
node Element The child DOM node
Returns:
The context for the DOM node, or null when none is found.
Type
Object | null
Example
 // Returns {'subId': 'oj-some-sub-id', 'componentSpecificProperty': someValue, ...}
var context = myComponent.getContextByNode(nodeInsideElement);

getNode(subIdPath) → {Object|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
Properties:
Name Type
color string
label string
selected boolean
size number
tooltip string
Returns:
An object containing properties for the node, or null if none exists.
Type
Object | null

getProperty(property) → {*}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Returns:
Type
*
Example

Get a single subproperty of a complex property:

var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');

refresh()

Refreshes the component.

setProperties(properties)

Performs a batch set of properties.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Example

Set a batch of properties:

myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"});

setProperty(property, value)

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value * The new value to set the property to.
Example

Set a single subproperty of a complex property:

myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");