add `getDepth` method for category nodes