isValidFilterVals = (filterVals, segmentationFeatureMeta) => {
  // only support 2 sements
  const [val0, val1] = filterVals;
  if (!val0 || !val1) {
    return false;
  }
  const {type: featureType, domain} = segmentationFeatureMeta;

  if (featureType === FEATURE_TYPE.CATEGORICAL) {
    return (
      // only support one category value per filter
      val0.length === 1 &&
      val1.length === 1 &&
      domain.includes(val0[0]) &&
      domain.includes(val1[0]) &&
      // only support non-overlaping segments
      val0[0] !== val1[0]
    );
  }
  if (featureType === FEATURE_TYPE.NUMERICAL) {
    const min = domain[0];
    const max = domain[domain.length - 1];
    return (
      // each filter value follows [min, max]
      val0.length === 2 &&
      val1.length === 2 &&
      val0[0] <= val0[1] &&
      val1[0] <= val1[1] &&
      // filter values are within the range of `domain`
      min <= val0[0] &&
      min <= val1[0] &&
      max >= val0[1] &&
      max >= val1[1] &&
      // only support non-overlaping segments
      (val0[1] <= val1[0] || val1[1] <= val0[0])
    );
  }
}
determin whether segment filters values are valid
@param  {array} filterVals `value` field of each segmentFilter
@param  {object} segmentationFeatureMeta feature to segment on, attributes: {name, type, tableFieldIndex, domain}]
@return {boolean}