function range (name, value) {
      const set = value !== undefined
      if (!set) {
        if (isNullish(name)) name = 'all'
        switch (name.toLowerCase()) {
          case 'minx': return minX
          case 'maxx': return maxX
          case 'rangex': return { minX, maxX, rangeX }
          case 'miny': return minY
          case 'maxy': return maxY
          case 'rangey': return { minY, maxY, rangeY }
          case 'all':
          default: return { minX, maxX, rangeX, minY, maxY, rangeY }
        }
      }
      let // changed = false,
        newMinX
      let newMaxX
      let newMinY
      let newMaxY
      if (isNullish(name)) name = 'all'
      switch (name.toLowerCase()) {
        case 'minx':
          newMinX = (value && ((value.minX && value.minX | 0) || value | 0)) || 0
          break
        case 'maxx':
          newMaxX = (value && ((value.maxX && value.maxX | 0) || value | 0)) || 0
          break
        case 'rangex':
          newMinX = (value && value.minX && value.minX | 0) || 0
          newMaxX = (value && value.maxX && value.maxX | 0) || 0
          break
        case 'miny':
          newMinY = (value && ((value.minY && value.minY | 0) || value | 0)) || 0
          break
        case 'maxy':
          newMaxY = (value && ((value.maxY && value.maxY | 0) || value | 0)) || 0
          break
        case 'rangey':
          newMinY = (value && value.minY && value.minY | 0) || 0
          newMaxY = (value && value.maxY && value.maxY | 0) || 0
          break
        case 'all':
        default:
          newMinX = (value && value.minX && value.minX | 0) || 0
          newMaxX = (value && value.maxX && value.maxX | 0) || 0
          newMinY = (value && value.minY && value.minY | 0) || 0
          newMaxY = (value && value.maxY && value.maxY | 0) || 0
          break
      }

      if (!isNullish(newMinX) && minX !== newMinX) {
        minX = newMinX
        rangeX = maxX - minX
      }
      if (!isNullish(newMaxX) && maxX !== newMaxX) {
        maxX = newMaxX
        rangeX = maxX - minX
      }
      if (!isNullish(newMinY) && minY !== newMinY) {
        minY = newMinY
        rangeY = maxY - minY
      }
      if (!isNullish(newMaxY) && maxY !== newMaxY) {
        maxY = newMaxY
        rangeY = maxY - minY
      }
      return undefined
    }
@param {"minx"|"maxx"|"rangex"|"miny"|"maxy"|"rangey"|"all"} name
@param {module:jPicker.MinMaxRangeXY} value
@returns {module:jPicker.MinMaxRangeXY|module:jPicker.MinMaxRangeX|module:jPicker.MinMaxRangeY|void}