qesuite 1.0.23 → 1.0.25

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.d.mts CHANGED
@@ -1,29 +1,30 @@
1
1
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2
2
  */
3
3
  declare class Specification {
4
- constructor(spec: any, USL?: number, LSL?: number, tolerance?: number, tolplus?: number, tolminus?: number, units?: string);
4
+ constructor(spec: any, USL?: number, LSL?: number, tolerance?: number, tol_plus?: number, tol_minus?: number, units?: string);
5
5
  nominal: number;
6
6
  USL: number;
7
7
  LSL: number;
8
8
  units: string;
9
9
  tolerance: number;
10
- tolplus: number;
11
- tolminus: number;
10
+ tol_plus: number;
11
+ tol_minus: number;
12
+ full_tolerance: number;
12
13
  ParseSpec(spec: string): {
13
14
  nominal: any;
14
15
  USL: any;
15
16
  LSL: any;
16
17
  units: any;
17
18
  tolerance: any;
18
- tolplus?: undefined;
19
- tolminus?: undefined;
19
+ tol_plus?: undefined;
20
+ tol_minus?: undefined;
20
21
  } | {
21
22
  nominal: any;
22
23
  USL: any;
23
24
  LSL: any;
24
25
  units: any;
25
- tolplus: any;
26
- tolminus: any;
26
+ tol_plus: any;
27
+ tol_minus: any;
27
28
  tolerance?: undefined;
28
29
  };
29
30
  SplitUnits(string: string): string[];
@@ -967,18 +968,24 @@ declare function AnovaTableTwoWay(data: GRRData, interaction: boolean): any;
967
968
  * @param tolerance The total tolerance spread = (USL - LSL)
968
969
  * @param referenceValue The value used to evaluate bias. Generally historical mean or mean from other measurement equipment.
969
970
  */
970
- declare function G1(data: any, tolerance: number, referenceValue?: number): {
971
+ declare function G1(data: any, tolerance: any, referenceValue?: number): {
971
972
  Cg: number;
972
973
  Cgk?: undefined;
974
+ SV?: undefined;
973
975
  bias?: undefined;
974
976
  t?: undefined;
975
977
  p?: undefined;
978
+ Var_Rpt?: undefined;
979
+ Var_RptBias?: undefined;
976
980
  } | {
977
981
  Cg: number;
978
982
  Cgk: number;
983
+ SV: number;
979
984
  bias: number;
980
985
  t: number;
981
986
  p: number;
987
+ Var_Rpt: number;
988
+ Var_RptBias: number;
982
989
  };
983
990
  /**
984
991
  * Evaluates gage reliability based on variance components and specified tolerance
@@ -1056,24 +1063,30 @@ declare function VarianceComponents(ANOVA: any, data: GRRData): {
1056
1063
  Contribution: number;
1057
1064
  };
1058
1065
  };
1059
- declare function G1Graphs(data: any, tolerance: number, referenceValue?: number): {
1066
+ declare function G1Graphs(data: any, tolerance: any, referenceValue: number, name?: string): {
1060
1067
  charts: {
1061
1068
  RunChart: HTMLCanvasElement;
1062
1069
  };
1063
1070
  Cg: number;
1064
1071
  Cgk?: undefined;
1072
+ SV?: undefined;
1065
1073
  bias?: undefined;
1066
1074
  t?: undefined;
1067
1075
  p?: undefined;
1076
+ Var_Rpt?: undefined;
1077
+ Var_RptBias?: undefined;
1068
1078
  } | {
1069
1079
  charts: {
1070
1080
  RunChart: HTMLCanvasElement;
1071
1081
  };
1072
1082
  Cg: number;
1073
1083
  Cgk: number;
1084
+ SV: number;
1074
1085
  bias: number;
1075
1086
  t: number;
1076
1087
  p: number;
1088
+ Var_Rpt: number;
1089
+ Var_RptBias: number;
1077
1090
  };
1078
1091
  declare function GRRGraphs(data: any, tolerance: number, name?: string): {
1079
1092
  GRR: {
package/dist/index.d.ts CHANGED
@@ -1,29 +1,30 @@
1
1
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2
2
  */
3
3
  declare class Specification {
4
- constructor(spec: any, USL?: number, LSL?: number, tolerance?: number, tolplus?: number, tolminus?: number, units?: string);
4
+ constructor(spec: any, USL?: number, LSL?: number, tolerance?: number, tol_plus?: number, tol_minus?: number, units?: string);
5
5
  nominal: number;
6
6
  USL: number;
7
7
  LSL: number;
8
8
  units: string;
9
9
  tolerance: number;
10
- tolplus: number;
11
- tolminus: number;
10
+ tol_plus: number;
11
+ tol_minus: number;
12
+ full_tolerance: number;
12
13
  ParseSpec(spec: string): {
13
14
  nominal: any;
14
15
  USL: any;
15
16
  LSL: any;
16
17
  units: any;
17
18
  tolerance: any;
18
- tolplus?: undefined;
19
- tolminus?: undefined;
19
+ tol_plus?: undefined;
20
+ tol_minus?: undefined;
20
21
  } | {
21
22
  nominal: any;
22
23
  USL: any;
23
24
  LSL: any;
24
25
  units: any;
25
- tolplus: any;
26
- tolminus: any;
26
+ tol_plus: any;
27
+ tol_minus: any;
27
28
  tolerance?: undefined;
28
29
  };
29
30
  SplitUnits(string: string): string[];
@@ -967,18 +968,24 @@ declare function AnovaTableTwoWay(data: GRRData, interaction: boolean): any;
967
968
  * @param tolerance The total tolerance spread = (USL - LSL)
968
969
  * @param referenceValue The value used to evaluate bias. Generally historical mean or mean from other measurement equipment.
969
970
  */
970
- declare function G1(data: any, tolerance: number, referenceValue?: number): {
971
+ declare function G1(data: any, tolerance: any, referenceValue?: number): {
971
972
  Cg: number;
972
973
  Cgk?: undefined;
974
+ SV?: undefined;
973
975
  bias?: undefined;
974
976
  t?: undefined;
975
977
  p?: undefined;
978
+ Var_Rpt?: undefined;
979
+ Var_RptBias?: undefined;
976
980
  } | {
977
981
  Cg: number;
978
982
  Cgk: number;
983
+ SV: number;
979
984
  bias: number;
980
985
  t: number;
981
986
  p: number;
987
+ Var_Rpt: number;
988
+ Var_RptBias: number;
982
989
  };
983
990
  /**
984
991
  * Evaluates gage reliability based on variance components and specified tolerance
@@ -1056,24 +1063,30 @@ declare function VarianceComponents(ANOVA: any, data: GRRData): {
1056
1063
  Contribution: number;
1057
1064
  };
1058
1065
  };
1059
- declare function G1Graphs(data: any, tolerance: number, referenceValue?: number): {
1066
+ declare function G1Graphs(data: any, tolerance: any, referenceValue: number, name?: string): {
1060
1067
  charts: {
1061
1068
  RunChart: HTMLCanvasElement;
1062
1069
  };
1063
1070
  Cg: number;
1064
1071
  Cgk?: undefined;
1072
+ SV?: undefined;
1065
1073
  bias?: undefined;
1066
1074
  t?: undefined;
1067
1075
  p?: undefined;
1076
+ Var_Rpt?: undefined;
1077
+ Var_RptBias?: undefined;
1068
1078
  } | {
1069
1079
  charts: {
1070
1080
  RunChart: HTMLCanvasElement;
1071
1081
  };
1072
1082
  Cg: number;
1073
1083
  Cgk: number;
1084
+ SV: number;
1074
1085
  bias: number;
1075
1086
  t: number;
1076
1087
  p: number;
1088
+ Var_Rpt: number;
1089
+ Var_RptBias: number;
1077
1090
  };
1078
1091
  declare function GRRGraphs(data: any, tolerance: number, name?: string): {
1079
1092
  GRR: {
package/dist/index.js CHANGED
@@ -87,15 +87,16 @@ __export(QESuite_exports, {
87
87
  });
88
88
  module.exports = __toCommonJS(QESuite_exports);
89
89
  var Specification = class {
90
- constructor(spec, USL = NaN, LSL = NaN, tolerance = NaN, tolplus = NaN, tolminus = NaN, units = "") {
90
+ constructor(spec, USL = NaN, LSL = NaN, tolerance = NaN, tol_plus = NaN, tol_minus = NaN, units = "") {
91
91
  if (typeof spec === "object") {
92
92
  this.nominal = spec == null ? void 0 : spec.spec;
93
93
  this.USL = spec == null ? void 0 : spec.USL;
94
94
  this.LSL = spec == null ? void 0 : spec.LSL;
95
95
  this.tolerance = spec == null ? void 0 : spec.tolerance;
96
- this.tolplus = spec == null ? void 0 : spec.tolplus;
97
- this.tolminus = spec == null ? void 0 : spec.tolminus;
96
+ this.tol_plus = spec == null ? void 0 : spec.tol_plus;
97
+ this.tol_minus = spec == null ? void 0 : spec.tol_minus;
98
98
  this.units = spec == null ? void 0 : spec.units;
99
+ this.full_tolerance = (spec == null ? void 0 : spec.full_tolerance) ?? (spec == null ? void 0 : spec.tolerance) * 2 ?? (spec == null ? void 0 : spec.tol_plus) + (spec == null ? void 0 : spec.tol_minus);
99
100
  }
100
101
  if (Number.isNaN(Number(spec))) {
101
102
  let parsed = this.ParseSpec(spec);
@@ -103,17 +104,19 @@ var Specification = class {
103
104
  this.USL = parsed.USL;
104
105
  this.LSL = parsed.LSL;
105
106
  this.tolerance = parsed.tolerance ?? NaN;
106
- this.tolplus = parsed.tolplus ?? NaN;
107
- this.tolminus = parsed.tolminus ?? NaN;
107
+ this.tol_plus = parsed.tol_plus ?? NaN;
108
+ this.tol_minus = parsed.tol_minus ?? NaN;
108
109
  this.units = parsed.units ?? "";
110
+ this.full_tolerance = (parsed == null ? void 0 : parsed.tolerance) * 2;
109
111
  } else {
110
112
  this.nominal = spec;
111
113
  this.USL = USL;
112
114
  this.LSL = LSL;
113
115
  this.tolerance = tolerance;
114
- this.tolplus = tolplus;
115
- this.tolminus = tolminus;
116
+ this.tol_plus = tol_plus;
117
+ this.tol_minus = tol_minus;
116
118
  this.units = units;
119
+ this.full_tolerance = tolerance * 2;
117
120
  }
118
121
  }
119
122
  nominal;
@@ -121,16 +124,17 @@ var Specification = class {
121
124
  LSL;
122
125
  units;
123
126
  tolerance;
124
- tolplus;
125
- tolminus;
127
+ tol_plus;
128
+ tol_minus;
129
+ full_tolerance;
126
130
  // methods
127
131
  ParseSpec(spec) {
128
132
  let string = spec;
129
133
  let nominal;
130
134
  let USL;
131
135
  let LSL;
132
- let tolplus;
133
- let tolminus;
136
+ let tol_plus;
137
+ let tol_minus;
134
138
  let tol;
135
139
  let units;
136
140
  if (string.indexOf("\xB1") !== -1) {
@@ -138,38 +142,39 @@ var Specification = class {
138
142
  let after = this.SplitUnits(string.substring(string.indexOf("\xB1") + 1));
139
143
  tol = Number(after[0]);
140
144
  units = after[1];
141
- tolplus = Number(tol);
142
- tolminus = Number(tol);
145
+ tol_plus = Number(tol);
146
+ tol_minus = Number(tol);
143
147
  }
144
148
  if (string.indexOf("+") !== -1) {
145
- tolplus = Number(this.SplitUnits(string.substring(string.indexOf("+"), string.indexOf("/") ? string.indexOf("/") : string.indexOf("-")))[0]);
146
- nominal = Number(this.SplitUnits(string.substring(0, string.indexOf("+")))[0]);
149
+ tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1))[0]);
150
+ nominal = Number(this.SplitUnits(string)[0]);
147
151
  }
148
152
  if (string.indexOf("-") !== -1) {
149
- tolminus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
153
+ tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
154
+ nominal = Number(this.SplitUnits(string)[0]);
150
155
  }
151
156
  if (string.indexOf("+-") !== -1 || string.indexOf("+/-") !== -1) {
152
157
  nominal = Number(string.substring(0, string.indexOf("+")));
153
158
  let after = this.SplitUnits(string.substring(string.indexOf("-") + 1));
154
159
  tol = Number(after[0]);
155
160
  units = after[1];
156
- tolplus = Number(tol);
157
- tolminus = Number(tol);
161
+ tol_plus = Number(tol);
162
+ tol_minus = Number(tol);
158
163
  }
159
164
  if (string.indexOf("-+") !== -1 || string.indexOf("-/+") !== -1) {
160
165
  nominal = Number(string.substring(0, string.indexOf("-")));
161
166
  let after = this.SplitUnits(string.substring(string.indexOf("+") + 1));
162
167
  tol = Number(after[0]);
163
168
  units = after[1];
164
- tolplus = Number(tol);
165
- tolminus = Number(tol);
169
+ tol_plus = Number(tol);
170
+ tol_minus = Number(tol);
166
171
  }
167
- if (nominal && tolplus && tolminus) {
168
- USL = nominal + tolplus;
169
- let digits = String(tolplus).split(".");
172
+ if (nominal && tol_plus && tol_minus) {
173
+ USL = nominal + tol_plus;
174
+ let digits = String(tol_plus).split(".");
170
175
  USL = Number(USL).toFixed(digits[1].length);
171
- LSL = nominal - tolminus;
172
- digits = String(tolminus).split(".");
176
+ LSL = nominal - tol_minus;
177
+ digits = String(tol_minus).split(".");
173
178
  LSL = Number(LSL).toFixed(digits[1].length);
174
179
  }
175
180
  if (tol) {
@@ -186,8 +191,8 @@ var Specification = class {
186
191
  USL: USL ?? NaN,
187
192
  LSL: LSL ?? NaN,
188
193
  units,
189
- tolplus: tolplus ?? NaN,
190
- tolminus: tolminus ?? NaN
194
+ tol_plus: tol_plus ?? NaN,
195
+ tol_minus: tol_minus ?? NaN
191
196
  };
192
197
  }
193
198
  }
@@ -211,7 +216,7 @@ var Specification = class {
211
216
  return [dim, units];
212
217
  }
213
218
  toString() {
214
- return `${this.nominal} ${this.tolerance ? "\xB1 " + this.tolerance : "+" + this.tolplus + "/-" + this.tolminus}`;
219
+ return `${this.nominal} ${this.tolerance ? "\xB1 " + this.tolerance : "+" + this.tol_plus + "/-" + this.tol_minus}`;
215
220
  }
216
221
  };
217
222
  var ChartSettings = class {
@@ -3398,6 +3403,9 @@ function AnovaTableTwoWay(data, interaction) {
3398
3403
  return ANOVA;
3399
3404
  }
3400
3405
  function G1(data, tolerance, referenceValue) {
3406
+ if (typeof tolerance === "string") {
3407
+ tolerance = new Specification(tolerance).full_tolerance;
3408
+ }
3401
3409
  let K = 20;
3402
3410
  let L = 6;
3403
3411
  let XbarG = Mean(data);
@@ -3416,9 +3424,12 @@ function G1(data, tolerance, referenceValue) {
3416
3424
  return {
3417
3425
  Cg,
3418
3426
  Cgk,
3427
+ SV: s * 6,
3419
3428
  bias: Bias,
3420
3429
  t: T,
3421
- p: P
3430
+ p: P,
3431
+ Var_Rpt: K / Cg,
3432
+ Var_RptBias: K / Cgk
3422
3433
  };
3423
3434
  }
3424
3435
  function GageEvaluation(VarianceComponents2, tolerance) {
@@ -3603,7 +3614,14 @@ function VarianceComponents(ANOVA, data) {
3603
3614
  VarComp.TotalVariation.Contribution = VarComp.TotalVariation.VarComp / VarComp.TotalVariation.VarComp;
3604
3615
  return VarComp;
3605
3616
  }
3606
- function G1Graphs(data, tolerance, referenceValue) {
3617
+ function G1Graphs(data, tolerance, referenceValue, name = "Results") {
3618
+ if (typeof tolerance === "string" && name === "Results") {
3619
+ name = tolerance;
3620
+ }
3621
+ ;
3622
+ if (typeof tolerance === "string") {
3623
+ tolerance = new Specification(tolerance).full_tolerance;
3624
+ }
3607
3625
  let g1Results = G1(data, tolerance, referenceValue);
3608
3626
  if (!referenceValue) {
3609
3627
  referenceValue = Mean(data);
@@ -3628,7 +3646,7 @@ function G1Graphs(data, tolerance, referenceValue) {
3628
3646
  return new CustomGridline(i + 1, void 0, void 0, void 0, void 0, true);
3629
3647
  });
3630
3648
  chartSettings.axis.x.showAutoGridlines = false;
3631
- let scatterplot = CreateScatterPlot([dataset], "Run Chart of Results", chartSettings);
3649
+ let scatterplot = CreateScatterPlot([dataset], `Run Chart of ${name}`, chartSettings);
3632
3650
  return {
3633
3651
  ...g1Results,
3634
3652
  charts: {
package/dist/index.mjs CHANGED
@@ -1,14 +1,15 @@
1
1
  // index.ts
2
2
  var Specification = class {
3
- constructor(spec, USL = NaN, LSL = NaN, tolerance = NaN, tolplus = NaN, tolminus = NaN, units = "") {
3
+ constructor(spec, USL = NaN, LSL = NaN, tolerance = NaN, tol_plus = NaN, tol_minus = NaN, units = "") {
4
4
  if (typeof spec === "object") {
5
5
  this.nominal = spec == null ? void 0 : spec.spec;
6
6
  this.USL = spec == null ? void 0 : spec.USL;
7
7
  this.LSL = spec == null ? void 0 : spec.LSL;
8
8
  this.tolerance = spec == null ? void 0 : spec.tolerance;
9
- this.tolplus = spec == null ? void 0 : spec.tolplus;
10
- this.tolminus = spec == null ? void 0 : spec.tolminus;
9
+ this.tol_plus = spec == null ? void 0 : spec.tol_plus;
10
+ this.tol_minus = spec == null ? void 0 : spec.tol_minus;
11
11
  this.units = spec == null ? void 0 : spec.units;
12
+ this.full_tolerance = (spec == null ? void 0 : spec.full_tolerance) ?? (spec == null ? void 0 : spec.tolerance) * 2 ?? (spec == null ? void 0 : spec.tol_plus) + (spec == null ? void 0 : spec.tol_minus);
12
13
  }
13
14
  if (Number.isNaN(Number(spec))) {
14
15
  let parsed = this.ParseSpec(spec);
@@ -16,17 +17,19 @@ var Specification = class {
16
17
  this.USL = parsed.USL;
17
18
  this.LSL = parsed.LSL;
18
19
  this.tolerance = parsed.tolerance ?? NaN;
19
- this.tolplus = parsed.tolplus ?? NaN;
20
- this.tolminus = parsed.tolminus ?? NaN;
20
+ this.tol_plus = parsed.tol_plus ?? NaN;
21
+ this.tol_minus = parsed.tol_minus ?? NaN;
21
22
  this.units = parsed.units ?? "";
23
+ this.full_tolerance = (parsed == null ? void 0 : parsed.tolerance) * 2;
22
24
  } else {
23
25
  this.nominal = spec;
24
26
  this.USL = USL;
25
27
  this.LSL = LSL;
26
28
  this.tolerance = tolerance;
27
- this.tolplus = tolplus;
28
- this.tolminus = tolminus;
29
+ this.tol_plus = tol_plus;
30
+ this.tol_minus = tol_minus;
29
31
  this.units = units;
32
+ this.full_tolerance = tolerance * 2;
30
33
  }
31
34
  }
32
35
  nominal;
@@ -34,16 +37,17 @@ var Specification = class {
34
37
  LSL;
35
38
  units;
36
39
  tolerance;
37
- tolplus;
38
- tolminus;
40
+ tol_plus;
41
+ tol_minus;
42
+ full_tolerance;
39
43
  // methods
40
44
  ParseSpec(spec) {
41
45
  let string = spec;
42
46
  let nominal;
43
47
  let USL;
44
48
  let LSL;
45
- let tolplus;
46
- let tolminus;
49
+ let tol_plus;
50
+ let tol_minus;
47
51
  let tol;
48
52
  let units;
49
53
  if (string.indexOf("\xB1") !== -1) {
@@ -51,38 +55,39 @@ var Specification = class {
51
55
  let after = this.SplitUnits(string.substring(string.indexOf("\xB1") + 1));
52
56
  tol = Number(after[0]);
53
57
  units = after[1];
54
- tolplus = Number(tol);
55
- tolminus = Number(tol);
58
+ tol_plus = Number(tol);
59
+ tol_minus = Number(tol);
56
60
  }
57
61
  if (string.indexOf("+") !== -1) {
58
- tolplus = Number(this.SplitUnits(string.substring(string.indexOf("+"), string.indexOf("/") ? string.indexOf("/") : string.indexOf("-")))[0]);
59
- nominal = Number(this.SplitUnits(string.substring(0, string.indexOf("+")))[0]);
62
+ tol_plus = Number(this.SplitUnits(string.substring(string.indexOf("+") + 1))[0]);
63
+ nominal = Number(this.SplitUnits(string)[0]);
60
64
  }
61
65
  if (string.indexOf("-") !== -1) {
62
- tolminus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
66
+ tol_minus = Number(this.SplitUnits(string.substring(string.indexOf("-") + 1))[0]);
67
+ nominal = Number(this.SplitUnits(string)[0]);
63
68
  }
64
69
  if (string.indexOf("+-") !== -1 || string.indexOf("+/-") !== -1) {
65
70
  nominal = Number(string.substring(0, string.indexOf("+")));
66
71
  let after = this.SplitUnits(string.substring(string.indexOf("-") + 1));
67
72
  tol = Number(after[0]);
68
73
  units = after[1];
69
- tolplus = Number(tol);
70
- tolminus = Number(tol);
74
+ tol_plus = Number(tol);
75
+ tol_minus = Number(tol);
71
76
  }
72
77
  if (string.indexOf("-+") !== -1 || string.indexOf("-/+") !== -1) {
73
78
  nominal = Number(string.substring(0, string.indexOf("-")));
74
79
  let after = this.SplitUnits(string.substring(string.indexOf("+") + 1));
75
80
  tol = Number(after[0]);
76
81
  units = after[1];
77
- tolplus = Number(tol);
78
- tolminus = Number(tol);
82
+ tol_plus = Number(tol);
83
+ tol_minus = Number(tol);
79
84
  }
80
- if (nominal && tolplus && tolminus) {
81
- USL = nominal + tolplus;
82
- let digits = String(tolplus).split(".");
85
+ if (nominal && tol_plus && tol_minus) {
86
+ USL = nominal + tol_plus;
87
+ let digits = String(tol_plus).split(".");
83
88
  USL = Number(USL).toFixed(digits[1].length);
84
- LSL = nominal - tolminus;
85
- digits = String(tolminus).split(".");
89
+ LSL = nominal - tol_minus;
90
+ digits = String(tol_minus).split(".");
86
91
  LSL = Number(LSL).toFixed(digits[1].length);
87
92
  }
88
93
  if (tol) {
@@ -99,8 +104,8 @@ var Specification = class {
99
104
  USL: USL ?? NaN,
100
105
  LSL: LSL ?? NaN,
101
106
  units,
102
- tolplus: tolplus ?? NaN,
103
- tolminus: tolminus ?? NaN
107
+ tol_plus: tol_plus ?? NaN,
108
+ tol_minus: tol_minus ?? NaN
104
109
  };
105
110
  }
106
111
  }
@@ -124,7 +129,7 @@ var Specification = class {
124
129
  return [dim, units];
125
130
  }
126
131
  toString() {
127
- return `${this.nominal} ${this.tolerance ? "\xB1 " + this.tolerance : "+" + this.tolplus + "/-" + this.tolminus}`;
132
+ return `${this.nominal} ${this.tolerance ? "\xB1 " + this.tolerance : "+" + this.tol_plus + "/-" + this.tol_minus}`;
128
133
  }
129
134
  };
130
135
  var ChartSettings = class {
@@ -3311,6 +3316,9 @@ function AnovaTableTwoWay(data, interaction) {
3311
3316
  return ANOVA;
3312
3317
  }
3313
3318
  function G1(data, tolerance, referenceValue) {
3319
+ if (typeof tolerance === "string") {
3320
+ tolerance = new Specification(tolerance).full_tolerance;
3321
+ }
3314
3322
  let K = 20;
3315
3323
  let L = 6;
3316
3324
  let XbarG = Mean(data);
@@ -3329,9 +3337,12 @@ function G1(data, tolerance, referenceValue) {
3329
3337
  return {
3330
3338
  Cg,
3331
3339
  Cgk,
3340
+ SV: s * 6,
3332
3341
  bias: Bias,
3333
3342
  t: T,
3334
- p: P
3343
+ p: P,
3344
+ Var_Rpt: K / Cg,
3345
+ Var_RptBias: K / Cgk
3335
3346
  };
3336
3347
  }
3337
3348
  function GageEvaluation(VarianceComponents2, tolerance) {
@@ -3516,7 +3527,14 @@ function VarianceComponents(ANOVA, data) {
3516
3527
  VarComp.TotalVariation.Contribution = VarComp.TotalVariation.VarComp / VarComp.TotalVariation.VarComp;
3517
3528
  return VarComp;
3518
3529
  }
3519
- function G1Graphs(data, tolerance, referenceValue) {
3530
+ function G1Graphs(data, tolerance, referenceValue, name = "Results") {
3531
+ if (typeof tolerance === "string" && name === "Results") {
3532
+ name = tolerance;
3533
+ }
3534
+ ;
3535
+ if (typeof tolerance === "string") {
3536
+ tolerance = new Specification(tolerance).full_tolerance;
3537
+ }
3520
3538
  let g1Results = G1(data, tolerance, referenceValue);
3521
3539
  if (!referenceValue) {
3522
3540
  referenceValue = Mean(data);
@@ -3541,7 +3559,7 @@ function G1Graphs(data, tolerance, referenceValue) {
3541
3559
  return new CustomGridline(i + 1, void 0, void 0, void 0, void 0, true);
3542
3560
  });
3543
3561
  chartSettings.axis.x.showAutoGridlines = false;
3544
- let scatterplot = CreateScatterPlot([dataset], "Run Chart of Results", chartSettings);
3562
+ let scatterplot = CreateScatterPlot([dataset], `Run Chart of ${name}`, chartSettings);
3545
3563
  return {
3546
3564
  ...g1Results,
3547
3565
  charts: {
package/index.ts CHANGED
@@ -4219,8 +4219,10 @@ export function VarianceComponents(ANOVA: any, data: GRRData){
4219
4219
  export function G1Graphs(data: any, tolerance: any, referenceValue: number, name: string = "Results"){
4220
4220
  if(typeof tolerance === "string" && name === "Results"){
4221
4221
  name = tolerance
4222
- tolerance = new Specification(tolerance).full_tolerance;
4223
4222
  };
4223
+ if(typeof tolerance === "string"){
4224
+ tolerance = new Specification(tolerance).full_tolerance;
4225
+ }
4224
4226
 
4225
4227
  let g1Results = G1(data, tolerance, referenceValue);
4226
4228
  if(!referenceValue){referenceValue = Mean(data)}
@@ -4247,7 +4249,7 @@ export function G1Graphs(data: any, tolerance: any, referenceValue: number, name
4247
4249
  chartSettings.axis.x.customGridlines = data.map((d: any, i: number) => {return new CustomGridline(i+1, undefined, undefined, undefined, undefined, true)})
4248
4250
  chartSettings.axis.x.showAutoGridlines = false;
4249
4251
 
4250
- let scatterplot = CreateScatterPlot([dataset], 'Run Chart of Results', chartSettings);
4252
+ let scatterplot = CreateScatterPlot([dataset], `Run Chart of ${name}`, chartSettings);
4251
4253
 
4252
4254
  return {
4253
4255
  ...g1Results,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qesuite",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "Performs advanced statistical analysis of data. Specifically designed for engineering statistical analysis",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1 @@
1
+ Build code from v1.0.23, see version for details.
@@ -0,0 +1 @@
1
+ Fixed unexpected behavior in G1Graphs causing tolerance to remain unparsed if name was passed as a parameter and passed name object to the graph generation.