TreeDataVisualizer.getAnimationDuration

Syntax

getAnimationDuration();

Description

The getAnimationDuration method returns chart animation duration.

Comments

This method returns a Numer value.

Example

To execute the example the HTML page must contain the TreeMap component named «treeMap» (see «Example of Creating the TreeMap component» ). Process the following events: ActiveItemChanged, ItemClick, Refreshed. Get chart animation duration, show sizes of breadcrumb chain item, show sizes of the current chart instance, show sizes of draw item, show number of children for the container that stores the chart, and refresh the chart view:

// Process the ActiveItemChanged event
treeMap.ActiveItemChanged.add(function (sender, args, timeout) {
        console.log("The ActiveItemChanged event is initialized")
    });
// Process the ItemClick event
treeMap.ItemClick.add(function (sender, args, timeout) {
        console.log("The ItemClick event is initialized")
    });
// Process the Refreshed event
treeMap.Refreshed.add(function (sender, args, timeout) {
        console.log("The Refreshed event is initialized")
    });
// Show chart animation duration
console.log("Animation duration: " + treeMap.getAnimationDuration())
// Get the breadcrumb by chart element levels
var breadcrumb = treeMap.getBreadcrumb();
// Show sizes of the breadcrumb element
console.log("Breadcrumb sizes: " + breadcrumb.getWidth() + "x" + breadcrumb.getHeight());
// Get current chart instance
var instance = treeMap.getInstance();
// Show sizes of the current chart instance
console.log("Current chart instance sizes: " + instance.getWidth() + "x" + instance.getHeight());
// Get  SVG-element where the chart is drawn
var paperNode = treeMap.getPaperNode();
// Show sizes of draw item
console.log("Draw item sizes: " + paperNode.clientWidth + "x" + paperNode.clientHeight);
// Get <DIV> container where chart is
var rootNode = treeMap.getRootNode();
// Show number of children for the container
console.log("Number of children for the container that stores the chart: " + rootNode.childElementCount);
// Refresh the chart view
treeMap.refreshView();

After executing the example the browser consol shows animation duration, size of breadcrumb chain, sizes of the current chart instance, draw item size, number of children for the container storing the chart, and a message informing that the Refreshed event is fired:

Animation duration: 5000

Breadcrumb chain size: 640x24

Size of the current chart instance: 640x480

Draw item sizes: 640x349

Number of children for the container that stores the chart: 12

Refreshed event initialized

Click any chart branch element.

As the result the browser console shows messages, that the ActiveItemChanged and ItemClick events are fired:

ItemClick event initialized

ActiveItemChanged event initialized

See also:

TreeDataVisualizer