@reekon-tools/boldr-utils 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,3 +10,11 @@ BOLDR Utils is a collection of types and utility functions written to be used ac
10
10
  - Be consumable in Remix (Node/ESM, often using Vite or Webpack)
11
11
  - Be written in TypeScript
12
12
  - Be published cleanly to npm
13
+
14
+ ## Publishing
15
+
16
+ To publish the package to NPM, be sure to build it. Then, run
17
+
18
+ ```
19
+ npm publish --access public
20
+ ```
@@ -25,7 +25,7 @@ export function getToleranceColor(actualValue, target, min, max, toleranceConfig
25
25
  }
26
26
  // Calculate deviation percentage
27
27
  const deviation = Math.abs(actualValue - target);
28
- const toleranceRange = max - min;
28
+ const toleranceRange = max + min; // Fixed: total tolerance range
29
29
  const deviationPercentage = toleranceRange > 0 ? (deviation / toleranceRange) * 100 : 0;
30
30
  // Sort thresholds by percentage to ensure correct evaluation order
31
31
  const sortedThresholds = toleranceConfig.thresholds.sort((a, b) => a.percentage - b.percentage);
@@ -53,7 +53,7 @@ export function getToleranceColor(actualValue, target, min, max, toleranceConfig
53
53
  */
54
54
  export function calculateDeviationPercentage(actualValue, target, min, max) {
55
55
  const deviation = Math.abs(actualValue - target);
56
- const toleranceRange = max - min;
56
+ const toleranceRange = max + min; // Fixed: total tolerance range
57
57
  return toleranceRange > 0 ? (deviation / toleranceRange) * 100 : 0;
58
58
  }
59
59
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reekon-tools/boldr-utils",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Shared utilities for formulas and measurement conversion used in Reekon apps",
5
5
  "author": "REEKON Tools",
6
6
  "license": "MIT",