Infovis JIT 库

发布于 2024-11-26 08:41:30 字数 1228 浏览 1 评论 0原文

我正在使用“JavaScript Infovis”工具包,“SpaceTree控件”适合需要 的数据可视化。

我使用“jQuery”调用“Ajax”将数据动态加载到树中。 该树加载良好。但是,当我单击任何节点时,我收到以下错误消息:

画布未定义

我从我的 aspx 页面调用这个 Javascript 库:

$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
}

任何线索..

谢谢, 卡蒂克

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

平定天下 2024-12-03 08:41:30

https://github.com/philogb/jit/issues/34 中报告了这一点。
他们还提供了一个似乎有效的答案。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文