code: function getRootId(node) {
      var ancestor = node;
      while (ancestor.depth > 1) {
          ancestor = ancestor.parentNode;
      }
  
      var virtualRoot = node.getAncestors()[0];
      return zrUtil.indexOf(virtualRoot.children, ancestor);
  }
docs: Get index of root in sorted order
  
  @param {TreeNode} node current node
  @return {number} index in root