Skip to content Skip to sidebar Skip to footer

Autodesk Forge Rgraph Extension Not Working Properly

I have an Autodesk Forge extension(RGraph). I have followed the the steps as mentioned in http://adndevblog.typepad.com/cloud_and_mobile/2016/02/rgraph-chart-library-and-view-d

Solution 1:

This code sample is outdated and using unsupported features, see more here.

You can replace the getAllLeafComponents method with:

functiongetAllLeafComponents(callback) {
    var cbCount = 0; // count pending callbacksvar components = []; // store the resultsvar tree; // the instance treefunctiongetLeafComponentsRec(parent) {
        cbCount++;
        if (tree.getChildCount(parent) != 0) {
            tree.enumNodeChildren(parent, function (children) {
                getLeafComponentsRec(children);
            }, false);
        } else {
            components.push(parent);
        }
        if (--cbCount == 0) callback(components);
    }
    viewer.getObjectTree(function (objectTree) {
        tree = objectTree;
        var allLeafComponents = getLeafComponentsRec(tree.getRootId());
    });
}

Post a Comment for "Autodesk Forge Rgraph Extension Not Working Properly"