qesuite 1.0.26 → 1.0.28

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
@@ -165,7 +165,7 @@ declare class GRRReplication {
165
165
  getPartCount(): number;
166
166
  }
167
167
  declare function ObjectToArray(object: any): any[];
168
- declare function RoundTO(number: number, digits: number): number;
168
+ declare function RoundTO(number: number, digits: number): string | number;
169
169
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170
170
  */
171
171
  declare const Capability: {
package/dist/index.d.ts CHANGED
@@ -165,7 +165,7 @@ declare class GRRReplication {
165
165
  getPartCount(): number;
166
166
  }
167
167
  declare function ObjectToArray(object: any): any[];
168
- declare function RoundTO(number: number, digits: number): number;
168
+ declare function RoundTO(number: number, digits: number): string | number;
169
169
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170
170
  */
171
171
  declare const Capability: {
package/dist/index.js CHANGED
@@ -497,7 +497,11 @@ function ObjectToArray(object) {
497
497
  }
498
498
  function RoundTO(number, digits) {
499
499
  if (number === 0) {
500
- return;
500
+ let str2 = number.toString();
501
+ for (let i2 = 0; i2 < digits; i2++) {
502
+ str2.concat("0");
503
+ }
504
+ return str2;
501
505
  }
502
506
  let str = number.toString();
503
507
  let decimalIndex = str.indexOf(".");
@@ -727,11 +731,13 @@ function CreateCapabilityHistogram(data, specification) {
727
731
  function CreateCapabilityPlot(data, specification) {
728
732
  let capability = Capability.Analysis(data, specification);
729
733
  let chartSettings = new ChartSettings();
734
+ chartSettings.width = 1300;
730
735
  let canvas = CreateCanvas(chartSettings.width, chartSettings.height);
731
736
  let ctx = canvas.getContext("2d");
732
737
  if (!ctx) {
733
738
  return canvas;
734
739
  }
740
+ ctx.strokeRect(0, 0, chartSettings.width, chartSettings.height);
735
741
  AddChartTitle(ctx, chartSettings, "Capability Plot");
736
742
  let withinInfo = [
737
743
  {
@@ -747,7 +753,7 @@ function CreateCapabilityPlot(data, specification) {
747
753
  value: capability.Cpk
748
754
  }
749
755
  ];
750
- AddInfoTable(ctx, withinInfo, 0, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
756
+ AddInfoTable(ctx, withinInfo, 20, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
751
757
  let overallInfo = [
752
758
  {
753
759
  key: "StDev",
@@ -762,7 +768,7 @@ function CreateCapabilityPlot(data, specification) {
762
768
  value: capability.Ppk
763
769
  }
764
770
  ];
765
- AddInfoTable(ctx, overallInfo, 3 * chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 3, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
771
+ AddInfoTable(ctx, overallInfo, 3 * chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
766
772
  const mean = Mean(data);
767
773
  AddLinePlot(ctx, specification.LSL, specification.USL, mean, [mean - 3 * overallInfo[0].value, mean + 3 * overallInfo[0].value], chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 2, (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3 - 10, "Overall");
768
774
  AddLinePlot(ctx, specification.LSL, specification.USL, mean, [mean - 3 * withinInfo[0].value, mean + 3 * withinInfo[0].value], chartSettings.width / 4, chartSettings.margins.top + 40 + (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3, chartSettings.width / 2, (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3 - 10, "Within");
package/dist/index.mjs CHANGED
@@ -410,7 +410,11 @@ function ObjectToArray(object) {
410
410
  }
411
411
  function RoundTO(number, digits) {
412
412
  if (number === 0) {
413
- return;
413
+ let str2 = number.toString();
414
+ for (let i2 = 0; i2 < digits; i2++) {
415
+ str2.concat("0");
416
+ }
417
+ return str2;
414
418
  }
415
419
  let str = number.toString();
416
420
  let decimalIndex = str.indexOf(".");
@@ -640,11 +644,13 @@ function CreateCapabilityHistogram(data, specification) {
640
644
  function CreateCapabilityPlot(data, specification) {
641
645
  let capability = Capability.Analysis(data, specification);
642
646
  let chartSettings = new ChartSettings();
647
+ chartSettings.width = 1300;
643
648
  let canvas = CreateCanvas(chartSettings.width, chartSettings.height);
644
649
  let ctx = canvas.getContext("2d");
645
650
  if (!ctx) {
646
651
  return canvas;
647
652
  }
653
+ ctx.strokeRect(0, 0, chartSettings.width, chartSettings.height);
648
654
  AddChartTitle(ctx, chartSettings, "Capability Plot");
649
655
  let withinInfo = [
650
656
  {
@@ -660,7 +666,7 @@ function CreateCapabilityPlot(data, specification) {
660
666
  value: capability.Cpk
661
667
  }
662
668
  ];
663
- AddInfoTable(ctx, withinInfo, 0, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
669
+ AddInfoTable(ctx, withinInfo, 20, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
664
670
  let overallInfo = [
665
671
  {
666
672
  key: "StDev",
@@ -675,7 +681,7 @@ function CreateCapabilityPlot(data, specification) {
675
681
  value: capability.Ppk
676
682
  }
677
683
  ];
678
- AddInfoTable(ctx, overallInfo, 3 * chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 3, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
684
+ AddInfoTable(ctx, overallInfo, 3 * chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
679
685
  const mean = Mean(data);
680
686
  AddLinePlot(ctx, specification.LSL, specification.USL, mean, [mean - 3 * overallInfo[0].value, mean + 3 * overallInfo[0].value], chartSettings.width / 4, chartSettings.margins.top, chartSettings.width / 2, (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3 - 10, "Overall");
681
687
  AddLinePlot(ctx, specification.LSL, specification.USL, mean, [mean - 3 * withinInfo[0].value, mean + 3 * withinInfo[0].value], chartSettings.width / 4, chartSettings.margins.top + 40 + (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3, chartSettings.width / 2, (chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom) / 3 - 10, "Within");
package/index.ts CHANGED
@@ -470,8 +470,14 @@ export function ObjectToArray(object: any){
470
470
  return returnArray;
471
471
  }
472
472
 
473
- export function RoundTO(number: number, digits: number){
474
- if(number === 0){return}
473
+ export function RoundTO(number: number, digits: number){
474
+ if(number === 0){
475
+ let str = number.toString();
476
+ for(let i = 0; i < digits; i++){
477
+ str.concat("0");
478
+ }
479
+ return str
480
+ }
475
481
  let str = number.toString();
476
482
  let decimalIndex = str.indexOf('.');
477
483
  let returner = Number(str.substring(0, decimalIndex + digits + 1));
@@ -750,11 +756,12 @@ export function CreateCapabilityPlot(data: number[], specification: Specificatio
750
756
  let capability = Capability.Analysis(data, specification);
751
757
 
752
758
  // Create Chart
753
- let chartSettings = new ChartSettings();
759
+ let chartSettings = new ChartSettings();
760
+ chartSettings.width = 1300;
754
761
  let canvas = CreateCanvas(chartSettings.width, chartSettings.height);
755
762
  let ctx = canvas.getContext("2d");
756
763
  if(!ctx){return canvas}
757
-
764
+ ctx.strokeRect(0,0,chartSettings.width, chartSettings.height)
758
765
  // Add Title
759
766
  AddChartTitle(ctx, chartSettings, "Capability Plot")
760
767
 
@@ -773,7 +780,7 @@ export function CreateCapabilityPlot(data: number[], specification: Specificatio
773
780
  value: capability.Cpk
774
781
  }
775
782
  ]
776
- AddInfoTable(ctx, withinInfo, 0, chartSettings.margins.top, chartSettings.width/4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
783
+ AddInfoTable(ctx, withinInfo, 20, chartSettings.margins.top, chartSettings.width/4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Within");
777
784
 
778
785
  // Add Overall Information
779
786
  let overallInfo = [
@@ -790,7 +797,7 @@ export function CreateCapabilityPlot(data: number[], specification: Specificatio
790
797
  value: capability.Ppk
791
798
  }
792
799
  ]
793
- AddInfoTable(ctx, overallInfo, 3*chartSettings.width/4, chartSettings.margins.top, chartSettings.width/3, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
800
+ AddInfoTable(ctx, overallInfo, 3*chartSettings.width/4, chartSettings.margins.top, chartSettings.width/4, chartSettings.height - chartSettings.margins.top - chartSettings.margins.bottom, "Overall");
794
801
 
795
802
  const mean = Mean(data);
796
803
  // Add Overall Line Plot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qesuite",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
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,2 @@
1
+ Fixed Bug in RoundTO() that caused 0 to return undefined.
2
+ Changed formatting in Capability.SixPack.CapabilityPlot to display the entire "overall table"
@@ -0,0 +1 @@
1
+ Rebuild of 1.0.27; see 1_0_27.md for details