ensureLevel(nodeId) {
    if (this.levels[nodeId] === undefined) {
      this.levels[nodeId] = 0;
    }
  }
Ensure level for given id is defined.

Sets level to zero for given node id if not already present
@param {Node.id} nodeId