karthik
karthik

Reputation: 765

Infovis JIT library

I am using the "JavaScript Infovis" toolkit, the "SpaceTree control" suits the needs of data visualisation.

I am using "jQuery" to Call "Ajax" to load the data into the tree dynamically. The tree is loading well. However, when I click on any of the nodes I get the following error message:

Canvas is Undefined

I am calling this Javascript library from my aspx page:

$j(document).ready(function() {            
    var aURL = 'CompanyHierarchyList.ashx?CompanyID=<%=CompanyID %>';
    $j.ajax({
        url: aURL,
        cache: false,
        dataType: 'json',
        success: function(json) {
            LoadTree(json);
        }
    });
});


var st = new $jit.ST({
    //id of viz container element
    injectInto: 'infovis',
    //set duration for the animation
    duration: 200,
    //set animation transition type
    transition: $jit.Trans.Quart.easeInOut,
    //set distance between node and its children
    levelDistance: 50,
    //set Orientation
    orientation: 'top',

    //.....
    //set the other properties of node
    //.......

    st.loadJSON(json);
    //compute node positions and layout
    st.compute();
    //optional: make a translation of the tree
    st.geom.translate(new $jit.Complex(-200, 0), "current");
    //emulate a click on the root node.
    st.onClick(st.root);
    //end
}

any clues..

Thanks, Karthik

Upvotes: 1

Views: 2984

Answers (1)

Jijith
Jijith

Reputation: 11

This is reported in https://github.com/philogb/jit/issues/34. They has also provided an answer which seems to work.

Upvotes: 1

Related Questions