import { PIXEL_OUTPUT_MAX, PIXEL_OUTPUT_MIN } from '../constants';
export default function scaleDots(input, inputMax) {
  // Define the minimum and maximum values for input and output
  const inputMin = 1;
  const outputMax = PIXEL_OUTPUT_MAX; // 2.5rem
  const outputMin = PIXEL_OUTPUT_MIN; // 1rem

  // Ensure the input is within the specified range
  const clampedInput = Math.min(Math.max(input, inputMin), inputMax);

  // Perform linear scaling
  const scaledOutput = outputMax + (clampedInput - inputMin) * (outputMin - outputMax) / (inputMax - inputMin);

  // Round the output value
  const roundedOutput = Math.round(scaledOutput);
  return roundedOutput;
}