Element: <oj-tag-cloud>

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 Tag Cloud

Tag clouds are used to display text data with the importance of each tag shown with font size or color.

The SVG DOM that this component generates should be treated as a black box, as it is subject to change.


<oj-tag-cloud 
  items='[{"id": "item1", "label": "the", "value": 20}, 
          {"id": "item2", "label": "cat", "value": 17}, 
          {"id": "item3", "label": "hat", "value": 13}]'>
</oj-tag-cloud>

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.

When using font colors as a data dimension for tag clouds, the application needs to ensure that they meet minimum contrast requirements. Not all colors in the default value ramp provided by oj.ColorAttributeGroupHandler will meet minimum contrast requirements.

Touch End User Information

Target Gesture Action
Data Item Tap Select when selectionMode is enabled.
Open a link when the url for a data item is set.
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.
UpArrow Move focus and selection to previous data item.
DownArrow Move focus and selection to next data item.
LeftArrow Move focus and selection to previous data item.
RightArrow Move focus and selection to next data item.
Shift + UpArrow Move focus and multi-select previous data item.
Shift + DownArrow Move focus and multi-select next data item.
Shift + LeftArrow Move focus and multi-select previous data item.
Shift + RightArrow Move focus and multi-select next data item.
Ctrl + UpArrow Move focus to previous data item, without changing the current selection.
Ctrl + DownArrow Move focus to next data item, without changing the current selection.
Ctrl + LeftArrow Move focus to previous data item, without changing the current selection.
Ctrl + RightArrow Move focus to next data item, without changing the current selection.
Ctrl + Spacebar Multi-select data item with focus.
Enter Open a link when the url for a data item is set.

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 data items will generally move and resize on any data change.

Layout

Rectangular layouts are faster than cloud layouts and are recommended for larger data sets.

Styling

Use the highest level property available. For example, consider setting styling properties on styleDefaults.style, instead of styling properties on the individual data items. The tag cloud 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

Defines 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
Examples

Initialize the tag cloud with the animation-on-data-change attribute specified:

<oj-tag-cloud animation-on-data-change='auto'></oj-tag-cloud>

Get or set the animationOnDataChange property after initialization:

// getter
var value = myTagCloud.animationOnDataChange;

// setter
myTagCloud.animationOnDataChange="auto";

animation-on-display :string

Defines 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
Examples

Initialize the tag cloud with the animation-on-display attribute specified:

<oj-tag-cloud animation-on-display='auto'></oj-tag-cloud>

Get or set the animationOnDisplay property after initialization:

// getter
var value = myTagCloud.animationOnDisplay;

// setter
myTagCloud.animationOnDisplay="auto";

hidden-categories :Array.<string>

An array of category strings used for category filtering. Data items 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
Examples

Initialize the tag cloud with the hidden-categories attribute specified:

<oj-tag-cloud hidden-categories='["soda", "water"]'></oj-tag-cloud>

Get or set the hiddenCategories property after initialization:

// Get one
var value = myTagCloud.hiddenCategories[0];

// Get all
var values = myTagCloud.hiddenCategories;

// Set all (There is no permissible "set one" syntax.)
myTagCloud.hiddenCategories=["soda", "water"];

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
Examples

Initialize the tag cloud with the highlight-match attribute specified:

<oj-tag-cloud highlight-match='all'></oj-tag-cloud>

Get or set the highlightMatch property after initialization:

// getter
var value = myTagCloud.highlightMatch;

// setter
myTagCloud.highlightMatch="all";

highlighted-categories :Array.<string>

An array of category strings used for category highlighting. Data items 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
Examples

Initialize the tag cloud with the hidden-categories attribute specified:

<oj-tag-cloud hidden-categories='["soda", "water"]'></oj-tag-cloud>

Get or set the hiddenCategories property after initialization:

// Get one
var value = myTagCloud.hiddenCategories[0];

// Get all
var values = myTagCloud.hiddenCategories;

// Set all (There is no permissible "set one" syntax.)
myTagCloud.hiddenCategories=["soda", "water"];

hover-behavior :string

Defines the behavior applied when hovering over data items.
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
Examples

Initialize the tag cloud with the hover-behavior attribute specified:

<oj-tag-cloud hover-behavior='dim'></oj-tag-cloud>

Get or set the hoverBehavior property after initialization:

// getter
var value = myTagCloud.hoverBehavior;

// setter
myTagCloud.hoverBehavior="dim";

items :Array.<object>|Promise

An array of objects with the following properties that defines the data items for the tag cloud items. Also accepts a Promise or callback function for deferred data rendering. The function should return one of the following:
  • Promise: A Promise that will resolve with an array of data items. No data will be rendered if the Promise is rejected.
  • Array: An array of data items.
Default Value:
  • null
Names
Item Name
Property items
Property change event itemsChanged
Property change listener attribute (must be of type function) on-items-changed
Examples

Initialize the tag cloud with the items attribute specified:

<oj-tag-cloud items='[{"id": "item1", "label": "the", "value": 20}, 
                         {"id": "item2", "label": "cat", "value": 17}, 
                         {"id": "item3", "label": "hat", "value": 13}]'></oj-tag-cloud>

<oj-tag-cloud items='[[itemsPromise]]'></oj-tag-cloud>

Get or set the items property after initialization:

// Get all (The items getter always returns a Promise so there is no "get one" syntax)
var values = myTagCloud.items;

// Set all (There is no permissible "set one" syntax.)
myTagCloud.items=[{"id": "item1", "label": "the", "value": 20}, 
                  {"id": "item2", "label": "cat", "value": 17}, 
                  {"id": "item3", "label": "hat", "value": 13}];

items[].categories :Array.<string>

An array of category strings corresponding to the tag cloud items. This allows highlighting and filtering of items.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.
Example
 See the items attribute for usage examples.

items[].color :string

The color of the text. Will be overridden by any color defined in the style option.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.
Example
 See the items attribute for usage examples.

items[].id :string

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

items[].label :string

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

items[].shortDesc :string

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

items[].svgClassName :string

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

items[].svgStyle :object

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

items[].url :string

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

items[].value :number

The value of the tag which will be used to scale its font-size within the tag cloud.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.
Example
 See the items attribute for usage examples.

layout :string

The layout to use for tag display.
Supported Values:
Name Type
"cloud" string
"rectangular" string
Default Value:
  • "rectangular"
Names
Item Name
Property layout
Property change event layoutChanged
Property change listener attribute (must be of type function) on-layout-changed
Examples

Initialize the tag cloud with the layout attribute specified:

<oj-tag-cloud layout='cloud'></oj-tag-cloud>

Get or set the layout property after initialization:

// getter
var value = myTagCloud.layout;

// setter
myTagCloud.layout="cloud";

selection :Array.<string>

An array of id strings, used to define the selected data items.
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
Examples

Initialize the tag cloud with the selection attribute specified:

<oj-tag-cloud selection='["area1", "area2", "marker7"]'></oj-tag-cloud>

Get or set the selection property after initialization:

// Get one
var value = myTagCloud.selection[0];

// Get all
var values = myTagCloud.selection;

// Set all (There is no permissible "set one" syntax.)
myTagCloud.selection=["tag2", "tag3", "tag12"];

selection-mode :string

The type of selection behavior that is enabled on the tag cloud.
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
Examples

Initialize the tag cloud with the selection-mode attribute specified:

<oj-tag-cloud selection-mode='multiple'></oj-tag-cloud>

Get or set the selectionMode property after initialization:

// getter
var value = myTagCloud.selectionMode;

// setter
myTagCloud.selectionMode="multiple";

style-defaults :object

An object defining the default styles for the tag cloud. Properties specified on this object may be overridden by specifications on the data item.
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
Examples

Initialize the tag cloud with the style-defaults attribute specified:


<oj-tag-cloud style-defaults.animation-duration='200'></oj-tag-cloud>


<oj-tag-cloud style-defaults='{"animationDuration": 200, "svgStyle": {}'></oj-tag-cloud>

Get or set the styleDefaults property after initialization:

// Get one
var value = myTagCloud.styleDefaults.animationDuration;

// Get all
var values = myTagCloud.styleDefaults;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myTagCloud.setProperty('styleDefaults.svgStyle', {'fill': 'url("someURL#filterId")'});

// Set all. Must list every resource key, as those not listed are lost.
myTagCloud.styleDefaults={'fill': 'url("someURL#filterId")'};

style-defaults.animation-duration :number

The duration of the animations in milliseconds.
Default Value:
  • null
Names
Item Name
Property styleDefaults.animationDuration
Example
 See the styleDefaults attribute for usage examples.

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
Example
 See the styleDefaults attribute for usage examples.

style-defaults.svg-style :object

The CSS style object defining the style of the items.
Default Value:
  • null
Names
Item Name
Property styleDefaults.svgStyle
Example
 See the styleDefaults attribute for usage examples.

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
Examples

Initialize the tag cloud with the tooltip attribute specified:


<oj-tag-cloud tooltip.renderer='[[tooltipFun]]'></oj-tag-cloud>

<oj-tag-cloud tooltip='[[{"renderer": tooltipFun}]]'></oj-tag-cloud>

Get or set the tooltip property after initialization:

// Get one
var value = myTagCloud.tooltip.renderer;

// Get all
var values = myTagCloud.tooltip;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myTagCloud.setProperty('tooltip.renderer', tooltipFun);

// Set all. Must list every resource key, as those not listed are lost.
myTagCloud.tooltip={'renderer': tooltipFun};

tooltip.renderer :function(object)

A function that returns a custom tooltip. The function takes a dataContext argument, provided by the tag cloud, with the following properties:
  • color: The color of the hovered item.
  • componentElement: The tag cloud element.
  • id: The id of the hovered item.
  • label: The data label of the hovered item.
  • parentElement: The tooltip element. The function can directly modify or append content to this element.
  • value: The value of the hovered item.
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
Example
 See the tooltip attribute for usage examples.

touch-response :string

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

Initialize the tag cloud with the layout attribute specified:

<oj-tag-cloud touch-response='touchStart'></oj-tag-cloud>

Get or set the touchResponse property after initialization:

// getter
var value = myTagCloud.touchResponse;

// setter
myTagCloud.touchResponse="touchStart";

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:
  • "Tag Cloud"
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

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

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-tagcloud-item

Context for tag cloud items at a specified index.

Properties:
Name Type
index number

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);

getItem(index) → {Object}

Returns an object with the following properties for automation testing verification of the item at the specified index.
Parameters:
Name Type Description
index number The index.
Properties:
Name Type
color string
label string
selected boolean
tooltip string
value number
Returns:
An object containing data for the node at the given index, or null if none exists.
Type
Object

getItemCount() → {number}

Returns the number of items in the tag cloud data.
Returns:
The number of data items
Type
number

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");