Element: <oj-diagram>

Oracle® JavaScript Extension Toolkit (JET)
4.2.0

E91398-01

QuickNav

Attributes


Context Objects

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

Version:
  • 4.2.0
Since:
  • 1.1.0

JET Custom Elements

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

JET Diagram

Diagrams are used to display a set of nodes and the links between them. The node positions and link paths are specified by an application-provided layout function (see JET Diagram Layout).


<oj-diagram
   layout = '{{layoutFunc}}'
   data = '{{dataSource}}'>
</oj-diagram>

JET Diagram Layout

In order to create JET Diagram component, applications are required to provide a layout callback function for positioning nodes and links. The component does not deliver a default layout. However there is a set of demo layouts that are delivered with the Cookbook application. The demo layouts can be reused by the application, but in most cases we expect that the application will want to create their own layout. The layout code must conform to the pluggable layout contract. See oj.ojDiagram#layout for additional information on layout API.

In the case when the node positions are known in advance or derived from an external layout engine, the layout can be generated using layout helper utility.

Accessibility

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

Touch End User Information

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

Keyboard End User Information

Key Action
Tab Move focus to next element.
Shift + Tab Move focus to previous element.
+ Zoom in one level.
- Zoom out one level.
0 (zero) Zoom to fit.
Ctrl + Alt + 0 (zero) Zoom and center.
PageUp or PageDown Pan up / down.
Shift + PageUp or PageDown Pan left/right (RTL: Pan right/left).
LeftArrow or RightArrow When focus is on a node, move focus and selection to nearest node left/right.
UpArrow or DownArrow When focus is on a node, move focus and selection to nearest node up/down.
Alt + < or Alt + > Move focus from the node to a link.
UpArrow or DownArrow When focus is on a link, navigate between links clockwise or counter clockwise.
LeftArrow or RightArrow When focus is on a link, move focus from a link to a start or end node.
Ctrl + Space Select focused node / link.
Ctrl + Space Multi-select node / link with focus.
Shift + <node or link navigation shortcut> Move focus and multi-select a node or a link.
Ctrl + <node or link navigation shortcut> Move focus to a node or a link but do not select.

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

Applications should avoid setting very large data densities on this element. Applications can aggregate small nodes to reduce the displayed data set size.

Styling

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

Tracking Resize

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

Reading direction

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

Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.

Slots

JET elements can have up to two types of child content:

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

contextMenu

The contextMenu slot is set on the oj-menu within this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.

The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.

To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc and demos of the individual components for details.

Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.

Example

Initialize the component with a context menu:

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

Attributes

animation-on-data-change :string

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

animation-on-display :string

Specifies the animation that is shown on initial display.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDisplay
Property change event animationOnDisplayChanged
Property change listener attribute (must be of type function) on-animation-on-display-changed

data :object

The data source for the Diagram element. See oj.DiagramDataSource
Default Value:
  • null
Names
Item Name
Property data
Property change event dataChanged
Property change listener attribute (must be of type function) on-data-changed

dnd :object

Provides support for HTML5 Drag and Drop events. Please refer to third party documentation on HTML5 Drag and Drop to learn how to use it.
Default Value:
  • null
Names
Item Name
Property dnd
Property change event dndChanged
Property change listener attribute (must be of type function) on-dnd-changed

dnd.drag :object

An object that describes drag functionality.
Default Value:
  • null
Names
Item Name
Property dnd.drag

dnd.drag.nodes :object

If this object is specified, the diagram will initiate drag operation when the user drags on diagram nodes.
Default Value:
  • null
Names
Item Name
Property dnd.drag.nodes

dnd.drag.nodes.data-types :string|Array.<string>

The MIME types to use for the dragged data in the dataTransfer object. This can be a string if there is only one type, or an array of strings if multiple types are needed. For example, if selected employee data items are being dragged, dataTypes could be "application/employees+json". Drop targets can examine the data types and decide whether to accept the data. For each type in the array, dataTransfer.setData will be called with the specified type and the data. The data is an array of the dataContexts of the selected data items. The dataContext is the JSON version of the dataContext that we use for "tooltip" option, excluding componentElement and parentElement. This property is required unless the application calls setData itself in a dragStart callback function.
Default Value:
  • null
Names
Item Name
Property dnd.drag.nodes.dataTypes

dnd.drag.nodes.drag :function(Event)

An optional callback function that receives the "drag" event as argument.
Default Value:
  • null
Names
Item Name
Property dnd.drag.nodes.drag

dnd.drag.nodes.drag-end :function(Event)

An optional callback function that receives the "dragend" event as argument.
Default Value:
  • null
Names
Item Name
Property dnd.drag.nodes.dragEnd

dnd.drag.nodes.drag-start :function(Event, object)

An optional callback function that receives the "dragstart" event and context information as arguments. The context information is as follows:
  • nodes {Array.(object)}: An array of dataContexts of the dragged data nodes. The dataContext for the node has the following properties:
    • id: The id of the hovered diagram object
    • type : The type of the hovered diagram object - "link", "promotedLink" or "node"
    • label: The label of the hovered diagram object.
    • componentElement: the Diagram element
    • data : data object for the node
    • nodeOffset : an object with x,y properties, that reflects node offset from the upper left corner of the bounding box for the dragged content.
This function can set its own data and drag image as needed. When this function is called, event.dataTransfer is already populated with the default data and drag image.
Default Value:
  • null
Names
Item Name
Property dnd.drag.nodes.dragStart

dnd.drag.ports :object

If this object is specified, the diagram will initiate link creation when the user starts dragging from a port.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports

dnd.drag.ports.data-types :string|Array.<string>

The MIME types to use for the dragged data in the dataTransfer object. This can be a string if there is only one type, or an array of strings if multiple types are needed. and parentElement. This property is required unless the application calls setData itself in a dragStart callback function.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.dataTypes

dnd.drag.ports.drag :function(Event)

An optional callback function that receives the "drag" event as argument.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.drag

dnd.drag.ports.drag-end :function(Event)

An optional callback function that receives the "dragend" event as argument.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.dragEnd

dnd.drag.ports.drag-start :function(Event, object)

An optional callback function that receives the "dragstart" event and context information as arguments. The context information is as follows:
  • ports {object}: An object with the following properties:
    • dataContext : The dataContext object of the link start node. The dataContext is the same as what we use for "tooltip" option.
    • portElement : DOM element recognized as a port that received drag event.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.dragStart

dnd.drag.ports.link-style :function(object)

An optional callback function for customizing link feedback based on a starting node and a port. If the function is not specified the link feedback will use default link styles. The function will take a single parameter - a context object with the following properties:
  • dataContext: The dataContext object of the link start node.
  • portElement: DOM element recognized as a port that received drag event
The function should return one of the following:
  • an object with the following properties:
    • svgStyle : Inline stlye object to be applied on the link feedback
    • svgClassName : A name of a style class to be applied on the link
  • null or undefined : the default link styles will be used for the link feedback
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.linkStyle

dnd.drag.ports.selector :string

A string, containing a selector expression, that will be used to identify the descendant DOM element in a diagram node that can be used for link creation. This property is requred.
Default Value:
  • null
Names
Item Name
Property dnd.drag.ports.selector

dnd.drop :object

An object that describes drop functionality.
Default Value:
  • null
Names
Item Name
Property dnd.drop

dnd.drop.background :object

Allows dropping on the diagram background.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background

dnd.drop.background.data-types :string|Array.<string>

An array of MIME data types the Diagram background can accept. This property is required unless dragEnter, dragOver, and drop callback functions are specified to handle the corresponding events.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background.dataTypes

dnd.drop.background.drag-enter :function(Event, object)

An optional callback function that receives the "dragenter" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background.dragEnter

dnd.drop.background.drag-leave :function(Event, object)

An optional callback function that receives the "dragleave" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background.dragLeave

dnd.drop.background.drag-over :function(Event, object)

An optional callback function that receives the "dragover" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background.dragOver

dnd.drop.background.drop :function(Event, object)

An optional callback function that receives the "drop" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted.
Default Value:
  • null
Names
Item Name
Property dnd.drop.background.drop
Allows dropping on diagram links.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links

dnd.drop.links.data-types :string|Array.<string>

An array of MIME data types the Diagram links can accept. This property is required unless dragEnter, dragOver, and drop callback functions are specified to handle the corresponding events.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links.dataTypes

dnd.drop.links.drag-enter :function(Event, object)

An optional callback function that receives the "dragenter" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • linkContext {object}: the JSON version of the data context for the target link.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links.dragEnter

dnd.drop.links.drag-leave :function(Event, object)

An optional callback function that receives the "dragleave" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • linkContext {object}: the JSON version of the data context for the target link.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links.dragLeave

dnd.drop.links.drag-over :function(Event, object)

An optional callback function that receives the "dragover" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • linkContext {object}: the JSON version of the data context for the target link.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links.dragOver

dnd.drop.links.drop :function(Event, object)

An optional callback function that receives the "drop" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • linkContext {object}: the JSON version of the data context for the target link.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted.
Default Value:
  • null
Names
Item Name
Property dnd.drop.links.drop

dnd.drop.nodes :object

Allows dropping on diagram nodes.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes

dnd.drop.nodes.data-types :string|Array.<string>

An array of MIME data types the Diagram nodes can accept. This property is required unless dragEnter, dragOver, and drop callback functions are specified to handle the corresponding events.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes.dataTypes

dnd.drop.nodes.drag-enter :function(Event, object)

An optional callback function that receives the "dragenter" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • nodeX {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeY {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeContext {object}: the JSON version of the data context for the target node.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes.dragEnter

dnd.drop.nodes.drag-leave :function(Event, object)

An optional callback function that receives the "dragleave" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • nodeX {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeY {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeContext {object}: the JSON version of the data context for the target node.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes.dragLeave

dnd.drop.nodes.drag-over :function(Event, object)

An optional callback function that receives the "dragover" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • nodeX {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeY {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeContext {object}: the JSON version of the data context for the target node.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes.dragOver

dnd.drop.nodes.drop :function(Event, object)

An optional callback function that receives the "drop" event and context information as arguments. The context information is as follows:
  • x {number}: x-coordinate value of the drop in the component coordinate system.
  • y {number}: y-coordinate value of the drop in the component coordinate system.
  • nodeX {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeY {number}: x-coordinate value of the drop in the target node coordinate system.
  • nodeContext {object}: the JSON version of the data context for the target node.
Note: When the dropped items are originated from Diagram, the x, y coordinates represent the upper left corner of the dropped content.
This function should call event.preventDefault() to indicate the dragged data can be accepted.
Default Value:
  • null
Names
Item Name
Property dnd.drop.nodes.drop

dnd.drop.ports :object

Allows dropping a link end on a port.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports

dnd.drop.ports.data-types :string|Array.<string>

An array of MIME data types the Diagram ports can accept. This property is required unless dragEnter, dragOver, and drop callback functions are specified to handle the corresponding events.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.dataTypes

dnd.drop.ports.drag-enter :function(Event, object)

An optional callback function that receives the "dragenter" event and context information as arguments. The context information is as follows:
  • dataContext : the JSON version of the data context for the link end node.
  • portElement : DOM element that represents a port that received drop event.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.dragEnter

dnd.drop.ports.drag-leave :function(Event, object)

An optional callback function that receives the "dragleave" event and context information as arguments. The context information is as follows:
  • dataContext : the JSON version of the data context for the link end node.
  • portElement : DOM element that represents a port that received drop event.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.dragLeave

dnd.drop.ports.drag-over :function(Event, object)

An optional callback function that receives the "dragover" event and context information as arguments. The context information is as follows:
  • dataContext : the JSON version of the data context for the link end node.
  • portElement : DOM element that represents a port that received drop event.
This function should call event.preventDefault() to indicate the dragged data can be accepted. Otherwise, dataTypes will be matched against the drag data types to determine if the data is acceptable.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.dragOver

dnd.drop.ports.drop :function(Event, object)

An optional callback function that receives the "drop" event and context information as arguments. The context information is as follows:
  • dataContext : the JSON version of the data context for the link end node.
  • portElement : DOM element that represents a port that received drop event.
This function should call event.preventDefault() to indicate the dragged data can be accepted.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.drop

dnd.drop.ports.selector :string

A string, containing a selector expression, that will be used to identify the descendant DOM element in a diagram node that can be used for link creation. This property is requred.
Default Value:
  • null
Names
Item Name
Property dnd.drop.ports.selector

expanded :KeySet

Specifies the key set containing the ids of diagram nodes that should be expanded on initial render.
Default Value:
  • new keySet.ExpandedKeySet()
Names
Item Name
Property expanded
Property change event expandedChanged
Property change listener attribute (must be of type function) on-expanded-changed

focus-renderer :function(object)

An optional callback function to update the node in response to changes in keyboard focus state. The function takes a single argument, provided by the component, with the following properties:
  • componentElement: The Diagram element.
  • parentElement: A parent group element that takes a custom SVG fragment as the node content. Modifications of the parentElement are not supported.
  • data: The data object for the node.
  • content: An object that describes child content. The object has the following properties
    • element: an SVG group element that contains child nodes for the container.
    • width: width of the child content.
    • height: height of the child content.
  • state: An object that reflects the current state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • previousState: An object that reflects the previous state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • id: Node id.
  • type: Object type = node.
  • renderDefaultFocus: Function for rendering default focus effect for the diagram node.
  • renderDefaultHover: Function for rendering default hover effect for the diagram node.
  • renderDefaultSelection: Function for rendering default selection effect for the diagram node.
The function should return one of the following:
  • An Object with the following property:
    • insert: SVGElement - An SVG element, which will be used as content of a Diagram node.
  • undefined: Indicates that the existing DOM has been directly modified and no further action is required.
Default Value:
  • null
Names
Item Name
Property focusRenderer
Property change event focusRendererChanged
Property change listener attribute (must be of type function) on-focus-renderer-changed

hidden-categories :Array.<string>

An array of category strings used for category filtering. Diagram nodes and links with a category in hiddenCategories will be filtered.
Default Value:
  • null
Supports writeback:
  • true
Names
Item Name
Property hiddenCategories
Property change event hiddenCategoriesChanged
Property change listener attribute (must be of type function) on-hidden-categories-changed

highlight-match :string

The matching condition for the highlightedCategories option. By default, highlightMatch is 'all' and only items whose categories match all of the values specified in the highlightedCategories array will be highlighted. If highlightMatch is 'any', then items that match at least one of the highlightedCategories values will be highlighted.
Supported Values:
Name Type
"all" string
"any" string
Default Value:
  • "all"
Names
Item Name
Property highlightMatch
Property change event highlightMatchChanged
Property change listener attribute (must be of type function) on-highlight-match-changed

highlighted-categories :Array.<string>

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

hover-behavior :string

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

hover-renderer :function(object)

An optional callback function to update the node in response to changes in hover state. The function takes a single argument, provided by the component, with the following properties:
  • componentElement: The Diagram element.
  • parentElement: A parent group element that takes a custom SVG fragment as the node content. Modifications of the parentElement are not supported.
  • data: The data object for the node.
  • content: An object that describes child content. The object has the following properties
    • element: an SVG group element that contains child nodes for the container.
    • width: width of the child content.
    • height: height of the child content.
  • state: An object that reflects the current state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • previousState: An object that reflects the previous state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • id: Node id.
  • type: Object type = node.
  • renderDefaultFocus: Function for rendering default focus effect for the diagram node.
  • renderDefaultHover: Function for rendering default hover effect for the diagram node.
  • renderDefaultSelection: Function for rendering default selection effect for the diagram node.
The function should return one of the following:
  • An Object with the following property:
    • insert: SVGElement - An SVG element, which will be used as content of a Diagram node.
  • undefined: Indicates that the existing DOM has been directly modified and no further action is required.
Default Value:
  • null
Names
Item Name
Property hoverRenderer
Property change event hoverRendererChanged
Property change listener attribute (must be of type function) on-hover-renderer-changed

layout :function(DvtDiagramLayoutContext)

A custom JavaScript client layout method - a custom code developed by a customer used to position Diagram nodes and links. The layout code must conform to the pluggable layout contract.
Default Value:
  • null
See:
Names
Item Name
Property layout
Property change event layoutChanged
Property change listener attribute (must be of type function) on-layout-changed

link-highlight-mode :string

Defines link highlighting mode.
Supported Values:
Name Type
"link" string
"linkAndNodes" string
Default Value:
  • "link"
Names
Item Name
Property linkHighlightMode
Property change event linkHighlightModeChanged
Property change listener attribute (must be of type function) on-link-highlight-mode-changed

link-properties :function(object)

Optional callback that provides a way to customize an appearance of the specific link, the function maps link data into link styles. The function takes a data object for the link provided by the diagram. The following properties are supported on the return object:
Properties:
Name Type Description
labelStyle object The CSS style object defining the style of the link label.
color string Link color.
svgStyle object The SVG CSS style object defining link style. The style class and style object will be applied directly on the link and override any other styling specified through the properties.
svgClassName string The SVG CSS style class defining link style. The style class and style object will be applied directly on the link and override any other styling specified through the properties.
width number Link width in pixels.
startConnectorType string Specifies the type of start connector on the link.
Supported values are "arrowOpen", "arrow", "arrowConcave", "circle", "rectangle", "rectangleRounded", "none".
Default value is "none".
endConnectorType string Specifies the type of end connector on the link.
Supported values are "arrowOpen", "arrow", "arrowConcave", "circle", "rectangle", "rectangleRounded", "none".
Default value is "none".
Default Value:
  • null
Names
Item Name
Property linkProperties
Property change event linkPropertiesChanged
Property change listener attribute (must be of type function) on-link-properties-changed
Example

Customizing link color using customColor property defined on the link data object

<oj-diagram
   layout = '{{layoutFunc}}'
   data = '{{dataSource}}'
   node-properties = '[[function(data){return {color:data.customColor};}]]'>
</oj-diagram>

max-zoom :number

Specifies the maximum zoom level for this diagram. This can be any number greater than zero which indicates the maximum point to which Diagram objects can be scaled. A value of 2.0 implies that the Diagram can be zoomed in until Nodes appear at twice their natural size. By default, maxZoom is 1.0.
Default Value:
  • 1.0
Names
Item Name
Property maxZoom
Property change event maxZoomChanged
Property change listener attribute (must be of type function) on-max-zoom-changed

min-zoom :number

Specifies the minimum zoom level for this diagram. If minZoom is greater than zero, it indicates the minimum point to which Diagram objects can be scaled. A value of 0.1 implies that the Diagram can be zoomed out until Nodes appear at one-tenth their natural size. By default, minZoom is set to zoom-to-fit level based on the currently visible Nodes and Links.
Default Value:
  • null
Names
Item Name
Property minZoom
Property change event minZoomChanged
Property change listener attribute (must be of type function) on-min-zoom-changed

node-highlight-mode :string

Defines node highlighting mode.
Supported Values:
Name Type
"node" string
"nodeAndIncomingLinks" string
"nodeAndLinks" string
"nodeAndOutgoingLinks" string
Default Value:
  • "node"
Names
Item Name
Property nodeHighlightMode
Property change event nodeHighlightModeChanged
Property change listener attribute (must be of type function) on-node-highlight-mode-changed

node-properties :function(object)

Optional callback that provides a way to customize an appearance of the specific node, the function maps node data into node styles. The function takes a data object for the node provided by the diagram. The following properties are supported on the return object:
Properties:
Name Type Description
showDisclosure string Determines when to display the expand/collapse button.
Supported values are "on", "off".
Default value is "on".
labelStyle object The CSS style object defining the style of the node label.
icon object Specifies an icon to be used as a graphical element for the node
Properties
Name Type Description
borderColor string The border color of the icon.
borderRadius string The border radius of the icon. CSS border-radius values accepted. Note that non-% values (including unitless) get interpreted as 'px'.
borderWidth number The border width in pixels.
color string The fill color of the icon.
pattern string The fill pattern of the icon.
Supported values are "smallChecker", "smallCrosshatch", "smallDiagonalLeft", "smallDiagonalRight", "smallDiamond", "smallTriangle", "largeChecker", "largeCrosshatch", "largeDiagonalLeft", "largeDiagonalRight", "largeDiamond", "largeTriangle", "none".
Default value is "none".
opacity number The opacity of the icon.
shape string The shape of the icon. Can take the name of a built-in shape or the svg path commands for a custom shape.
Supported built-in shapes:"ellipse", "square", "plus", "diamond", "triangleUp", "triangleDown", "human", "rectangle", "star", "circle".
Default value is "circle".
source string The URI of the node image.
sourceHover string The optional URI of the node hover image. If not defined, the source image will be used.
sourceHoverSelected string The optional URI of the selected image on hover. If not defined, the sourceSelected image will be used. If the sourceSelected image is not defined, the source image will be used.
sourceSelected string The optional URI of the selected image. If not defined, the source image will be used.
width number The width of the icon.
height number The height of the icon.
svgStyle object The CSS style object defining the style of the icon. The style class and style object will be applied directly on the icon and override any other styling specified through the properties.
svgClassName object The CSS style class defining the style of the icon. The style class and style object will be applied directly on the icon and override any other styling specified through the properties.
Default Value:
  • null
Names
Item Name
Property nodeProperties
Property change event nodePropertiesChanged
Property change listener attribute (must be of type function) on-node-properties-changed
Example

Customizing node icon color using customColor property defined on the node data object

<oj-diagram
   layout = '{{layoutFunc}}'
   data = '{{dataSource}}'
   node-properties = '[[function(data){return {icon:{color:data.customColor}};}]]'>
</oj-diagram>

pan-direction :string

Specifies if panning allowed in horizontal and vertical directions.
Supported Values:
Name Type
"auto" string
"x" string
"y" string
Default Value:
  • "auto"
Names
Item Name
Property panDirection
Property change event panDirectionChanged
Property change listener attribute (must be of type function) on-pan-direction-changed

panning :string

Specifies whether panning is allowed in Diagram.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property panning
Property change event panningChanged
Property change listener attribute (must be of type function) on-panning-changed

promoted-link-behavior :string

Defines promoted link behavior for the component.
If the value is set to none, the diagram will not retrieve additional data to resolve promoted links and will not display promoted links.
If the value is set to lazy, the diagram will retrieve additional data to resolve promoted links if the data is already available and will display available promoted links. The component will not retrieve additional data if the data is not available yet.
If the value is set to full, the diagram will retrieve additional data to resolve all promoted links and will display promoted links.
Supported Values:
Name Type
"full" string
"lazy" string
"none" string
Default Value:
  • "lazy"
Names
Item Name
Property promotedLinkBehavior
Property change event promotedLinkBehaviorChanged
Property change listener attribute (must be of type function) on-promoted-link-behavior-changed

renderer :function(object)

A callback function - a custom renderer - that will be used for initial node rendering. The function takes a single argument, provided by the component, with the following properties:
  • componentElement: The Diagram element.
  • parentElement: A parent group element that takes a custom SVG fragment as the node content. Modifications of the parentElement are not supported.
  • data: The data object for the node.
  • content: An object that describes child content. The object has the following properties
    • element: an SVG group element that contains child nodes for the container.
    • width: width of the child content.
    • height: height of the child content.
  • state: An object that reflects the current state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • previousState: An object that reflects the previous state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • id: Node id.
  • type: Object type = node.
  • renderDefaultFocus: Function for rendering default focus effect for the diagram node.
  • renderDefaultHover: Function for rendering default hover effect for the diagram node.
  • renderDefaultSelection: Function for rendering default selection effect for the diagram node.
The function should return an Object with the following property:
  • insert: SVGElement - An SVG element, which will be used as content of a Diagram node.
Default Value:
  • null
Names
Item Name
Property renderer
Property change event rendererChanged
Property change listener attribute (must be of type function) on-renderer-changed

selection :Array.<string>

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

selection-mode :string

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

selection-renderer :function(object)

An optional callback function to update the node in response to changes in selection state. The function takes a single argument, provided by the component, with the following properties:
  • componentElement: The Diagram element.
  • parentElement: A parent group element that takes a custom SVG fragment as the node content. Modifications of the parentElement are not supported.
  • data: The data object for the node.
  • content: An object that describes child content. The object has the following properties
    • element: an SVG group element that contains child nodes for the container.
    • width: width of the child content.
    • height: height of the child content.
  • state: An object that reflects the current state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • previousState: An object that reflects the previous state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • id: Node id.
  • type: Object type = node.
  • renderDefaultFocus: Function for rendering default focus effect for the diagram node.
  • renderDefaultHover: Function for rendering default hover effect for the diagram node.
  • renderDefaultSelection: Function for rendering default selection effect for the diagram node.
The function should return one of the following:
  • An Object with the following property:
    • insert: SVGElement - An SVG element, which will be used as content of a Diagram node.
  • undefined: Indicates that the existing DOM has been directly modified and no further action is required.
Default Value:
  • null
Names
Item Name
Property selectionRenderer
Property change event selectionRendererChanged
Property change listener attribute (must be of type function) on-selection-renderer-changed

style-defaults :object

An object defining the style defaults for this diagram.
Default Value:
  • null
Names
Item Name
Property styleDefaults
Property change event styleDefaultsChanged
Property change listener attribute (must be of type function) on-style-defaults-changed

style-defaults.animation-duration :number

The duration of the animations in milliseconds.
Default Value:
  • null
Names
Item Name
Property styleDefaults.animationDuration

style-defaults.hover-behavior-delay :number

Specifies initial hover delay in ms for highlighting data items.
Default Value:
  • null
Names
Item Name
Property styleDefaults.hoverBehaviorDelay

style-defaults.link-defaults :object

Default link styles
Default Value:
  • null
Names
Item Name
Property styleDefaults.linkDefaults

style-defaults.link-defaults.color :string

Default link color.
Default Value:
  • null
Names
Item Name
Property styleDefaults.linkDefaults.color

style-defaults.link-defaults.end-connector-type :string

Specifies the type of end connector on the link.
Supported Values:
Name Type
"arrow" string
"arrowConcave" string
"arrowOpen" string
"circle" string
"none" string
"rectangle" string
"rectangleRounded" string
Default Value:
  • "none"
Names
Item Name
Property styleDefaults.linkDefaults.endConnectorType

style-defaults.link-defaults.label-style :object

The CSS style object defining the style of the primary label. Supports color, fontFamily, fontSize, fontStyle, fontWeight, textDecoration, cursor, backgroundColor, borderColor, borderRadius, and borderWidth properties.
Default Value:
  • null
Names
Item Name
Property styleDefaults.linkDefaults.labelStyle

style-defaults.link-defaults.start-connector-type :string

Specifies the type of start connector on the link.
Supported Values:
Name Type
"arrow" string
"arrowConcave" string
"arrowOpen" string
"circle" string
"none" string
"rectangle" string
"rectangleRounded" string
Default Value:
  • "none"
Names
Item Name
Property styleDefaults.linkDefaults.startConnectorType

style-defaults.link-defaults.svg-class-name :object

The default SVG CSS style class to apply to the link.
Default Value:
  • null
Names
Item Name
Property styleDefaults.linkDefaults.svgClassName

style-defaults.link-defaults.svg-style :object

The default style object represents the SVG CSS style of the link. User defined custom SVG CSS Styles will be applied directly on the link.
Default Value:
  • null
Names
Item Name
Property styleDefaults.linkDefaults.svgStyle

style-defaults.link-defaults.width :number

Default link width in pixels.
Default Value:
  • 1.0
Names
Item Name
Property styleDefaults.linkDefaults.width

style-defaults.node-defaults :object

Default node styles
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults

style-defaults.node-defaults.icon :object

Default style for the node icon.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon

style-defaults.node-defaults.icon.border-color :string

Default border color of the icon.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.borderColor

style-defaults.node-defaults.icon.border-radius :string

The default border radius of the icon. CSS border-radius values accepted. Note that non-% values (including unitless) get interpreted as 'px'.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.borderRadius

style-defaults.node-defaults.icon.border-width :number

Default border width of the icon in pixels.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.borderWidth

style-defaults.node-defaults.icon.color :string

Default color of the icon.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.color

style-defaults.node-defaults.icon.height :number

Default icon height.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.height

style-defaults.node-defaults.icon.pattern :string

Default fill pattern of the icon.
Supported Values:
Name Type
"largeChecker" string
"largeCrosshatch" string
"largeDiagonalLeft" string
"largeDiagonalRight" string
"largeDiamond" string
"largeTriangle" string
"none" string
"smallChecker" string
"smallCrosshatch" string
"smallDiagonalLeft" string
"smallDiagonalRight" string
"smallDiamond" string
"smallTriangle" string
Default Value:
  • "none"
Names
Item Name
Property styleDefaults.nodeDefaults.icon.pattern

style-defaults.node-defaults.icon.shape :string

Default shape of the icon. Can take the name of a built-in shape or the svg path commands for a custom shape.
Supported Values:
Name Type
"circle" string
"diamond" string
"ellipse" string
"human" string
"plus" string
"rectangle" string
"square" string
"star" string
"triangleDown" string
"triangleUp" string
Default Value:
  • "circle"
Names
Item Name
Property styleDefaults.nodeDefaults.icon.shape

style-defaults.node-defaults.icon.source :string

The URI of the node image
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.source

style-defaults.node-defaults.icon.source-hover :string

The optional URI of the node hover image. If not defined, the source image will be used.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.sourceHover

style-defaults.node-defaults.icon.source-hover-selected :string

The optional URI of the selected image on hover. If not defined, the sourceSelected image will be used. If the sourceSelected image is not defined, the source image will be used.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.sourceHoverSelected

style-defaults.node-defaults.icon.source-selected :string

The optional URI of the selected image. If not defined, the source image will be used.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.sourceSelected

style-defaults.node-defaults.icon.svg-class-name :object

The SVG CSS style class to apply to the node icon.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.svgClassName

style-defaults.node-defaults.icon.svg-style :object

The default SVG CSS style object defining the style of the icon.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.svgStyle

style-defaults.node-defaults.icon.width :number

Default icon width.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.icon.width

style-defaults.node-defaults.label-style :object

The CSS style object defining the style of the primary label. Supports color, fontFamily, fontSize, fontStyle, fontWeight, textDecoration, cursor, backgroundColor, borderColor, borderRadius, and borderWidth properties.
Default Value:
  • null
Names
Item Name
Property styleDefaults.nodeDefaults.labelStyle

style-defaults.node-defaults.show-disclosure :string

Determines when to display the expand/collapse button.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property styleDefaults.nodeDefaults.showDisclosure
Promoted link styles
Default Value:
  • null
Names
Item Name
Property styleDefaults.promotedLink

style-defaults.promoted-link.color :string

Default promoted link color.
Default Value:
  • null
Names
Item Name
Property styleDefaults.promotedLink.color

style-defaults.promoted-link.end-connector-type :string

Specifies the type of end connector on the promoted link.
Supported Values:
Name Type
"arrow" string
"arrowConcave" string
"arrowOpen" string
"circle" string
"none" string
"rectangle" string
"rectangleRounded" string
Default Value:
  • "none"
Names
Item Name
Property styleDefaults.promotedLink.endConnectorType

style-defaults.promoted-link.start-connector-type :string

Specifies the type of start connector on the promoted link.
Supported Values:
Name Type
"arrow" string
"arrowConcave" string
"arrowOpen" string
"circle" string
"none" string
"rectangle" string
"rectangleRounded" string
Default Value:
  • "none"
Names
Item Name
Property styleDefaults.promotedLink.startConnectorType

style-defaults.promoted-link.svg-class-name :object

The SVG CSS style class to apply to the promoted link.
Default Value:
  • null
Names
Item Name
Property styleDefaults.promotedLink.svgClassName

style-defaults.promoted-link.svg-style :object

The promoted style object represents the CSS style of the link. User defined custom CSS Styles will be applied directly on the link.
Default Value:
  • null
Names
Item Name
Property styleDefaults.promotedLink.svgStyle

style-defaults.promoted-link.width :number

Default link width in pixels.
Default Value:
  • 1.0
Names
Item Name
Property styleDefaults.promotedLink.width

tooltip :object

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

tooltip.renderer :function(object)

A function that returns a custom tooltip. The function takes a dataContext argument, provided by the diagram, with the following properties:
  • parentElement: The tooltip element. The function can directly modify or append content to this element.
  • id: The id of the hovered diagram object.
  • type : The type of the hovered diagram object - "link", "promotedLink" or "node".
  • label: The label of the hovered diagram object.
  • componentElement: The Diagram element.
  • data : Relevant data for the object:
    • data object for the node, if the object type is 'node'
    • data object for the link, if the object type is 'link'
    • an array of data objects that correspond to links represented by the promoted link
The function should return an Object that contains only one of the two properties:
  • insert: HTMLElement | string - An HTML element, which will be appended to the tooltip, or a tooltip string.
  • preventDefault: true - Indicates that the tooltip should not be displayed. It is not necessary to return {preventDefault:false} to display tooltip, since this is a default behavior.
Default Value:
  • null
Names
Item Name
Property tooltip.renderer

touch-response :string

Data visualizations require a press and hold delay before triggering tooltips and rollover effects on mobile devices to avoid interfering with page panning, but these hold delays can make applications seem slower and less responsive. For a better user experience, the application can remove the touch and hold delay when data visualizations are used within a non scrolling container or if there is sufficient space outside of the visualization for panning. If touchResponse is touchStart the component will instantly trigger the touch gesture and consume the page pan events if the component does not require an internal feature that requires a touch start gesture like panning or zooming. If touchResponse is auto, the component will behave like touchStart if it determines that it is not rendered within scrolling content and if component panning is not available for those components that support the feature.
Supported Values:
Name Type
"auto" string
"touchStart" string
Default Value:
  • "auto"
Names
Item Name
Property touchResponse
Property change event touchResponseChanged
Property change listener attribute (must be of type function) on-touch-response-changed

track-resize :string

Defines whether the element will automatically render in response to changes in size. If set to off, then the application is responsible for calling refresh to render the element at the new size.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property trackResize
Property change event trackResizeChanged
Property change listener attribute (must be of type function) on-track-resize-changed
Examples

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

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

Get or set the trackResize property after initialization:

// getter
var value = myComponent.trackResize;

// setter
myComponent.trackResize="off";

translations :Object

A collection of translated resources from the translation bundle, or null if this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.

If this component has translations, their documentation immediately follows this doc entry.

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

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

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

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

Get or set the translations property after initialization:

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

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

// Get all
var values = myComponent.translations;

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

translations.component-name :string

Used to describe the data visualization type for accessibility.

See the translations attribute for usage examples.

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

translations.label-and-value :string

Used to display a label and its value.

See the translations attribute for usage examples.

Default Value:
  • "{0}: {1}"
Names
Item Name
Property translations.labelAndValue

translations.label-clear-selection :string

Text shown for clearing multiple selection on touch devices.

See the translations attribute for usage examples.

Default Value:
  • "Clear Selection"
Names
Item Name
Property translations.labelClearSelection

translations.label-count-with-total :string

Used to display a count out of a total.

See the translations attribute for usage examples.

Default Value:
  • "{0} of {1}"
Names
Item Name
Property translations.labelCountWithTotal

translations.label-data-visualization :string

Label for data visualizations used for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Data Visualization"
Names
Item Name
Property translations.labelDataVisualization

translations.label-invalid-data :string

Text shown when the component receives invalid data.

See the translations attribute for usage examples.

Default Value:
  • "Invalid data"
Names
Item Name
Property translations.labelInvalidData

translations.label-no-data :string

Text shown when the component receives no data.

See the translations attribute for usage examples.

Default Value:
  • "No data to display"
Names
Item Name
Property translations.labelNoData

Used for the promoted link tooltip - promoted link consists a single link.

See the translations attribute for usage examples.

Default Value:
  • "{0} link"
Names
Item Name
Property translations.promotedLink

translations.promoted-link-aria-desc :string

Used to describe promoted link type for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Indirect"
Names
Item Name
Property translations.promotedLinkAriaDesc

Used for the promoted link tooltip - promoted link consists multiple links.

See the translations attribute for usage examples.

Default Value:
  • "{0} links"
Names
Item Name
Property translations.promotedLinks

translations.state-collapsed :string

Used to describe the collapsed state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Collapsed"
Names
Item Name
Property translations.stateCollapsed

translations.state-drillable :string

Used to describe a drillable object for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Drillable"
Names
Item Name
Property translations.stateDrillable

translations.state-expanded :string

Used to describe the expanded state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Expanded"
Names
Item Name
Property translations.stateExpanded

translations.state-hidden :string

Used to describe the hidden state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Hidden"
Names
Item Name
Property translations.stateHidden

translations.state-isolated :string

Used to describe the isolated state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Isolated"
Names
Item Name
Property translations.stateIsolated

translations.state-maximized :string

Used to describe the maximized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Maximized"
Names
Item Name
Property translations.stateMaximized

translations.state-minimized :string

Used to describe the minimized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Minimized"
Names
Item Name
Property translations.stateMinimized

translations.state-selected :string

Used to describe the selected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Selected"
Names
Item Name
Property translations.stateSelected

translations.state-unselected :string

Used to describe the unselected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Unselected"
Names
Item Name
Property translations.stateUnselected

translations.state-visible :string

Used to describe the visible state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Visible"
Names
Item Name
Property translations.stateVisible

zoom-renderer :function(object)

An optional callback function to update the node in response to changes in zoom level. The function takes a single argument, provided by the component, with the following properties:
  • componentElement: The Diagram element.
  • parentElement: A parent group element that takes a custom SVG fragment as the node content. Modifications of the parentElement are not supported.
  • data: The data object for the node.
  • content: An object that describes child content. The object has the following properties
    • element: an SVG group element that contains child nodes for the container.
    • width: width of the child content.
    • height: height of the child content.
  • state: An object that reflects the current state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • previousState: An object that reflects the previous state of the diagram node. The object has the following properties
    • hovered: hovered state, boolean.
    • selected: selected state, boolean.
    • focused: focused state, boolean.
    • zoom: zoom state, number.
    • expanded: expanded state, boolean.
  • id: Node id.
  • type: Object type = node.
  • renderDefaultFocus: Function for rendering default focus effect for the diagram node.
  • renderDefaultHover: Function for rendering default hover effect for the diagram node.
  • renderDefaultSelection: Function for rendering default selection effect for the diagram node.
The function should return one of the following:
  • An Object with the following property:
    • insert: SVGElement - An SVG element, which will be used as content of a Diagram node.
  • undefined: Indicates that the existing DOM has been directly modified and no further action is required.
Default Value:
  • null
Names
Item Name
Property zoomRenderer
Property change event zoomRendererChanged
Property change listener attribute (must be of type function) on-zoom-renderer-changed

zooming :string

Specifies whether zooming is allowed in Diagram.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property zooming
Property change event zoomingChanged
Property change listener attribute (must be of type function) on-zooming-changed

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:

Context for diagram link at a specified index.

Properties:
Name Type
index number

oj-diagram-node

Context for diagram node at a specified index.

Properties:
Name Type
index number

Events

ojBeforeCollapse

Triggered immediately before any container node in the diagram is collapsed.
Properties:

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

Name Type Description
data.nodeId string the id of the collapsing object
Examples

Specify an ojBeforeCollapse listener via the DOM attribute:

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

Specify an ojBeforeCollapse listener via the JavaScript property:

myDiagram.onOjBeforeCollapse = listener;

Add an ojBeforeCollapse listener via the addEventListener API:

myDiagram.addEventListener('ojBeforeCollapse', listener);

ojBeforeExpand

Triggered immediately before any container node in the diagram is expanded.
Properties:

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

Name Type Description
nodeId string the id of the expanding object
Examples

Specify an ojBeforeExpand listener via the DOM attribute:

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

Specify an ojBeforeExpand listener via the JavaScript property:

myDiagram.onOjBeforeExpand = listener;

Add an ojBeforeExpand listener via the addEventListener API:

myDiagram.addEventListener('ojBeforeExpand', listener);

ojCollapse

Triggered when a node has been collapsed.
Properties:

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

Name Type Description
data.nodeId string the id of the collapsed object
Examples

Specify an ojCollapse listener via the DOM attribute:

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

Specify an ojCollapse listener via the JavaScript property:

myDiagram.onOjCollapse = listener;

Add an ojCollapse listener via the addEventListener API:

myDiagram.addEventListener('ojCollapse', listener);

ojExpand

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

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

Name Type Description
nodeId string the id of the expanded object
Examples

Specify an ojExpand listener via the DOM attribute:

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

Specify an ojExpand listener via the JavaScript property:

myDiagram.onOjExpand = listener;

Add an ojExpand listener via the addEventListener API:

myDiagram.addEventListener('ojExpand', listener);

Methods

getContextByNode(node) → {Object|null}

Returns an object with context for the given child DOM node. This will always contain the subid for the node, defined as the 'subId' property on the context object. Additional component specific information may also be included. For more details on returned objects, see context objects.
Parameters:
Name Type Description
node Element The child DOM node
Returns:
The context for the DOM node, or null when none is found.
Type
Object | null
Example
 // Returns {'subId': 'oj-some-sub-id', 'componentSpecificProperty': someValue, ...}
var context = myComponent.getContextByNode(nodeInsideElement);
Returns an object with the following properties for automation testing verification of the diagram link at the specified index.
Parameters:
Name Type Description
linkIndex number Link index
Properties:
Name Type Description
color string Link color
label string Link label
endConnectorType string The type of end connector on the link
endNode string The id of the end node.
selected boolean The selected state of the link
startConnectorType string The type of start connector on the link
startNode string The id of the start node.
style string Link style
tooltip string Link tooltip
width number Link width
Returns:
An object containing properties for the link at the given index, or null if none exists.
Type
Object | null

getLinkCount() → {Number}

Returns number of diagram links
Returns:
The number of links
Type
Number

getNode(nodeIndex) → {Object|null}

Returns an object with the following properties for automation testing verification of the diagram node at the specified index.
Parameters:
Name Type Description
nodeIndex String Node index
Properties:
Name Type Description
icon Object | null The icon for the node, or null if none exists.
Properties
Name Type Description
color string The color of the icon
shape string The shape of the icon
label string Node label
selected boolean The selected state of the node
tooltip string Node tooltip
Returns:
An object containing properties for the node at the given index, or null if none exists.
Type
Object | null

getNodeCount() → {Number}

Returns number of diagram nodes
Returns:
The number of nodes
Type
Number
Returns an object with the following properties for automation testing verification of the promoted link between specified nodes.
Parameters:
Name Type Description
startNodeIndex number Start node index
endNodeIndex number End node index
Properties:
Name Type Description
color string Link color
endConnectorType string The type of end connector on the link
endNode string The id of the end node.
selected boolean The selected state of the link
startConnectorType string The type of start connector on the link
startNode string The id of the start node.
style string Link style
tooltip string Link tooltip
width number Link width
count number Number of links it represents
Returns:
An object containing properties for the link at the given index, or null if none exists.
Type
Object | null

getProperty(property) → {*}

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

Get a single subproperty of a complex property:

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

refresh()

Refreshes the component.

setProperties(properties)

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

Set a batch of properties:

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

setProperty(property, value)

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

Set a single subproperty of a complex property:

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