1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports["default"] = void 0;
|
7 | var _default = {
|
8 | getPosition: function getPosition(value, min, max) {
|
9 | var minv = Math.log(min);
|
10 | var maxv = Math.log(max);
|
11 | var scale = (maxv - minv) / 100;
|
12 | return (Math.log(value) - minv) / scale;
|
13 | },
|
14 | getValue: function getValue(positionPercent, min, max) {
|
15 | var minv = Math.log(min);
|
16 | var maxv = Math.log(max);
|
17 |
|
18 | if (positionPercent === 0) {
|
19 | return min;
|
20 | }
|
21 |
|
22 | if (positionPercent === 100) {
|
23 | return max;
|
24 | }
|
25 |
|
26 |
|
27 | var scale = (maxv - minv) / 100;
|
28 | return Math.floor(Math.exp(minv + scale * positionPercent)) || 0;
|
29 | }
|
30 | };
|
31 | exports["default"] = _default; |
\ | No newline at end of file |