qesuite 1.0.45 → 1.0.46

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 CHANGED
@@ -3217,110 +3217,112 @@ function MarkOutOfControl(data, UCL, LCL, CL, std, display = new CanvasDrawSetti
3217
3217
  if (std === void 0) {
3218
3218
  std = (CL - LCL) / 3;
3219
3219
  }
3220
- let Test2 = 0;
3221
- let Test3 = 0;
3220
+ let Test2 = [0, 0, 0];
3221
+ let Test3 = [0, 0, 0, 0, 0, 0];
3222
3222
  let Test4 = 0;
3223
- let Test5 = [0, 0, 0];
3224
- let Test6 = [0, 0, 0, 0, 0, 0];
3223
+ let Test5 = 0;
3224
+ let Test6 = 0;
3225
3225
  let Test7 = 0;
3226
3226
  let Test8 = 0;
3227
3227
  data.values.forEach((v, i) => {
3228
3228
  if (controlTests.includes(1) && (v.y > UCL || v.y < LCL)) {
3229
3229
  v.display = display;
3230
3230
  }
3231
- if (controlTests.includes(2) && (v.y > CL && Test2 >= 0 || v.y < CL && Test2 <= 0)) {
3232
- Test2 += v.y < CL ? -1 : 1;
3233
- if (Test2 >= 8 || Test2 <= -8) {
3234
- v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3235
- }
3236
- } else {
3237
- Test2 = 0;
3238
- }
3239
- if (i !== 0) {
3240
- if (controlTests.includes(3) && (v.y > data.values[i - 1].y && Test3 >= 0 || v.y < data.values[i - 1].y && Test3 <= 0)) {
3241
- Test3 += v.y < data.values[i - 1].y ? -1 : 1;
3242
- if (Test3 >= 5 || Test3 <= -6) {
3243
- v.display = new CanvasDrawSettings("yellow", "red", 1, 1);
3244
- ;
3245
- }
3246
- } else {
3247
- Test3 = 0;
3248
- }
3249
- if (controlTests.includes(4) && v.y < data.values[i - 1].y) {
3250
- if (Test4 >= 0) {
3251
- Test4 = -1 * (Test4 + 1);
3252
- } else {
3253
- Test4 = 0;
3254
- }
3255
- if (Math.abs(Test4) >= 13) {
3256
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3257
- ;
3258
- }
3259
- }
3260
- if (controlTests.includes(4) && v.y > data.values[i - 1].y) {
3261
- if (Test4 <= 0) {
3262
- Test4 = -1 * (Test4 - 1);
3263
- } else {
3264
- Test4 = 0;
3265
- }
3266
- if (Math.abs(Test4) >= 13) {
3267
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3268
- ;
3269
- }
3231
+ Test2[0] = Test2[1];
3232
+ Test2[1] = Test2[2];
3233
+ if (controlTests.includes(2) && v.y > 2 * std + CL) {
3234
+ Test2[2] = 1;
3235
+ if (Test2[0] === 1 || Test2[1] === 1) {
3236
+ v.display = new CanvasDrawSettings("white", "red", 1, 1);
3270
3237
  }
3271
3238
  }
3272
- Test5[0] = Test5[1];
3273
- Test5[1] = Test5[2];
3274
- if (controlTests.includes(5) && v.y > 2 * std + CL) {
3275
- Test5[2] = 1;
3276
- if (Test5[0] === 1 || Test5[1] === 1) {
3239
+ if (controlTests.includes(2) && v.y < CL - 2 * std) {
3240
+ Test2[2] = -1;
3241
+ if (Test2[0] === -1 || Test2[1] === -1) {
3277
3242
  v.display = new CanvasDrawSettings("white", "red", 1, 1);
3278
- ;
3279
3243
  }
3280
3244
  }
3281
- if (controlTests.includes(5) && v.y < CL - 2 * std) {
3282
- Test5[2] = -1;
3283
- if (Test5[0] === -1 || Test5[1] === -1) {
3284
- v.display = display;
3285
- }
3245
+ if (v.y > CL - 2 * std && v.y < 2 * std + CL) {
3246
+ Test2[2] = 0;
3286
3247
  }
3287
- Test6[0] = Test6[1];
3288
- Test6[1] = Test6[2];
3289
- Test6[2] = Test6[3];
3290
- Test6[3] = Test6[4];
3291
- Test6[4] = Test6[5];
3292
- if (controlTests.includes(6) && v.y > std + CL) {
3293
- Test6[5] = 1;
3294
- let plus = Test6.filter((t) => t === 1);
3248
+ Test3[0] = Test3[1];
3249
+ Test3[1] = Test3[2];
3250
+ Test3[2] = Test3[3];
3251
+ Test3[3] = Test3[4];
3252
+ Test3[4] = Test3[5];
3253
+ if (controlTests.includes(3) && v.y > std + CL) {
3254
+ Test3[5] = 1;
3255
+ let plus = Test3.filter((t) => t === 1);
3295
3256
  if (plus.length >= 4) {
3296
3257
  v.display = new CanvasDrawSettings("grey", "red", 1, 1);
3297
3258
  }
3298
- } else if (controlTests.includes(6) && v.y < CL - std) {
3299
- Test6[5] = -1;
3300
- let plus = Test6.filter((t) => t === -1);
3259
+ } else if (controlTests.includes(3) && v.y < CL - std) {
3260
+ Test3[5] = -1;
3261
+ let plus = Test3.filter((t) => t === -1);
3301
3262
  if (plus.length >= 4) {
3302
3263
  v.display = display;
3303
3264
  }
3304
3265
  } else {
3305
- Test6[5] = 0;
3266
+ Test3[5] = 0;
3306
3267
  }
3307
- if (controlTests.includes(7) && v.y >= CL - std && v.y <= CL + std) {
3308
- Test7 += 1;
3309
- if (Test7 >= 15) {
3268
+ if (controlTests.includes(4) && v.y >= CL - std && v.y <= CL + std) {
3269
+ Test4 += 1;
3270
+ if (Test4 >= 15) {
3310
3271
  v.display = new CanvasDrawSettings("pink", "red", 1, 1);
3311
3272
  ;
3312
3273
  }
3313
3274
  } else {
3314
- Test7 = 0;
3275
+ Test4 = 0;
3315
3276
  }
3316
- if (controlTests.includes(8) && (v.y < CL - std || v.y > CL + std)) {
3317
- Test8 += 1;
3318
- if (Test8 >= 8) {
3277
+ if (controlTests.includes(5) && (v.y < CL - std || v.y > CL + std)) {
3278
+ Test5 += 1;
3279
+ if (Test5 >= 8) {
3319
3280
  v.display = new CanvasDrawSettings("brown", "red", 1, 1);
3320
3281
  ;
3321
3282
  }
3322
3283
  } else {
3323
- Test8 = 0;
3284
+ Test5 = 0;
3285
+ }
3286
+ if (controlTests.includes(6) && (v.y > CL && Test6 >= 0 || v.y < CL && Test6 <= 0)) {
3287
+ Test6 += v.y < CL ? -1 : 1;
3288
+ if (Test6 >= 9 || Test6 <= -8) {
3289
+ v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3290
+ }
3291
+ } else {
3292
+ Test6 = 0;
3293
+ }
3294
+ if (i !== 0) {
3295
+ if (controlTests.includes(7) && (v.y > data.values[i - 1].y && Test7 >= 0 || v.y < data.values[i - 1].y && Test7 <= 0)) {
3296
+ Test7 += v.y < data.values[i - 1].y ? -1 : 1;
3297
+ if (Test7 >= 5 || Test7 <= -6) {
3298
+ v.display = new CanvasDrawSettings("yellow", "red", 1, 1);
3299
+ ;
3300
+ }
3301
+ } else {
3302
+ Test7 = 0;
3303
+ }
3304
+ if (controlTests.includes(8) && v.y < data.values[i - 1].y) {
3305
+ if (Test8 >= 0) {
3306
+ Test8 = -1 * (Test8 + 1);
3307
+ } else {
3308
+ Test8 = 0;
3309
+ }
3310
+ if (Math.abs(Test8) >= 13) {
3311
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3312
+ ;
3313
+ }
3314
+ }
3315
+ if (controlTests.includes(8) && v.y > data.values[i - 1].y) {
3316
+ if (Test8 <= 0) {
3317
+ Test8 = -1 * (Test8 - 1);
3318
+ } else {
3319
+ Test8 = 0;
3320
+ }
3321
+ if (Math.abs(Test8) >= 13) {
3322
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3323
+ ;
3324
+ }
3325
+ }
3324
3326
  }
3325
3327
  });
3326
3328
  }
package/dist/index.mjs CHANGED
@@ -3130,110 +3130,112 @@ function MarkOutOfControl(data, UCL, LCL, CL, std, display = new CanvasDrawSetti
3130
3130
  if (std === void 0) {
3131
3131
  std = (CL - LCL) / 3;
3132
3132
  }
3133
- let Test2 = 0;
3134
- let Test3 = 0;
3133
+ let Test2 = [0, 0, 0];
3134
+ let Test3 = [0, 0, 0, 0, 0, 0];
3135
3135
  let Test4 = 0;
3136
- let Test5 = [0, 0, 0];
3137
- let Test6 = [0, 0, 0, 0, 0, 0];
3136
+ let Test5 = 0;
3137
+ let Test6 = 0;
3138
3138
  let Test7 = 0;
3139
3139
  let Test8 = 0;
3140
3140
  data.values.forEach((v, i) => {
3141
3141
  if (controlTests.includes(1) && (v.y > UCL || v.y < LCL)) {
3142
3142
  v.display = display;
3143
3143
  }
3144
- if (controlTests.includes(2) && (v.y > CL && Test2 >= 0 || v.y < CL && Test2 <= 0)) {
3145
- Test2 += v.y < CL ? -1 : 1;
3146
- if (Test2 >= 8 || Test2 <= -8) {
3147
- v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3148
- }
3149
- } else {
3150
- Test2 = 0;
3151
- }
3152
- if (i !== 0) {
3153
- if (controlTests.includes(3) && (v.y > data.values[i - 1].y && Test3 >= 0 || v.y < data.values[i - 1].y && Test3 <= 0)) {
3154
- Test3 += v.y < data.values[i - 1].y ? -1 : 1;
3155
- if (Test3 >= 5 || Test3 <= -6) {
3156
- v.display = new CanvasDrawSettings("yellow", "red", 1, 1);
3157
- ;
3158
- }
3159
- } else {
3160
- Test3 = 0;
3161
- }
3162
- if (controlTests.includes(4) && v.y < data.values[i - 1].y) {
3163
- if (Test4 >= 0) {
3164
- Test4 = -1 * (Test4 + 1);
3165
- } else {
3166
- Test4 = 0;
3167
- }
3168
- if (Math.abs(Test4) >= 13) {
3169
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3170
- ;
3171
- }
3172
- }
3173
- if (controlTests.includes(4) && v.y > data.values[i - 1].y) {
3174
- if (Test4 <= 0) {
3175
- Test4 = -1 * (Test4 - 1);
3176
- } else {
3177
- Test4 = 0;
3178
- }
3179
- if (Math.abs(Test4) >= 13) {
3180
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3181
- ;
3182
- }
3144
+ Test2[0] = Test2[1];
3145
+ Test2[1] = Test2[2];
3146
+ if (controlTests.includes(2) && v.y > 2 * std + CL) {
3147
+ Test2[2] = 1;
3148
+ if (Test2[0] === 1 || Test2[1] === 1) {
3149
+ v.display = new CanvasDrawSettings("white", "red", 1, 1);
3183
3150
  }
3184
3151
  }
3185
- Test5[0] = Test5[1];
3186
- Test5[1] = Test5[2];
3187
- if (controlTests.includes(5) && v.y > 2 * std + CL) {
3188
- Test5[2] = 1;
3189
- if (Test5[0] === 1 || Test5[1] === 1) {
3152
+ if (controlTests.includes(2) && v.y < CL - 2 * std) {
3153
+ Test2[2] = -1;
3154
+ if (Test2[0] === -1 || Test2[1] === -1) {
3190
3155
  v.display = new CanvasDrawSettings("white", "red", 1, 1);
3191
- ;
3192
3156
  }
3193
3157
  }
3194
- if (controlTests.includes(5) && v.y < CL - 2 * std) {
3195
- Test5[2] = -1;
3196
- if (Test5[0] === -1 || Test5[1] === -1) {
3197
- v.display = display;
3198
- }
3158
+ if (v.y > CL - 2 * std && v.y < 2 * std + CL) {
3159
+ Test2[2] = 0;
3199
3160
  }
3200
- Test6[0] = Test6[1];
3201
- Test6[1] = Test6[2];
3202
- Test6[2] = Test6[3];
3203
- Test6[3] = Test6[4];
3204
- Test6[4] = Test6[5];
3205
- if (controlTests.includes(6) && v.y > std + CL) {
3206
- Test6[5] = 1;
3207
- let plus = Test6.filter((t) => t === 1);
3161
+ Test3[0] = Test3[1];
3162
+ Test3[1] = Test3[2];
3163
+ Test3[2] = Test3[3];
3164
+ Test3[3] = Test3[4];
3165
+ Test3[4] = Test3[5];
3166
+ if (controlTests.includes(3) && v.y > std + CL) {
3167
+ Test3[5] = 1;
3168
+ let plus = Test3.filter((t) => t === 1);
3208
3169
  if (plus.length >= 4) {
3209
3170
  v.display = new CanvasDrawSettings("grey", "red", 1, 1);
3210
3171
  }
3211
- } else if (controlTests.includes(6) && v.y < CL - std) {
3212
- Test6[5] = -1;
3213
- let plus = Test6.filter((t) => t === -1);
3172
+ } else if (controlTests.includes(3) && v.y < CL - std) {
3173
+ Test3[5] = -1;
3174
+ let plus = Test3.filter((t) => t === -1);
3214
3175
  if (plus.length >= 4) {
3215
3176
  v.display = display;
3216
3177
  }
3217
3178
  } else {
3218
- Test6[5] = 0;
3179
+ Test3[5] = 0;
3219
3180
  }
3220
- if (controlTests.includes(7) && v.y >= CL - std && v.y <= CL + std) {
3221
- Test7 += 1;
3222
- if (Test7 >= 15) {
3181
+ if (controlTests.includes(4) && v.y >= CL - std && v.y <= CL + std) {
3182
+ Test4 += 1;
3183
+ if (Test4 >= 15) {
3223
3184
  v.display = new CanvasDrawSettings("pink", "red", 1, 1);
3224
3185
  ;
3225
3186
  }
3226
3187
  } else {
3227
- Test7 = 0;
3188
+ Test4 = 0;
3228
3189
  }
3229
- if (controlTests.includes(8) && (v.y < CL - std || v.y > CL + std)) {
3230
- Test8 += 1;
3231
- if (Test8 >= 8) {
3190
+ if (controlTests.includes(5) && (v.y < CL - std || v.y > CL + std)) {
3191
+ Test5 += 1;
3192
+ if (Test5 >= 8) {
3232
3193
  v.display = new CanvasDrawSettings("brown", "red", 1, 1);
3233
3194
  ;
3234
3195
  }
3235
3196
  } else {
3236
- Test8 = 0;
3197
+ Test5 = 0;
3198
+ }
3199
+ if (controlTests.includes(6) && (v.y > CL && Test6 >= 0 || v.y < CL && Test6 <= 0)) {
3200
+ Test6 += v.y < CL ? -1 : 1;
3201
+ if (Test6 >= 9 || Test6 <= -8) {
3202
+ v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3203
+ }
3204
+ } else {
3205
+ Test6 = 0;
3206
+ }
3207
+ if (i !== 0) {
3208
+ if (controlTests.includes(7) && (v.y > data.values[i - 1].y && Test7 >= 0 || v.y < data.values[i - 1].y && Test7 <= 0)) {
3209
+ Test7 += v.y < data.values[i - 1].y ? -1 : 1;
3210
+ if (Test7 >= 5 || Test7 <= -6) {
3211
+ v.display = new CanvasDrawSettings("yellow", "red", 1, 1);
3212
+ ;
3213
+ }
3214
+ } else {
3215
+ Test7 = 0;
3216
+ }
3217
+ if (controlTests.includes(8) && v.y < data.values[i - 1].y) {
3218
+ if (Test8 >= 0) {
3219
+ Test8 = -1 * (Test8 + 1);
3220
+ } else {
3221
+ Test8 = 0;
3222
+ }
3223
+ if (Math.abs(Test8) >= 13) {
3224
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3225
+ ;
3226
+ }
3227
+ }
3228
+ if (controlTests.includes(8) && v.y > data.values[i - 1].y) {
3229
+ if (Test8 <= 0) {
3230
+ Test8 = -1 * (Test8 - 1);
3231
+ } else {
3232
+ Test8 = 0;
3233
+ }
3234
+ if (Math.abs(Test8) >= 13) {
3235
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);
3236
+ ;
3237
+ }
3238
+ }
3237
3239
  }
3238
3240
  });
3239
3241
  }
package/index.ts CHANGED
@@ -3597,11 +3597,11 @@ export function CreateScatterPlot(data: DataSet[], title?: string, chartSettings
3597
3597
  function MarkOutOfControl(data: DataSet, UCL: number, LCL: number, CL?: any, std?: any, display = new CanvasDrawSettings("red", "red", 1, 1), controlTests: any = [1]) {
3598
3598
  if(CL === undefined){CL = Mean(data.values.map(v => {return v.y}))}
3599
3599
  if(std === undefined){std = (CL - LCL)/3}
3600
- let Test2 = 0;
3601
- let Test3 = 0;
3600
+ let Test2 = [0,0,0];
3601
+ let Test3 = [0, 0, 0, 0, 0, 0];
3602
3602
  let Test4 = 0;
3603
- let Test5 = [0,0,0];
3604
- let Test6 = [0, 0, 0, 0, 0, 0];
3603
+ let Test5 = 0;
3604
+ let Test6 = 0;
3605
3605
  let Test7 = 0;
3606
3606
  let Test8 = 0;
3607
3607
  data.values.forEach((v, i) => {
@@ -3609,100 +3609,105 @@ function MarkOutOfControl(data: DataSet, UCL: number, LCL: number, CL?: any, std
3609
3609
  if (controlTests.includes(1) && (v.y > UCL || v.y < LCL)) {
3610
3610
  v.display = display;
3611
3611
  }
3612
- // Test2: Nine points in a row on same side of center line
3613
- if(controlTests.includes(2) && ((v.y > CL && Test2 >= 0) || (v.y < CL && Test2 <= 0))){
3614
- Test2 += v.y < CL ? -1 : 1;
3615
- if(Test2 >= 8 || Test2 <= -8){
3616
- v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3617
- }
3618
- }else{
3619
- Test2 = 0;
3620
- }
3621
3612
 
3622
- if(i !== 0){
3623
- // Test3: Six points in a row increasing or decreasing
3624
- if(controlTests.includes(3) && ((v.y > data.values[i-1].y && Test3 >= 0) || (v.y < data.values[i-1].y && Test3 <= 0))){
3625
- Test3 += v.y < data.values[i-1].y ? -1 : 1;
3626
- if(Test3 >= 5 || Test3 <= -6){
3627
- v.display = new CanvasDrawSettings("yellow", "red", 1, 1);;
3628
- }
3629
- }else{
3630
- Test3 = 0;
3631
- }
3632
-
3633
- //Test4: Fourteen points in a row, alternating up and down
3634
- if(controlTests.includes(4) && v.y < data.values[i-1].y){
3635
- if(Test4 >= 0){
3636
- Test4 = -1*(Test4 + 1);
3637
- }else{Test4 = 0}
3638
- if(Math.abs(Test4) >= 13){
3639
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);;
3640
- }
3641
- }
3642
- if(controlTests.includes(4) && v.y > data.values[i-1].y){
3643
- if(Test4 <= 0){
3644
- Test4 = -1*(Test4 - 1);
3645
- }else{Test4 = 0}
3646
- if(Math.abs(Test4) >= 13){
3647
- v.display = new CanvasDrawSettings("purple", "red", 1, 1);;
3648
- }
3613
+ // Test2: Two out of three points more than 2σ from the center line (same side)
3614
+ Test2[0] = Test2[1];
3615
+ Test2[1] = Test2[2];
3616
+ if (controlTests.includes(2) && v.y > 2*std+CL) {
3617
+ Test2[2] = 1;
3618
+ if(Test2[0] === 1 || Test2[1] === 1){
3619
+ v.display = new CanvasDrawSettings("white", "red", 1, 1);
3649
3620
  }
3650
3621
  }
3651
-
3652
- // Test5: Two out of three points more than 2σ from the center line (same side)
3653
- Test5[0] = Test5[1];
3654
- Test5[1] = Test5[2];
3655
- if (controlTests.includes(5) && v.y > 2*std+CL) {
3656
- Test5[2] = 1;
3657
- if(Test5[0] === 1 || Test5[1] === 1){
3658
- v.display = new CanvasDrawSettings("white", "red", 1, 1);;
3622
+ if (controlTests.includes(2) && v.y < CL-2*std) {
3623
+ Test2[2] = -1;
3624
+ if(Test2[0] === -1 || Test2[1] === -1){
3625
+ v.display = new CanvasDrawSettings("white", "red", 1, 1);
3659
3626
  }
3660
3627
  }
3661
- if (controlTests.includes(5) && v.y < CL-2*std) {
3662
- Test5[2] = -1;
3663
- if(Test5[0] === -1 || Test5[1] === -1){
3664
- v.display = display;
3665
- }
3628
+ if(v.y > CL-2*std && v.y < 2*std+CL){
3629
+ Test2[2] = 0;
3666
3630
  }
3667
3631
 
3668
- // Test6: Four out of five points more than 1σ from center line (same side)
3669
- Test6[0] = Test6[1];
3670
- Test6[1] = Test6[2];
3671
- Test6[2] = Test6[3];
3672
- Test6[3] = Test6[4];
3673
- Test6[4] = Test6[5];
3674
- if (controlTests.includes(6) && v.y > std+CL) {
3675
- Test6[5] = 1;
3676
- let plus = Test6.filter(t => t === 1);
3632
+ // Test3: Four out of five points more than 1σ from center line (same side)
3633
+ Test3[0] = Test3[1];
3634
+ Test3[1] = Test3[2];
3635
+ Test3[2] = Test3[3];
3636
+ Test3[3] = Test3[4];
3637
+ Test3[4] = Test3[5];
3638
+ if (controlTests.includes(3) && v.y > std+CL) {
3639
+ Test3[5] = 1;
3640
+ let plus = Test3.filter(t => t === 1);
3677
3641
  if(plus.length >= 4){
3678
3642
  v.display = new CanvasDrawSettings("grey", "red", 1, 1);
3679
3643
  }
3680
- }else if (controlTests.includes(6) && v.y < CL-std) {
3681
- Test6[5] = -1;
3682
- let plus = Test6.filter(t => t === -1);
3644
+ }else if (controlTests.includes(3) && v.y < CL-std) {
3645
+ Test3[5] = -1;
3646
+ let plus = Test3.filter(t => t === -1);
3683
3647
  if(plus.length >= 4){
3684
3648
  v.display = display
3685
3649
  }
3686
- }else{Test6[5] = 0}
3650
+ }else{Test3[5] = 0}
3687
3651
 
3688
- // Test7: Fifteen points in a row within 1σ of center line (either side)
3689
- if(controlTests.includes(7) && v.y >= CL - std && v.y <= CL + std){
3690
- Test7 += 1;
3691
- if(Test7 >= 15){
3652
+ // Test4: Fifteen points in a row within 1σ of center line (either side)
3653
+ if(controlTests.includes(4) && v.y >= CL - std && v.y <= CL + std){
3654
+ Test4 += 1;
3655
+ if(Test4 >= 15){
3692
3656
  v.display = new CanvasDrawSettings("pink", "red", 1, 1);;
3693
3657
  }
3694
3658
  }else{
3695
- Test7 = 0
3659
+ Test4 = 0
3696
3660
  }
3697
3661
 
3698
- // Test8: Fifteen points in a row within 1σ of center line (either side)
3699
- if(controlTests.includes(8) && (v.y < CL - std || v.y > CL + std)){
3700
- Test8 += 1;
3701
- if(Test8 >= 8){
3662
+ // Test5: 8 points in a row more than 1σ of center line (either side)
3663
+ if(controlTests.includes(5) && (v.y < CL - std || v.y > CL + std)){
3664
+ Test5 += 1;
3665
+ if(Test5 >= 8){
3702
3666
  v.display = new CanvasDrawSettings("brown", "red", 1, 1);;
3703
3667
  }
3704
3668
  }else{
3705
- Test8 = 0
3669
+ Test5 = 0
3670
+ }
3671
+
3672
+
3673
+ // Test6: Nine points in a row on same side of center line
3674
+ if(controlTests.includes(6) && ((v.y > CL && Test6 >= 0) || (v.y < CL && Test6 <= 0))){
3675
+ Test6 += v.y < CL ? -1 : 1;
3676
+ if(Test6 >= 9 || Test6 <= -8){
3677
+ v.display = new CanvasDrawSettings("orange", "red", 1, 1);
3678
+ }
3679
+ }else{
3680
+ Test6 = 0;
3681
+ }
3682
+
3683
+ if(i !== 0){
3684
+ // Test7: Six points in a row increasing or decreasing
3685
+ if(controlTests.includes(7) && ((v.y > data.values[i-1].y && Test7 >= 0) || (v.y < data.values[i-1].y && Test7 <= 0))){
3686
+ Test7 += v.y < data.values[i-1].y ? -1 : 1;
3687
+ if(Test7 >= 5 || Test7 <= -6){
3688
+ v.display = new CanvasDrawSettings("yellow", "red", 1, 1);;
3689
+ }
3690
+ }else{
3691
+ Test7 = 0;
3692
+ }
3693
+
3694
+ //Test8: Fourteen points in a row, alternating up and down
3695
+ if(controlTests.includes(8) && v.y < data.values[i-1].y){
3696
+ if(Test8 >= 0){
3697
+ Test8 = -1*(Test8 + 1);
3698
+ }else{Test8 = 0}
3699
+ if(Math.abs(Test8) >= 13){
3700
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);;
3701
+ }
3702
+ }
3703
+ if(controlTests.includes(8) && v.y > data.values[i-1].y){
3704
+ if(Test8 <= 0){
3705
+ Test8 = -1*(Test8 - 1);
3706
+ }else{Test8 = 0}
3707
+ if(Math.abs(Test8) >= 13){
3708
+ v.display = new CanvasDrawSettings("purple", "red", 1, 1);;
3709
+ }
3710
+ }
3706
3711
  }
3707
3712
 
3708
3713
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qesuite",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
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
+ -bug fix in MarkOutOfControl incorrect counting