TagCloudItem.TargetPosition

Syntax

TargetPosition: Object

Description

The TargetPosition property determines target position of tag cloud item.

Comments

Target position is an item position on the next animation step.

The object contains following fields:

Use JSON or the setTargetPosition method to set the property value and the getTargetPosition method to get the property value.

Example

To execute the example, the page must contain the TagCloud component named tagCloud (see Example of Creating the TagCloud Component). The example must be placed in the <script> tag. Get target position and target color of the first cloud tag:

// Get color target value of the first tag
var targetColor = tagCloud.getItems()[0].getTargetColor();
console.log("Color target color of the first tag: R = " + targetColor.R + ", G = " + targetColor.G + ", B = " + targetColor.B);
// Get target coordinates of the first tag
var targetXYZ = tagCloud.getItems()[0].getTargetPosition().Position;
console.log("Target coordinate X: " + targetXYZ.getX());
console.log("Target coordinate Y: " + targetXYZ.getY());
console.log("Target coordinate Z: " + targetXYZ.getZ());

As a result the console displays target coordinates of position and target color of the cloud first tag:

Color target value of the active tag:  R = 255, G = 70, B = 44

Target coordinate X: 150

Target coordinate Y: -112.5

Target coordinate Z: 0

See also:

TagCloudItem