qesuite 1.0.30 → 1.0.32
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/dist/index.js +13 -6
- package/dist/index.mjs +13 -6
- package/index.ts +17 -7
- package/package.json +1 -1
- package/versions/1_0_31.md +4 -0
- package/versions/1_0_32.md +5 -0
package/dist/index.js
CHANGED
|
@@ -146,12 +146,18 @@ var Specification = class {
|
|
|
146
146
|
tol_minus = Number(tol);
|
|
147
147
|
}
|
|
148
148
|
if (string.indexOf("+") !== -1) {
|
|
149
|
-
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1))[0]);
|
|
150
|
-
nominal = Number(this.SplitUnits(string)[0]);
|
|
149
|
+
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1, string.indexOf("/") > 0 ? string.indexOf("/") : string.indexOf("-") > 0 ? string.indexOf("-") : void 0))[0]);
|
|
150
|
+
nominal = Number(this.SplitUnits(string)[0].substring(0, string.indexOf("+")));
|
|
151
|
+
if (string.indexOf("-") === -1) {
|
|
152
|
+
tol_minus = 0;
|
|
153
|
+
}
|
|
151
154
|
}
|
|
152
155
|
if (string.indexOf("-") !== -1) {
|
|
153
|
-
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
|
|
154
|
-
|
|
156
|
+
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("/") > 0 ? Math.max(string.indexOf("/"), string.indexOf("-")) + 1 : string.indexOf("-") + 1))[0]);
|
|
157
|
+
if (string.indexOf("+") === -1) {
|
|
158
|
+
tol_plus = 0;
|
|
159
|
+
nominal = Number(this.SplitUnits(string.substring(0, string.indexOf("/") > 0 ? Math.min(string.indexOf("/"), string.indexOf("-")) : string.indexOf("-")))[0]);
|
|
160
|
+
}
|
|
155
161
|
}
|
|
156
162
|
if (string.indexOf("+-") !== -1 || string.indexOf("+/-") !== -1) {
|
|
157
163
|
nominal = Number(string.substring(0, string.indexOf("+")));
|
|
@@ -169,12 +175,14 @@ var Specification = class {
|
|
|
169
175
|
tol_plus = Number(tol);
|
|
170
176
|
tol_minus = Number(tol);
|
|
171
177
|
}
|
|
172
|
-
if (nominal && tol_plus && tol_minus) {
|
|
178
|
+
if (!Number.isNaN(nominal) && !Number.isNaN(tol_plus) && !Number.isNaN(tol_minus)) {
|
|
173
179
|
USL = nominal + tol_plus;
|
|
174
180
|
let digits = String(tol_plus).split(".");
|
|
181
|
+
digits[1] = digits[1] ?? "0";
|
|
175
182
|
USL = Number(USL).toFixed(digits[1].length);
|
|
176
183
|
LSL = nominal - tol_minus;
|
|
177
184
|
digits = String(tol_minus).split(".");
|
|
185
|
+
digits[1] = digits[1] ?? "0";
|
|
178
186
|
LSL = Number(LSL).toFixed(digits[1].length);
|
|
179
187
|
}
|
|
180
188
|
if (tol) {
|
|
@@ -600,7 +608,6 @@ var Capability = {
|
|
|
600
608
|
let lastObservations = LastObservationsChart(data, 25, "Last 25 Observations");
|
|
601
609
|
let capabilityHistogram = CreateCapabilityHistogram(data, spec);
|
|
602
610
|
let capabilityPlot = CreateCapabilityPlot(data, spec);
|
|
603
|
-
console.log(Capability.Analysis(data, spec));
|
|
604
611
|
return {
|
|
605
612
|
charts: {
|
|
606
613
|
IndividualValue: individualValuePlot,
|
package/dist/index.mjs
CHANGED
|
@@ -59,12 +59,18 @@ var Specification = class {
|
|
|
59
59
|
tol_minus = Number(tol);
|
|
60
60
|
}
|
|
61
61
|
if (string.indexOf("+") !== -1) {
|
|
62
|
-
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1))[0]);
|
|
63
|
-
nominal = Number(this.SplitUnits(string)[0]);
|
|
62
|
+
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1, string.indexOf("/") > 0 ? string.indexOf("/") : string.indexOf("-") > 0 ? string.indexOf("-") : void 0))[0]);
|
|
63
|
+
nominal = Number(this.SplitUnits(string)[0].substring(0, string.indexOf("+")));
|
|
64
|
+
if (string.indexOf("-") === -1) {
|
|
65
|
+
tol_minus = 0;
|
|
66
|
+
}
|
|
64
67
|
}
|
|
65
68
|
if (string.indexOf("-") !== -1) {
|
|
66
|
-
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
|
|
67
|
-
|
|
69
|
+
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("/") > 0 ? Math.max(string.indexOf("/"), string.indexOf("-")) + 1 : string.indexOf("-") + 1))[0]);
|
|
70
|
+
if (string.indexOf("+") === -1) {
|
|
71
|
+
tol_plus = 0;
|
|
72
|
+
nominal = Number(this.SplitUnits(string.substring(0, string.indexOf("/") > 0 ? Math.min(string.indexOf("/"), string.indexOf("-")) : string.indexOf("-")))[0]);
|
|
73
|
+
}
|
|
68
74
|
}
|
|
69
75
|
if (string.indexOf("+-") !== -1 || string.indexOf("+/-") !== -1) {
|
|
70
76
|
nominal = Number(string.substring(0, string.indexOf("+")));
|
|
@@ -82,12 +88,14 @@ var Specification = class {
|
|
|
82
88
|
tol_plus = Number(tol);
|
|
83
89
|
tol_minus = Number(tol);
|
|
84
90
|
}
|
|
85
|
-
if (nominal && tol_plus && tol_minus) {
|
|
91
|
+
if (!Number.isNaN(nominal) && !Number.isNaN(tol_plus) && !Number.isNaN(tol_minus)) {
|
|
86
92
|
USL = nominal + tol_plus;
|
|
87
93
|
let digits = String(tol_plus).split(".");
|
|
94
|
+
digits[1] = digits[1] ?? "0";
|
|
88
95
|
USL = Number(USL).toFixed(digits[1].length);
|
|
89
96
|
LSL = nominal - tol_minus;
|
|
90
97
|
digits = String(tol_minus).split(".");
|
|
98
|
+
digits[1] = digits[1] ?? "0";
|
|
91
99
|
LSL = Number(LSL).toFixed(digits[1].length);
|
|
92
100
|
}
|
|
93
101
|
if (tol) {
|
|
@@ -513,7 +521,6 @@ var Capability = {
|
|
|
513
521
|
let lastObservations = LastObservationsChart(data, 25, "Last 25 Observations");
|
|
514
522
|
let capabilityHistogram = CreateCapabilityHistogram(data, spec);
|
|
515
523
|
let capabilityPlot = CreateCapabilityPlot(data, spec);
|
|
516
|
-
console.log(Capability.Analysis(data, spec));
|
|
517
524
|
return {
|
|
518
525
|
charts: {
|
|
519
526
|
IndividualValue: individualValuePlot,
|
package/index.ts
CHANGED
|
@@ -69,12 +69,18 @@ export class Specification{
|
|
|
69
69
|
tol_minus = Number(tol);
|
|
70
70
|
}
|
|
71
71
|
if (string.indexOf("+") !== -1) {
|
|
72
|
-
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1))[0]);
|
|
73
|
-
nominal = Number(this.SplitUnits(string)[0]);
|
|
72
|
+
tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1, string.indexOf("/") > 0 ? string.indexOf("/") : string.indexOf("-") > 0 ? string.indexOf("-") : undefined))[0]);
|
|
73
|
+
nominal = Number(this.SplitUnits(string)[0].substring(0, string.indexOf("+")));
|
|
74
|
+
if(string.indexOf("-") === -1){
|
|
75
|
+
tol_minus = 0;
|
|
76
|
+
}
|
|
74
77
|
}
|
|
75
78
|
if (string.indexOf("-") !== -1) {
|
|
76
|
-
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
|
|
77
|
-
|
|
79
|
+
tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("/") > 0 ? Math.max(string.indexOf("/"), string.indexOf("-")) + 1 : string.indexOf("-") + 1))[0]);
|
|
80
|
+
if(string.indexOf("+") === -1){
|
|
81
|
+
tol_plus = 0;
|
|
82
|
+
nominal = Number(this.SplitUnits(string.substring(0, string.indexOf("/") > 0 ? Math.min(string.indexOf("/"), string.indexOf("-")) : string.indexOf("-")))[0])
|
|
83
|
+
}
|
|
78
84
|
}
|
|
79
85
|
if (string.indexOf("+-") !== -1 || string.indexOf("+/-") !== -1) {
|
|
80
86
|
nominal = Number(string.substring(0, string.indexOf("+")));
|
|
@@ -93,17 +99,20 @@ export class Specification{
|
|
|
93
99
|
tol_minus = Number(tol);
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
if(nominal && tol_plus && tol_minus){
|
|
102
|
+
if(!Number.isNaN(nominal) && !Number.isNaN(tol_plus) && !Number.isNaN(tol_minus)){
|
|
97
103
|
USL = nominal + tol_plus;
|
|
104
|
+
|
|
98
105
|
// Round USL
|
|
99
106
|
let digits = String(tol_plus).split(".");
|
|
100
|
-
|
|
107
|
+
digits[1] = digits[1] ?? "0";
|
|
108
|
+
|
|
101
109
|
USL = Number(USL).toFixed(digits[1].length);
|
|
102
110
|
|
|
103
111
|
|
|
104
112
|
LSL = nominal - tol_minus;
|
|
105
113
|
// Round LSL
|
|
106
114
|
digits = String(tol_minus).split(".");
|
|
115
|
+
digits[1] = digits[1] ?? "0";
|
|
107
116
|
|
|
108
117
|
LSL = Number(LSL).toFixed(digits[1].length);
|
|
109
118
|
}
|
|
@@ -153,6 +162,7 @@ export class Specification{
|
|
|
153
162
|
}
|
|
154
163
|
|
|
155
164
|
|
|
165
|
+
|
|
156
166
|
export class ChartSettings{
|
|
157
167
|
constructor(xAxis?: AxisSettings, yAxis?: AxisSettings, width?: number, height?: number, margins?: Margin, chartArea?: CanvasDrawSettings, plotArea?: CanvasDrawSettings, title?: EngFont, hasLegend?: boolean, type?: string){
|
|
158
168
|
this.width = width || 1250;
|
|
@@ -590,7 +600,7 @@ export const Capability = {
|
|
|
590
600
|
let lastObservations = LastObservationsChart(data, 25, 'Last 25 Observations');
|
|
591
601
|
let capabilityHistogram = CreateCapabilityHistogram(data, spec);
|
|
592
602
|
let capabilityPlot = CreateCapabilityPlot(data, spec);
|
|
593
|
-
|
|
603
|
+
|
|
594
604
|
return {
|
|
595
605
|
charts: {
|
|
596
606
|
IndividualValue: individualValuePlot,
|
package/package.json
CHANGED