Element: <oj-sunburst>

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 0.7.0
Module:
  • ojsunburst

QuickNav

Attributes


Context Objects

JET Sunburst

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


<oj-sunburst
   data='[[treeDataProvider]]'>
</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.

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


Usage

Signature:

interface SunburstElement<K, D extends ojSunburst.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 { SunburstElement } from "ojs/ojsunburst";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojsunburst";

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.

nodeTemplate

The nodeTemplate slot is used to specify the template for creating nodes of the sunburst. The slot content must be wrapped in a single <template> element. The content of the template should be a single <oj-sunburst-node> element. See the oj-sunburst-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.ojSunburst.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-sunburst> 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

rootNodeContentTemplate

The rootNodeContentTemplate slot is used to specify custom root node content for a sunburst. The slot content must be a single <template> element. This slot takes precedence over the rootNodeContent.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 root node. (See oj.ojSunburst.RootNodeContext or the table below for a list of properties available on $current)
Properties of $current:
Name Type Description
componentElement Element The sunburst element.
data ojSunburst.Node<K> The data object of the root node.
id K The id of the root node.
innerBounds object Object containing information on the rectangle inscribed in the root 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 rectangle inscribed in the root node area.
width number The width of the rectangle inscribed in the root 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.
itemData D The row data object for the root node. This will only be set if a DataProvider is being used.
outerBounds object Object containing information on the rectangle circumscribing the root 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 rectangle circumscribing the root node area.
width number The width of the rectangle circumscribing the root 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.

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.ojSunburst.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 sunburst element.
data ojSunburst.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.
radius number The radius of the hovered node.
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 sunburst. 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 sunburst. It should provide a data tree where each node in the data tree corresponds to a node in the sunburst. The row key will be used as the id for sunburst 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 itemTemplate slot or it can have oj.ojSunburst.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

expanded :oj.KeySet<K>

Specifies the key set containing the ids of sunburst nodes that should be expanded on initial render. Use the KeySetImpl class to specify nodes to expand. Use the AllKeySetImpl class to expand all nodes. By default, all sunburst nodes are expanded.
Default Value:
  • new AllKeySetImpl()
Supports writeback:
  • true
Names
Item Name
Property expanded
Property change event expandedChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) 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:
  • []
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

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 sunburst 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.border-color :string

The default border color of the nodes.
Names
Item Name
Property nodeDefaults.borderColor

node-defaults.border-width :number

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

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 :"horizontal"|"rotated"|"off"|"auto"

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:
Value
auto
horizontal
off
rotated
Default Value:
  • "auto"
Names
Item Name
Property nodeDefaults.labelDisplay

node-defaults.label-halign :"inner"|"outer"|"center"

The horizontal alignment for labels displayed within the node. Only applies to rotated text.
Supported Values:
Value
center
inner
outer
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 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.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-defaults.show-disclosure :"on"|"off"

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:
Value
off
on
Default Value:
  • "off"
Names
Item Name
Property nodeDefaults.showDisclosure

nodes :(Array.<oj.ojSunburst.Node.<K>>|Promise.<Array.<oj.ojSunburst.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.ojSunburst.Node.<K>>|Promise.<Array.<oj.ojSunburst.Node.<K>>>|null)
Getter Type(Promise.<Array.<oj.ojSunburst.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

root-node-content :Object

An object defining custom root node content for the sunburst.
Names
Item Name
Property rootNodeContent
Property change event rootNodeContentChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-root-node-content-changed

root-node-content.renderer :((context: ojSunburst.RootNodeContext<K, D>) => ({insert: Element|string}))

A function that returns custom root node content. The function takes a RootNodeContext argument, provided by the sunburst. 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 :"off"|"on"

Specifies whether client side rotation is enabled.
Supported Values:
Value
off
on
Default Value:
  • "on"
Names
Item Name
Property rotation
Property change event rotationChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-rotation-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 sunburst. 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 sunburst'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 sunburst'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 sunburst. 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

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, see Events and Listeners for additional information.) on-start-angle-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: ojSunburst.TooltipContext<K, D>) => ({insert: Element|string}|{preventDefault: boolean}))

A function that returns a custom tooltip. The function takes a TooltipContext argument, provided by the sunburst. 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:
  • "Sunburst"
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-collapse :string

Used for the collapse tooltip.

See the translations attribute for usage examples.

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

(nullable) 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 event's preventDefault() is called.
Deprecated:
Since Description
12.1.0 The oj-before-collapse event has been deprecated. Lazy loading of data can be done through the data provider.
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 ojSunburst.Node<K> the data object of the node to collapse
id K the id of the node to collapse
itemData D The row data object for the node to collapse. This will only be set if a DataProvider is being used.

ojBeforeDrill

Triggered immediately before any node in the sunburst is drilled into. The drill event can be vetoed if the beforeDrill event's preventDefault() is called.
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 ojSunburst.Node<K> the data object of the drilled node
id K the id of the drilled node
itemData D The row data object for the drilled node. This will only be set if a DataProvider is being used.

ojBeforeExpand

Triggered immediately before any node in the sunburst is expanded. The expand event can be vetoed if the beforeExpand event's preventDefault() is called.
Deprecated:
Since Description
12.1.0 The oj-before-expand event has been deprecated. Lazy loading of data can be done through the data provider.
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 ojSunburst.Node<K> the data object of the node to expand
id K the id of the node to expand
itemData D The row data object for the node to expand. This will only be set if a DataProvider is being used.

ojCollapse

Triggered when a node has been collapsed.
Deprecated:
Since Description
12.1.0 The oj-collapse event has been deprecated. Use on-expanded-changed instead.
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 ojSunburst.Node<K> the data object of the collapsed node
id K the id of the collapsed node
itemData D The row data object for the collapsed 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 ojSunburst.Node<K> the data object of the drilled node
id K the id of the drilled node
itemData D The row data object for the drilled node. This will only be set if a DataProvider is being used.

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.
Deprecated:
Since Description
12.1.0 The oj-expand event has been deprecated. Use on-expanded-changed instead.
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 ojSunburst.Node<K> the data object of the expanded node
id K the id of the expanded node
itemData D The row data object for the expanded node. This will only be set if a DataProvider is being used.

ojRotateInput

Triggered during user rotation of the sunburst.
Properties:

All of the event payloads listed below can be found under event.detail. See Events and Listeners for additional information.

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

Methods

getContextByNode(node) : {(oj.ojSunburst.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.ojSunburst.NodeContext|null)

getNode(subIdPath) : {(oj.ojSunburst.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.ojSunburst.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
borderColor string <optional>
The border color of the node.
borderWidth number <optional>
The border width of the node.
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.
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 "auto" | "horizontal" | "off" | "rotated" <optional>
"auto" 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.
labelHalign "center" | "inner" | "outer" <optional>
"center" The horizontal alignment for labels displayed within the node. Only applies to rotated text.
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. The default value comes from the CSS and varies based on theme. The default value comes from the CSS and varies based on theme.
nodes Array.<ojSunburst.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.
radius number <optional>
The radius of the node relative to the other nodes.
selectable "auto" | "off" <optional>
"auto" Specifies whether or not the node will be selectable.
shortDesc ?(string | ((context: ojSunburst.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.
showDisclosure "inherit" | "off" | "on" <optional>
"inherit" 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.
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. The default value comes from the CSS and varies based on theme.
value number The value of the node, which determines the relative size of the node.

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

RootNodeContext<K, D>

Properties:
Name Type Description
componentElement Element The sunburst element.
data ojSunburst.Node<K> The data object of the root node.
id K The id of the root node.
innerBounds object Object containing information on the rectangle inscribed in the root 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 rectangle inscribed in the root node area.
width number The width of the rectangle inscribed in the root 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.
itemData D The row data object for the root node. This will only be set if a DataProvider is being used.
outerBounds object Object containing information on the rectangle circumscribing the root 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 rectangle circumscribing the root node area.
width number The width of the rectangle circumscribing the root 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.

TooltipContext<K, D>

Properties:
Name Type Description
color string The color of the hovered node.
componentElement Element The sunburst element.
data ojSunburst.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.
radius number The radius of the hovered node.
value number The value of the hovered node.