Class: DiagramDataSource

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

Fields

oj. DiagramDataSource extends oj.DataSource

Version:
  • 3.2.0

Constructor

new DiagramDataSource(data)

Base class for Diagram DataSource. Implementations must implement all of the functions documented here.
Parameters:
Name Type Description
data Object data supported by the component
Source:

Fields

<static> EventType :string

Properties:
Name Type Default Description
ADD string add Triggered when nodes or links are added to DiagramDataSource.

The event payload contains.

dataObjectAn object with the following properties:
  • nodes: an array of node objects
  • links: an array of link objects
parentIdstringparent id for nodes and links
indexnumberAn index where the nodes should be added
REMOVE string remove Triggered when nodes or links are removed from DiagramDataSource. The event payload contains:

dataObjectAn object with the following properties:
  • nodes: an array of node objects
  • links: an array of link objects
parentIdstringparent id for nodes and links
CHANGE string change Triggered when nodes or links are removed from DiagramDataSource. The event payload contains:

dataObjectAn object with the following properties:
  • nodes: an array of node objects
  • links: an array of link objects
Source:

Methods

#getCapability(feature) → {string|null}

Determines whether this DataSource supports the specified feature.
Parameters:
Name Type Description
feature string the feature in which its capabilities is inquired.
Inherited From:
Source:
Returns:
the capability of the specified feature. Returns null if the feature is not recognized.
Type
string | null

#getChildCount(nodeData) → {number}

Retrieves number of child nodes
Parameters:
Name Type Description
nodeData Object A data object for the node in question. See node properties section.
Source:
Returns:
Number of child nodes if child count is available. The method returns 0 for leaf nodes. The method returns -1 if the child count is unknown (e.g. if the children have not been fetched).
Type
number

#getData(parentData) → {Promise}

Returns child data for the given parent. The data include all immediate child nodes along with links whose endpoints both descend from the current parent node. If all the links are available upfront, they can be returned as part of the top-level data (since all nodes descend from the diagram root). If lazy-fetching links is desirable, the most optimal way to return links is as part of the data of the nearest common ancestor of the link's endpoints.
Parameters:
Name Type Description
parentData Object | null An object that contains data for the parent node. If parentData is null, the method retrieves data for top level nodes.
Source:
Returns:
Promise resolves to a component object with the following structure:

nodesAn array of objects for the child nodes for the given parent
linksAn array of objects for the links for the given parent
Type
Promise

#getDescendantsConnectivity(nodeData) → {string}

Indicates whether the specified object contains links that should be discovered in order to display promoted links.
Parameters:
Name Type Description
nodeData Object A data object for the container node in question. See node properties section.
Source:
Returns:
the valid values are "connected", "disjoint", "unknown"
Type
string

handleEvent(eventType, event) → {boolean}

Handle the event
Parameters:
Name Type Description
eventType string event type
event Object event
Inherited From:
Source:
Returns:
Returns false if event is cancelled
Type
boolean

Init()

Initializes the instance.
Inherited From:
Source:

off(eventType, eventHandler)

Detach an event handler
Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From:
Source:

on(eventType, eventHandler)

Attach an event handler
Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From:
Source: