dist/claygl.es.js
function (path) {
        if (!path) {
            return;
        }
        // TODO Name have slash ?
        var pathArr = path.split('/');
        var current = this;
        for (var i = 0; i < pathArr.length; i++) {
            var name = pathArr[i];
            // Skip empty
            if (!name) {
                continue;
            }
            var found = false;
            var children = current._children;
            for (var j = 0; j < children.length; j++) {
                var child = children[j];
                if (child.name === name) {
                    current = child;
                    found = true;
                    break;
                }
            }
            // Early return if not found
            if (!found) {
                return;
            }
        }

        return current;
    }
function (path) {
        if (!path) {
            return;
        }
        // TODO Name have slash ?
        var pathArr = path.split('/');
        var current = this;
        for (var i = 0; i < pathArr.length; i++) {
            var name = pathArr[i];
            // Skip empty
            if (!name) {
                continue;
            }
            var found = false;
            var children = current._children;
            for (var j = 0; j < children.length; j++) {
                var child = children[j];
                if (child.name === name) {
                    current = child;
                    found = true;
                    break;
                }
            }
            // Early return if not found
            if (!found) {
                return;
            }
        }

        return current;
    }
function ( path ) { if ( ! path ) { return ; } // TODO Name have slash ? var pathArr = path . split ( '/' ) ; var current = this ; for ( var i = 0 ; i < pathArr . length ; i ++ ) { var name = pathArr [ i ] ; // Skip empty if ( ! name ) { continue ; } var found = false ; var children = current . _children ; for ( var j = 0 ; j < children . length ; j ++ ) { var child = children [ j ] ; if ( child . name === name ) { current = child ; found = true ; break ; } } // Early return if not found if ( ! found ) { return ; } } return current ; }
Query descendant node by path
@param {string} path
@return {clay.Node}
@example
node.queryNode('root/parent/child');
Query descendant node by path