{"_id":"@babymotte/scales","name":"@babymotte/scales","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@babymotte/scales","version":"1.0.0","description":"Convert between different coordinate scale systems easily","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/babymotte/scales-js.git"},"author":{"name":"Michael Bachmann","email":"mbachmann@bbmsoft.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/babymotte/scales-js/issues"},"homepage":"https://github.com/babymotte/scales-js#readme","dependencies":{"typescript":"^5.5.3"},"gitHead":"3d35f88b4e3be01400dd9496a5a257cf6a789f11","_id":"@babymotte/scales@1.0.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-ex3Ou01eBfXeZCxc3lHtcxJUr61BezhqmDNiaFVh4x3HDd0sZnu7AZA/MWZrZglugNnrskblyOpwvG/I10hGAw==","shasum":"1943da27bfe6331e1717dfa624666053369fea05","tarball":"https://registry.npmjs.org/@babymotte/scales/-/scales-1.0.0.tgz","fileCount":7,"unpackedSize":19038,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHOa0u5G3zxem3CXyiRQeEyFo3yYFQIi/byBMrWTpHBKAiAGxUGLuuk7Pyc4OCPh9gNe9NEdzcdpMQSxR9C3eqeO+g=="}]},"_npmUser":{"name":"babymotte","email":"mbachmann@bbmsoft.net"},"directories":{},"maintainers":[{"name":"babymotte","email":"mbachmann@bbmsoft.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scales_1.0.0_1721373531795_0.10490414893410693"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-19T07:18:51.705Z","1.0.0":"2024-07-19T07:18:51.937Z","modified":"2024-07-19T07:18:52.196Z"},"maintainers":[{"name":"babymotte","email":"mbachmann@bbmsoft.net"}],"description":"Convert between different coordinate scale systems easily","homepage":"https://github.com/babymotte/scales-js#readme","repository":{"type":"git","url":"git+https://github.com/babymotte/scales-js.git"},"author":{"name":"Michael Bachmann","email":"mbachmann@bbmsoft.net"},"bugs":{"url":"https://github.com/babymotte/scales-js/issues"},"license":"Apache-2.0","readme":"# scales\n\nConvert between different scale types easily. This was developed specifically as a utility when building graphical user interfaces to make the conversion between UI scales and value scales easier, but it can be used pretty much everywhere.\n\nHere's how you convert between a linear scale from 0 to 100 and a logarithmic scale from -1000 to -1:\n\n```JavaScript\nimport { linearScale, logarithmicScale } from \"@babymotte/scales\";\nconst linear = linearScale(0, 100);\nconst logarithmic = logarithmicScale(-1000, -1);\nconst toLog = (val: number) => linear.convertTo(logarithmic, val);\nconst fromLog = (val: number) => logarithmic.convertTo(linear, val);\n```","readmeFilename":"README.md"}