constrain(pile) {
    // NOTE: constrainWidth and  constrainHeight never set!
    // NOTE: for edge labels, only 'maxWdt' set
    // Node labels can set all the fields
    const fontOptions = {
      constrainWidth: false,
      maxWdt: -1,
      minWdt: -1,
      constrainHeight: false,
      minHgt: -1,
      valign: "middle",
    };

    const widthConstraint = topMost(pile, "widthConstraint");
    if (typeof widthConstraint === "number") {
      fontOptions.maxWdt = Number(widthConstraint);
      fontOptions.minWdt = Number(widthConstraint);
    } else if (typeof widthConstraint === "object") {
      const widthConstraintMaximum = topMost(pile, [
        "widthConstraint",
        "maximum",
      ]);
      if (typeof widthConstraintMaximum === "number") {
        fontOptions.maxWdt = Number(widthConstraintMaximum);
      }
      const widthConstraintMinimum = topMost(pile, [
        "widthConstraint",
        "minimum",
      ]);
      if (typeof widthConstraintMinimum === "number") {
        fontOptions.minWdt = Number(widthConstraintMinimum);
      }
    }

    const heightConstraint = topMost(pile, "heightConstraint");
    if (typeof heightConstraint === "number") {
      fontOptions.minHgt = Number(heightConstraint);
    } else if (typeof heightConstraint === "object") {
      const heightConstraintMinimum = topMost(pile, [
        "heightConstraint",
        "minimum",
      ]);
      if (typeof heightConstraintMinimum === "number") {
        fontOptions.minHgt = Number(heightConstraintMinimum);
      }
      const heightConstraintValign = topMost(pile, [
        "heightConstraint",
        "valign",
      ]);
      if (typeof heightConstraintValign === "string") {
        if (
          heightConstraintValign === "top" ||
          heightConstraintValign === "bottom"
        ) {
          fontOptions.valign = heightConstraintValign;
        }
      }
    }

    return fontOptions;
  }
Set the width and height constraints based on 'nearest' value
@param {Array} pile array of option objects to consider
@returns {object} the actual constraint values to use
@private