UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 708 B
{"version":3,"file":"linear-scale.cjs","names":[],"sources":["../../../../src/components/ScrollArea/utils/linear-scale.ts"],"sourcesContent":["export function linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) {\n return output[0];\n }\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n"],"mappings":";;AAAA,SAAgB,YAAY,OAAkC,QAAmC;AAC/F,SAAQ,UAAkB;AACxB,MAAI,MAAM,OAAO,MAAM,MAAM,OAAO,OAAO,OAAO,GAChD,QAAO,OAAO;EAEhB,MAAM,SAAS,OAAO,KAAK,OAAO,OAAO,MAAM,KAAK,MAAM;AAC1D,SAAO,OAAO,KAAK,SAAS,QAAQ,MAAM"}