getTreeSize(nodes, index) {
    let min_x = 1e9;
    let max_x = -1e9;
    let min_y = 1e9;
    let max_y = -1e9;

    for (const nodeId in this.trees) {
      if (Object.prototype.hasOwnProperty.call(this.trees, nodeId)) {
        if (this.trees[nodeId] === index) {
          const node = nodes[nodeId];
          min_x = Math.min(node.x, min_x);
          max_x = Math.max(node.x, max_x);
          min_y = Math.min(node.y, min_y);
          max_y = Math.max(node.y, max_y);
        }
      }
    }

    return {
      min_x: min_x,
      max_x: max_x,
      min_y: min_y,
      max_y: max_y,
    };
  }
Get the min and max xy-coordinates of a given tree
@param {Array.<Node>} nodes
@param {number} index
@returns {{min_x: number, max_x: number, min_y: number, max_y: number}}