qesuite 1.0.37 → 1.0.39

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
@@ -967,6 +967,7 @@ declare function CreateSummaryChart(charts: HTMLCanvasElement[], title: string):
967
967
  declare function CreateStackedChart(charts: Chart[], title?: string, chartSettings?: ChartSettings): HTMLCanvasElement;
968
968
  declare function GetFunctionValues(callback: Function, range: number[], count: number): DataSet;
969
969
  declare function QQPlotChart(data: number[], distribution?: string): HTMLCanvasElement;
970
+ declare function CreateControlChart(data: number[], chartTitle?: string, UCL?: number, LCL?: number): HTMLCanvasElement;
970
971
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
971
972
  */
972
973
  /**
@@ -1149,4 +1150,4 @@ declare function GRRByPartChart(data: GRRData): HTMLCanvasElement;
1149
1150
  declare function GRRPartxOperatorChart(data: GRRData): HTMLCanvasElement;
1150
1151
  declare function CompileGRRObject(operators: any, parts: any, measurements: any): GRRData;
1151
1152
 
1152
- export { AnovaTableTwoWay, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CompileGRRObject, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomGridline, DataCollection, DataSet, Distributions, ERF, EngFont, FixedPointIteration, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, Gamma, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, Margin, MaximumLikelihoodParameters, Mean, Median, MovingRange, MovingRangeChart, NewtonRaphson, ObjectToArray, ParameterizedCDF, Point, QQPlot, QQPlotChart, Rang, RoundTO, SerializeData, Specification, StDev, Sum, UnbiasingConstant, VarianceComponents };
1153
+ export { AnovaTableTwoWay, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CompileGRRObject, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomGridline, DataCollection, DataSet, Distributions, ERF, EngFont, FixedPointIteration, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, Gamma, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, Margin, MaximumLikelihoodParameters, Mean, Median, MovingRange, MovingRangeChart, NewtonRaphson, ObjectToArray, ParameterizedCDF, Point, QQPlot, QQPlotChart, Rang, RoundTO, SerializeData, Specification, StDev, Sum, UnbiasingConstant, VarianceComponents };
package/dist/index.d.ts CHANGED
@@ -967,6 +967,7 @@ declare function CreateSummaryChart(charts: HTMLCanvasElement[], title: string):
967
967
  declare function CreateStackedChart(charts: Chart[], title?: string, chartSettings?: ChartSettings): HTMLCanvasElement;
968
968
  declare function GetFunctionValues(callback: Function, range: number[], count: number): DataSet;
969
969
  declare function QQPlotChart(data: number[], distribution?: string): HTMLCanvasElement;
970
+ declare function CreateControlChart(data: number[], chartTitle?: string, UCL?: number, LCL?: number): HTMLCanvasElement;
970
971
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
971
972
  */
972
973
  /**
@@ -1149,4 +1150,4 @@ declare function GRRByPartChart(data: GRRData): HTMLCanvasElement;
1149
1150
  declare function GRRPartxOperatorChart(data: GRRData): HTMLCanvasElement;
1150
1151
  declare function CompileGRRObject(operators: any, parts: any, measurements: any): GRRData;
1151
1152
 
1152
- export { AnovaTableTwoWay, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CompileGRRObject, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomGridline, DataCollection, DataSet, Distributions, ERF, EngFont, FixedPointIteration, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, Gamma, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, Margin, MaximumLikelihoodParameters, Mean, Median, MovingRange, MovingRangeChart, NewtonRaphson, ObjectToArray, ParameterizedCDF, Point, QQPlot, QQPlotChart, Rang, RoundTO, SerializeData, Specification, StDev, Sum, UnbiasingConstant, VarianceComponents };
1153
+ export { AnovaTableTwoWay, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CompileGRRObject, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomGridline, DataCollection, DataSet, Distributions, ERF, EngFont, FixedPointIteration, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, Gamma, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, Margin, MaximumLikelihoodParameters, Mean, Median, MovingRange, MovingRangeChart, NewtonRaphson, ObjectToArray, ParameterizedCDF, Point, QQPlot, QQPlotChart, Rang, RoundTO, SerializeData, Specification, StDev, Sum, UnbiasingConstant, VarianceComponents };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(QESuite_exports, {
33
33
  CreateCapabilityPlot: () => CreateCapabilityPlot,
34
34
  CreateCategoricalBarGraph: () => CreateCategoricalBarGraph,
35
35
  CreateContinuousBarGraph: () => CreateContinuousBarGraph,
36
+ CreateControlChart: () => CreateControlChart,
36
37
  CreateScatterPlot: () => CreateScatterPlot,
37
38
  CreateSplitGraph: () => CreateSplitGraph,
38
39
  CreateStackedChart: () => CreateStackedChart,
@@ -3652,12 +3653,33 @@ function QQPlotChart(data, distribution = "Normal") {
3652
3653
  let chart = CreateStackedChart([middleLineChart, new Chart([dataset], "scatter")], `${distribution[0].toUpperCase()}${distribution.substring(1)} Probability Plot`, chartSettings);
3653
3654
  if (distribution.toLowerCase() === "normal" || distribution.toLowerCase().includes("boxcox")) {
3654
3655
  let AD = GoodnessOfFit.AndersonDarling.Test(data, GoodnessOfFit.Distributions.Normal);
3655
- let RJ = Distributions.Normal.RyanJoiner.Test(data);
3656
- let KS = Distributions.Normal.KolmogorovSmirnov(data);
3657
3656
  let JB = Distributions.Normal.JarqueBera(data);
3657
+ let KS = Distributions.Normal.KolmogorovSmirnov(data);
3658
+ let LF = Distributions.Normal.Lilliefors.Test(data);
3659
+ let RJ = Distributions.Normal.RyanJoiner.Test(data);
3660
+ let SWR = Distributions.Normal.ShapiroWilk.Royston(data);
3658
3661
  let ctx = chart.getContext("2d");
3659
3662
  if (ctx) {
3660
- AddInfoTable(ctx, [{ key: "AD:", value: AD.AD }, { key: "p-value:", value: AD.p }, { key: "", value: "" }, { key: "RJ:", value: RJ.RJ }, { key: "crit.:", value: RJ.critical }, { key: "", value: "" }, { key: "KS:", value: KS.KS }, { key: "p-value:", value: KS.p }, { key: "", value: "" }, { key: "JB:", value: JB.JB }, { key: "p-value:", value: JB.p }], 1075, 150, 175, 100, "", 30);
3663
+ AddInfoTable(ctx, [
3664
+ { key: "AD:", value: AD.AD },
3665
+ { key: "p-value:", value: AD.p },
3666
+ { key: "", value: "" },
3667
+ { key: "JB:", value: JB.JB },
3668
+ { key: "p-value:", value: JB.p },
3669
+ { key: "", value: "" },
3670
+ { key: "KS:", value: KS.KS },
3671
+ { key: "p-value:", value: KS.p },
3672
+ { key: "", value: "" },
3673
+ { key: "Lf:", value: LF.KS },
3674
+ { key: "p-value:", value: LF.p },
3675
+ { key: "", value: "" },
3676
+ { key: "RJ:", value: RJ.RJ },
3677
+ { key: "crit.:", value: RJ.critical },
3678
+ { key: "", value: "" },
3679
+ { key: "SW(R):", value: SWR.W },
3680
+ { key: "p-value:", value: SWR.p },
3681
+ { key: "", value: "" }
3682
+ ], 1075, 50, 175, 100, "", 30);
3661
3683
  }
3662
3684
  } else {
3663
3685
  let dist = distribution.replace("-", "").replace("arameter", "").replace(/\s/g, "");
@@ -3703,6 +3725,30 @@ function QQDistributionModificationX(p, distribution, data) {
3703
3725
  }
3704
3726
  return p;
3705
3727
  }
3728
+ function CreateControlChart(data, chartTitle, UCL, LCL) {
3729
+ let centerline = Mean(data);
3730
+ let std = StDev.S(data);
3731
+ if (UCL === void 0) {
3732
+ UCL = centerline + 3 * std;
3733
+ }
3734
+ if (LCL === void 0) {
3735
+ LCL = centerline - 3 * std;
3736
+ }
3737
+ let dataSet = new DataSet(data.map((d, i) => {
3738
+ return new Point(i, d);
3739
+ }));
3740
+ dataSet.line.type = "straight";
3741
+ let customGridlines = [
3742
+ new CustomGridline(centerline, `x\u0304 = ${Math.round(centerline * 1e3) / 1e3}`, new CanvasDrawSettings("", "green"), void 0, true),
3743
+ new CustomGridline(LCL, `LCL = ${Math.round(LCL * 1e3) / 1e3}`, new CanvasDrawSettings("", "maroon"), void 0, true),
3744
+ new CustomGridline(UCL, `UCL = ${Math.round(UCL * 1e3) / 1e3}`, new CanvasDrawSettings("", "maroon"), void 0, true)
3745
+ ];
3746
+ let chartSettings = new ChartSettings();
3747
+ chartSettings.axis.y.customGridlines = customGridlines;
3748
+ MarkOutOfControl(dataSet, UCL, LCL, centerline, std);
3749
+ let graph = CreateScatterPlot([dataSet], chartTitle, chartSettings);
3750
+ return graph;
3751
+ }
3706
3752
  function AnovaTableTwoWay(data, interaction) {
3707
3753
  let ANOVA;
3708
3754
  if (!interaction) {
@@ -4382,6 +4428,7 @@ function SplitObjectArrayByProp(array, prop) {
4382
4428
  CreateCapabilityPlot,
4383
4429
  CreateCategoricalBarGraph,
4384
4430
  CreateContinuousBarGraph,
4431
+ CreateControlChart,
4385
4432
  CreateScatterPlot,
4386
4433
  CreateSplitGraph,
4387
4434
  CreateStackedChart,
package/dist/index.mjs CHANGED
@@ -3566,12 +3566,33 @@ function QQPlotChart(data, distribution = "Normal") {
3566
3566
  let chart = CreateStackedChart([middleLineChart, new Chart([dataset], "scatter")], `${distribution[0].toUpperCase()}${distribution.substring(1)} Probability Plot`, chartSettings);
3567
3567
  if (distribution.toLowerCase() === "normal" || distribution.toLowerCase().includes("boxcox")) {
3568
3568
  let AD = GoodnessOfFit.AndersonDarling.Test(data, GoodnessOfFit.Distributions.Normal);
3569
- let RJ = Distributions.Normal.RyanJoiner.Test(data);
3570
- let KS = Distributions.Normal.KolmogorovSmirnov(data);
3571
3569
  let JB = Distributions.Normal.JarqueBera(data);
3570
+ let KS = Distributions.Normal.KolmogorovSmirnov(data);
3571
+ let LF = Distributions.Normal.Lilliefors.Test(data);
3572
+ let RJ = Distributions.Normal.RyanJoiner.Test(data);
3573
+ let SWR = Distributions.Normal.ShapiroWilk.Royston(data);
3572
3574
  let ctx = chart.getContext("2d");
3573
3575
  if (ctx) {
3574
- AddInfoTable(ctx, [{ key: "AD:", value: AD.AD }, { key: "p-value:", value: AD.p }, { key: "", value: "" }, { key: "RJ:", value: RJ.RJ }, { key: "crit.:", value: RJ.critical }, { key: "", value: "" }, { key: "KS:", value: KS.KS }, { key: "p-value:", value: KS.p }, { key: "", value: "" }, { key: "JB:", value: JB.JB }, { key: "p-value:", value: JB.p }], 1075, 150, 175, 100, "", 30);
3576
+ AddInfoTable(ctx, [
3577
+ { key: "AD:", value: AD.AD },
3578
+ { key: "p-value:", value: AD.p },
3579
+ { key: "", value: "" },
3580
+ { key: "JB:", value: JB.JB },
3581
+ { key: "p-value:", value: JB.p },
3582
+ { key: "", value: "" },
3583
+ { key: "KS:", value: KS.KS },
3584
+ { key: "p-value:", value: KS.p },
3585
+ { key: "", value: "" },
3586
+ { key: "Lf:", value: LF.KS },
3587
+ { key: "p-value:", value: LF.p },
3588
+ { key: "", value: "" },
3589
+ { key: "RJ:", value: RJ.RJ },
3590
+ { key: "crit.:", value: RJ.critical },
3591
+ { key: "", value: "" },
3592
+ { key: "SW(R):", value: SWR.W },
3593
+ { key: "p-value:", value: SWR.p },
3594
+ { key: "", value: "" }
3595
+ ], 1075, 50, 175, 100, "", 30);
3575
3596
  }
3576
3597
  } else {
3577
3598
  let dist = distribution.replace("-", "").replace("arameter", "").replace(/\s/g, "");
@@ -3617,6 +3638,30 @@ function QQDistributionModificationX(p, distribution, data) {
3617
3638
  }
3618
3639
  return p;
3619
3640
  }
3641
+ function CreateControlChart(data, chartTitle, UCL, LCL) {
3642
+ let centerline = Mean(data);
3643
+ let std = StDev.S(data);
3644
+ if (UCL === void 0) {
3645
+ UCL = centerline + 3 * std;
3646
+ }
3647
+ if (LCL === void 0) {
3648
+ LCL = centerline - 3 * std;
3649
+ }
3650
+ let dataSet = new DataSet(data.map((d, i) => {
3651
+ return new Point(i, d);
3652
+ }));
3653
+ dataSet.line.type = "straight";
3654
+ let customGridlines = [
3655
+ new CustomGridline(centerline, `x\u0304 = ${Math.round(centerline * 1e3) / 1e3}`, new CanvasDrawSettings("", "green"), void 0, true),
3656
+ new CustomGridline(LCL, `LCL = ${Math.round(LCL * 1e3) / 1e3}`, new CanvasDrawSettings("", "maroon"), void 0, true),
3657
+ new CustomGridline(UCL, `UCL = ${Math.round(UCL * 1e3) / 1e3}`, new CanvasDrawSettings("", "maroon"), void 0, true)
3658
+ ];
3659
+ let chartSettings = new ChartSettings();
3660
+ chartSettings.axis.y.customGridlines = customGridlines;
3661
+ MarkOutOfControl(dataSet, UCL, LCL, centerline, std);
3662
+ let graph = CreateScatterPlot([dataSet], chartTitle, chartSettings);
3663
+ return graph;
3664
+ }
3620
3665
  function AnovaTableTwoWay(data, interaction) {
3621
3666
  let ANOVA;
3622
3667
  if (!interaction) {
@@ -4295,6 +4340,7 @@ export {
4295
4340
  CreateCapabilityPlot,
4296
4341
  CreateCategoricalBarGraph,
4297
4342
  CreateContinuousBarGraph,
4343
+ CreateControlChart,
4298
4344
  CreateScatterPlot,
4299
4345
  CreateSplitGraph,
4300
4346
  CreateStackedChart,
package/index.ts CHANGED
@@ -4165,12 +4165,20 @@ export function QQPlotChart(data: number[], distribution: string = 'Normal'){
4165
4165
 
4166
4166
  if (distribution.toLowerCase() === "normal" || distribution.toLowerCase().includes("boxcox")) {
4167
4167
  let AD = GoodnessOfFit.AndersonDarling.Test(data, GoodnessOfFit.Distributions.Normal);
4168
- let RJ = Distributions.Normal.RyanJoiner.Test(data);
4169
- let KS = Distributions.Normal.KolmogorovSmirnov(data);
4170
4168
  let JB = Distributions.Normal.JarqueBera(data);
4169
+ let KS = Distributions.Normal.KolmogorovSmirnov(data);
4170
+ let LF = Distributions.Normal.Lilliefors.Test(data);
4171
+ let RJ = Distributions.Normal.RyanJoiner.Test(data);
4172
+ let SWR = Distributions.Normal.ShapiroWilk.Royston(data);
4171
4173
  let ctx = chart.getContext("2d");
4172
4174
  if(ctx){
4173
- AddInfoTable(ctx, [{ key: "AD:", value: AD.AD }, { key: "p-value:", value: AD.p }, { key: "", value: '' }, { key: "RJ:", value: RJ.RJ }, { key: "crit.:", value: RJ.critical }, { key: "", value: "" }, { key: "KS:", value: KS.KS }, { key: "p-value:", value: KS.p }, { key: "", value: "" }, { key: "JB:", value: JB.JB }, { key: "p-value:", value: JB.p }], 1075, 150, 175, 100, "", 30);
4175
+ AddInfoTable(ctx, [
4176
+ { key: "AD:", value: AD.AD }, { key: "p-value:", value: AD.p }, { key: "", value: '' },
4177
+ { key: "JB:", value: JB.JB }, { key: "p-value:", value: JB.p }, { key: "", value: "" },
4178
+ { key: "KS:", value: KS.KS }, { key: "p-value:", value: KS.p }, { key: "", value: "" },
4179
+ { key: "Lf:", value: LF.KS }, { key: "p-value:", value: LF.p }, { key: "", value: "" },
4180
+ { key: "RJ:", value: RJ.RJ }, { key: "crit.:", value: RJ.critical }, { key: "", value: "" },
4181
+ { key: "SW(R):", value: SWR.W }, { key: "p-value:", value: SWR.p }, { key: "", value: "" },], 1075, 50, 175, 100, "", 30);
4174
4182
  }
4175
4183
  }else{
4176
4184
  let dist = distribution.replace("-", "").replace("arameter", "").replace(/\s/g, "");
@@ -4238,7 +4246,7 @@ function QQDistributionModificationX(p: number, distribution: string, data: numb
4238
4246
  return p;
4239
4247
  }
4240
4248
 
4241
- function CreateControlChart(data: number[], chartTitle?: string, UCL?: number, LCL?: number){
4249
+ export function CreateControlChart(data: number[], chartTitle?: string, UCL?: number, LCL?: number){
4242
4250
  let centerline = Mean(data);
4243
4251
  let std = StDev.S(data);
4244
4252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qesuite",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
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,3 @@
1
+ - include export for CreateControlChart();
2
+ - include Shapiro-Wilk (Royston) and Lilliefors in QQPlot for normality
3
+ - alphabetized the order of normality results table on QQPlot by test name
@@ -0,0 +1 @@
1
+ - adjust normality results chart location on qqplot