_getSpaceAroundNode(node, map) {
    let useMap = true;
    if (map === undefined) {
      useMap = false;
    }
    const level = this.hierarchical.levels[node.id];
    if (level !== undefined) {
      const index = this.hierarchical.distributionIndex[node.id];
      const position = this.direction.getPosition(node);
      const ordering = this.hierarchical.distributionOrdering[level];
      let minSpace = 1e9;
      let maxSpace = 1e9;
      if (index !== 0) {
        const prevNode = ordering[index - 1];
        if (
          (useMap === true && map[prevNode.id] === undefined) ||
          useMap === false
        ) {
          const prevPos = this.direction.getPosition(prevNode);
          minSpace = position - prevPos;
        }
      }

      if (index != ordering.length - 1) {
        const nextNode = ordering[index + 1];
        if (
          (useMap === true && map[nextNode.id] === undefined) ||
          useMap === false
        ) {
          const nextPos = this.direction.getPosition(nextNode);
          maxSpace = Math.min(maxSpace, nextPos - position);
        }
      }

      return [minSpace, maxSpace];
    } else {
      return [0, 0];
    }
  }
This gives the space around the node. IF a map is supplied, it will only check against nodes NOT in the map.
This is used to only get the distances to nodes outside of a branch.
@param {Node} node
@param {{Node.id: vis.Node}} map
@returns {number[]}
@private