Usage
Signature:
interface SunburstElement<K, D extends ojSunburst.Node<K>|any>
Generic Parameters
Parameter Description K Type of key of the dataprovider D Type of data from the dataprovider
Typescript Import Format
//To typecheck the element APIs, import as below.
import { 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-menuwithin this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.
To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc of the individual components for details.
Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.
-
nodeTemplate
-
The
nodeTemplateslot 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 'as' attribute was specified, the value will be used to provide an application-named alias for $current.
Properties of $current:
Name Type Description componentElementElement The <oj-sunburst> custom element dataObject The data object of the node indexnumber The zero-based index of the current node keyany The key of the current node parentDataArray An array of data objects of the outermost to innermost parents of the node parentKeyany The key of the parent node -
rootNodeContentTemplate
-
The
rootNodeContentTemplateslot 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 componentElementElement The sunburst element. dataojSunburst.Node<K> The data object of the root node. idK The id of the root node. innerBoundsobject 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 heightnumber The height of the rectangle inscribed in the root node area. widthnumber The width of the rectangle inscribed in the root node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. itemDataD The row data object for the root node. This will only be set if a DataProvider is being used. outerBoundsobject 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 heightnumber The height of the rectangle circumscribing the root node area. widthnumber The width of the rectangle circumscribing the root node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. -
tooltipTemplate
-
The
tooltipTemplateslot is used to specify custom tooltip content. The slot content must be a single <template> element. This slot takes precedence over the tooltip.renderer property if specified.When the template is executed, the component's binding context is extended with the following properties:
- $current - an object that contains information for the current node. (See oj.ojSunburst.TooltipContext or the table below for a list of properties available on $current)
Properties of $current:
Name Type Description colorstring The color of the hovered node. componentElementElement The sunburst element. dataojSunburst.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. parentElementElement The tooltip element. The function can directly modify or append content to this element. radiusnumber The radius of the hovered node. valuenumber The value of the hovered node.
Attributes
-
animation-duration :number
-
Specifies the animation duration in milliseconds. For data change animations with multiple stages, this attribute defines the duration of each stage. For example, if an animation contains two stages, the total duration will be two times this attribute's value. The default value comes from the CSS and varies based on theme.
Names
Item Name Property animationDurationProperty change event animationDurationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-duration-changed -
animation-on-data-change :"auto"|"none"
-
Specifies the animation that is applied on data changes.
- Default Value:
"none"
Supported Values:
Value autononeNames
Item Name Property animationOnDataChangeProperty change event animationOnDataChangeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-on-data-change-changed -
animation-on-display :"auto"|"none"
-
Specifies the animation that is shown on initial display.
- Default Value:
"none"
Supported Values:
Value autononeNames
Item Name Property animationOnDisplayProperty change event animationOnDisplayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-on-display-changed -
animation-update-color :string
-
The color that is displayed during a data change animation when a node is updated.
- Default Value:
""
Names
Item Name Property animationUpdateColorProperty change event animationUpdateColorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-animation-update-color-changed -
as :string
-
An alias for the $current context variable passed to slot content for the nodeTemplate slot.
- Deprecated:
-
Since Description 6.2.0Set the alias directly on the template element using the data-oj-as attribute instead.
- Default Value:
""
Names
Item Name Property asProperty change event asChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-as-changed -
color-label :string
-
Specifies the label describing the color metric of the sunburst. This label will be used in the legend.
- Default Value:
""
Names
Item Name Property colorLabelProperty change event colorLabelChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-color-label-changed -
data :(DataProvider.<K, D>|null)
-
The DataProvider for the nodes of the 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. - Default Value:
null
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
display-levels :number
-
The number of levels of nodes to display. By default all nodes are displayed.
- Default Value:
Number.MAX_VALUE
Names
Item Name Property displayLevelsProperty change event displayLevelsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-levels-changed -
drilling :"on"|"off"
-
Specifies whether drilling is enabled. Drillable nodes will show a pointer cursor on hover and fire an
ojBeforeDrillandojDrillevent on click (double click if selection is enabled). Drilling on a node causes a property change to the rootNode attribute. The displayLevels attribute can be used in conjunction with drilling to display very deep hieracrchies. Use "on" to enable drilling for all nodes. To enable or disable drilling on individual nodes use the drilling attribute in each node.- Default Value:
"off"
Supported Values:
Value offonNames
Item Name Property drillingProperty change event drillingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-drilling-changed -
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 expandedProperty change event expandedChangedProperty 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 hiddenCategoriesProperty change event hiddenCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hidden-categories-changed -
highlight-match :"any"|"all"
-
The matching condition for the highlightedCategories property. By default, highlightMatch is 'all' and only items whose categories match all of the values specified in the highlightedCategories array will be highlighted. If highlightMatch is 'any', then items that match at least one of the highlightedCategories values will be highlighted.
- Default Value:
"all"
Supported Values:
Value allanyNames
Item Name Property highlightMatchProperty change event highlightMatchChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlight-match-changed -
highlight-mode :"categories"|"descendants"
-
Controls which nodes are highlighted when hoverBehavior is set to 'dim'. If highlight-mode is set to 'categories', nodes with the same category as the hovered node will be highlighted. If highlight-mode is set to 'descendants', descendants of the hovered node will be highlighted; the highlighted-categories attribute will also be ignored in this case. If hover-behavior is set to 'none', highlighting can only be done by setting highlight-mode to 'categories' and populating the highlighted-categories attribute.
- Default Value:
"categories"
Supported Values:
Value categoriesdescendantsNames
Item Name Property highlightModeProperty change event highlightModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlight-mode-changed -
highlighted-categories :Array.<string>
-
An array of category strings used for highlighting. Nodes matching categories in this array will be highlighted.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property highlightedCategoriesProperty change event highlightedCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlighted-categories-changed -
hover-behavior :"dim"|"none"
-
Defines the behavior applied when hovering over the nodes.
- Default Value:
"none"
Supported Values:
Value dimnoneNames
Item Name Property hoverBehaviorProperty change event hoverBehaviorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hover-behavior-changed -
hover-behavior-delay :number
-
Specifies initial hover delay in milliseconds for highlighting nodes.
- Default Value:
200
Names
Item Name Property hoverBehaviorDelayProperty change event hoverBehaviorDelayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hover-behavior-delay-changed -
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 nodeDefaultsProperty change event nodeDefaultsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-node-defaults-changed -
node-defaults.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.
- Default Value:
"auto"
Supported Values:
Value autohorizontaloffrotatedNames
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.
- Default Value:
"center"
Supported Values:
Value centerinnerouterNames
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.
- Default Value:
"off"
Supported Values:
Value offonNames
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 nodesProperty change event nodesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-nodes-changed -
root-node :any
-
The id of the root node. When specified, only the root node and children of the root will be displayed.
- Default Value:
""
Names
Item Name Property rootNodeProperty change event rootNodeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-root-node-changed -
root-node-content :Object
-
An object defining custom root node content for the sunburst.
Names
Item Name Property rootNodeContentProperty change event rootNodeContentChangedProperty 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.
- Default Value:
"on"
Supported Values:
Value offonNames
Item Name Property rotationProperty change event rotationChangedProperty 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 selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed -
selection-mode :"none"|"single"|"multiple"
-
The type of selection behavior that is enabled on the sunburst. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
singleormultipleis specified, selection gestures will be enabled, and the sunburst's selection styling will be applied to all items specified by the selection attribute. Ifnoneis 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.
- Default Value:
"multiple"
Supported Values:
Value Description multipleMultiple items can be selected at the same time. noneSelection is disabled. singleOnly a single item can be selected at a time. Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changed -
size-label :string
-
Specifies the label describing the size metric of the sunburst. This label will be used in the legend.
- Default Value:
""
Names
Item Name Property sizeLabelProperty change event sizeLabelChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-size-label-changed -
sorting :"on"|"off"
-
Specifies whether the nodes are sorted by size. When sorting is enabled, nodes that have the same parent are sorted in order of descending size.
- Default Value:
"off"
Supported Values:
Value offonNames
Item Name Property sortingProperty change event sortingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-sorting-changed -
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 startAngleProperty change event startAngleChangedProperty 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 tooltipProperty change event tooltipChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-tooltip-changed -
tooltip.renderer :((context: 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.
- Default Value:
"auto"
Supported Values:
Value autotouchStartNames
Item Name Property touchResponseProperty change event touchResponseChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-touch-response-changed -
track-resize :"on"|"off"
-
Defines whether the element will automatically render in response to changes in size. If set to
off, then the application is responsible for callingrefreshto render the element at the new size.- Default Value:
"on"
Supported Values:
Value offonNames
Item Name Property trackResizeProperty change event trackResizeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-track-resize-changed -
translations :object|null
-
A collection of translated resources from the translation bundle, or
nullif this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.If the component does not contain any translatable resource, the default value of this attribute will be
null. If not, an object containing all resources relevant to the component.If this component has translations, their documentation immediately follows this doc entry.
Names
Item Name Property translationsProperty change event translationsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changed -
(nullable) translations.accessible-contains-controls :string
-
Used to describe a container that contains controls.
See the translations attribute for usage examples.
- Since:
- 13.0.0
Names
Item Name Property translations.accessibleContainsControls -
(nullable) translations.component-name :string
-
Used to describe the data visualization type for accessibility.
See the translations attribute for usage examples.
- Default Value:
"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-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 indexPathArray 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.0The 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 dataojSunburst.Node<K> the data object of the node to collapse idK the id of the node to collapse itemDataD 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 dataojSunburst.Node<K> the data object of the drilled node idK the id of the drilled node itemDataD 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.0The 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 dataojSunburst.Node<K> the data object of the node to expand idK the id of the node to expand itemDataD 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.0The 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 dataojSunburst.Node<K> the data object of the collapsed node idK the id of the collapsed node itemDataD 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 dataojSunburst.Node<K> the data object of the drilled node idK the id of the drilled node itemDataD 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.0The 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 dataojSunburst.Node<K> the data object of the expanded node idK the id of the expanded node itemDataD 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 valuenumber 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 nodeElement <not nullable>
The child DOM node Returns:
The context for the DOM node, or
nullwhen 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 subIdPathArray The array of indices in the subId for the desired node Deprecated:
Since Description 7.0.0The use of this function is no longer recommended. Returns:
An object containing properties for the node, or null if none exists.
- Type
- (oj.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 propertystring The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh : {void}
-
Refreshes the component.
Returns:
- Type
- void
-
setProperties(properties) : {void}
-
Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value) : {void}
-
Sets a property or a subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");
Type Definitions
-
DataContext
-
Properties:
Name Type Description colorstring The fill color of the node. labelstring The label for this node. selectedboolean True is the node is selected, false otherwise sizenumber The relative size of the node. tooltipstring The tooltip string. -
Node<K,D=any>
-
Properties:
Name Type Argument Default Description borderColorstring <optional>
The border color of the node. borderWidthnumber <optional>
The border width of the node. categoriesArray.<string> <optional>
An optional array of category strings corresponding to this data item. This enables highlighting and filtering of individual data items through interactions with the legend and other visualization elements. The categories array of each node is required to be a superset of the categories array of its parent node. If not specified, the ids of the node and its ancestors will be used. colorstring <optional>
The fill color of the node. drilling"inherit" | "off" | "on" <optional>
"inherit" Specifies whether drilling is enabled for the node. Drillable nodes will show a pointer cursor on hover and fire an ojDrill event on click (double click if selection is enabled). To enable drilling for all nodes at once, use the drilling attribute in the top level. idK <optional>
The id of the node. For the DataProvider case, the key for the node will be used as the id. labelstring <optional>
The label for this node. labelDisplay"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. labelStylePartial<CSSStyleDeclaration> <optional>
The CSS style object defining the style of the label. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration. The default value comes from the CSS and varies based on theme. The default value comes from the CSS and varies based on theme. nodesArray.<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. radiusnumber <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. svgClassNamestring <optional>
The CSS style class to apply to the node. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the node color attribute. svgStylePartial<CSSStyleDeclaration> <optional>
The inline style to apply to the node. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the node color attribute. Only SVG CSS style properties are supported. The default value comes from the CSS and varies based on theme. valuenumber The value of the node, which determines the relative size of the node. -
NodeContext
-
Properties:
Name Type Description indexPathArray.<number> The array of numerical indices for the node. subIdstring The subId string to identify the particular DOM node. -
NodeShortDescContext<K,D>
-
Properties:
Name Type Description dataojSunburst.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. valuenumber The value of the hovered node. -
NodeTemplateContext
-
Properties:
Name Type Description componentElementElement The <oj-sunburst> custom element dataObject The data object of the node indexnumber The zero-based index of the current node keyany The key of the current node parentDataArray An array of data objects of the outermost to innermost parents of the node parentKeyany The key of the parent node -
RootNodeContext<K, D>
-
Properties:
Name Type Description componentElementElement The sunburst element. dataojSunburst.Node<K> The data object of the root node. idK The id of the root node. innerBoundsobject 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 heightnumber The height of the rectangle inscribed in the root node area. widthnumber The width of the rectangle inscribed in the root node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. itemDataD The row data object for the root node. This will only be set if a DataProvider is being used. outerBoundsobject 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 heightnumber The height of the rectangle circumscribing the root node area. widthnumber The width of the rectangle circumscribing the root node area. xnumber The x coordinate relative to the top, left corner of the element. ynumber The y coordinate relative to the top, left corner of the element. -
TooltipContext<K, D>
-
Properties:
Name Type Description colorstring The color of the hovered node. componentElementElement The sunburst element. dataojSunburst.Node<K> The data object of the hovered node. idK The id of the hovered node. itemDataD The row data object for the hovered node. This will only be set if a DataProvider is being used. labelstring The label of the hovered node. parentElementElement The tooltip element. The function can directly modify or append content to this element. radiusnumber The radius of the hovered node. valuenumber The value of the hovered node.