@things-factory/spc 7.0.0-alpha.6
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/CHANGELOG.md +8 -0
- package/client/bootstrap.ts +1 -0
- package/client/index.ts +0 -0
- package/client/pages/spc-chart-page.ts +118 -0
- package/client/route.ts +7 -0
- package/client/tsconfig.json +13 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/spc-chart-page.d.ts +26 -0
- package/dist-client/pages/spc-chart-page.js +121 -0
- package/dist-client/pages/spc-chart-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +8 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/data-use-case-spc.js +40 -0
- package/dist-server/controllers/data-use-case-spc.js.map +1 -0
- package/dist-server/controllers/index.js +5 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/c.js +21 -0
- package/dist-server/controllers/spc-/bchart/c.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/histogram.js +27 -0
- package/dist-server/controllers/spc-/bchart/histogram.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/i.js +23 -0
- package/dist-server/controllers/spc-/bchart/i.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/index.js +172 -0
- package/dist-server/controllers/spc-/bchart/index.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/mr.js +24 -0
- package/dist-server/controllers/spc-/bchart/mr.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/np.js +23 -0
- package/dist-server/controllers/spc-/bchart/np.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/p.js +22 -0
- package/dist-server/controllers/spc-/bchart/p.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/pareto.js +25 -0
- package/dist-server/controllers/spc-/bchart/pareto.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/r.js +27 -0
- package/dist-server/controllers/spc-/bchart/r.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/u.js +24 -0
- package/dist-server/controllers/spc-/bchart/u.js.map +1 -0
- package/dist-server/controllers/spc-/bchart/x-bar.js +50 -0
- package/dist-server/controllers/spc-/bchart/x-bar.js.map +1 -0
- package/dist-server/index.js +11 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/service/index.js +21 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/spc-chart/index.js +8 -0
- package/dist-server/service/spc-chart/index.js.map +1 -0
- package/dist-server/service/spc-chart/spc-chart-query.js +198 -0
- package/dist-server/service/spc-chart/spc-chart-query.js.map +1 -0
- package/dist-server/service/spc-chart/spc-chart-type.js +148 -0
- package/dist-server/service/spc-chart/spc-chart-type.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/spc/spc-chart-concept.md +59 -0
- package/helps/spc/spc-chart.md +68 -0
- package/package.json +36 -0
- package/server/controllers/data-use-case-spc.ts +44 -0
- package/server/controllers/index.ts +1 -0
- package/server/controllers/spc-/bchart/c.ts +31 -0
- package/server/controllers/spc-/bchart/histogram.ts +40 -0
- package/server/controllers/spc-/bchart/i.ts +35 -0
- package/server/controllers/spc-/bchart/index.ts +171 -0
- package/server/controllers/spc-/bchart/mr.ts +37 -0
- package/server/controllers/spc-/bchart/np.ts +35 -0
- package/server/controllers/spc-/bchart/p.ts +34 -0
- package/server/controllers/spc-/bchart/pareto.ts +34 -0
- package/server/controllers/spc-/bchart/r.ts +40 -0
- package/server/controllers/spc-/bchart/u.ts +36 -0
- package/server/controllers/spc-/bchart/x-bar.ts +70 -0
- package/server/index.ts +10 -0
- package/server/service/index.ts +21 -0
- package/server/service/spc-chart/index.ts +5 -0
- package/server/service/spc-chart/spc-chart-query.ts +192 -0
- package/server/service/spc-chart/spc-chart-type.ts +103 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +11 -0
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpcChartQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const dataset_1 = require("@things-factory/dataset");
|
|
7
|
+
const spc_chart_type_1 = require("./spc-chart-type");
|
|
8
|
+
let SpcChartQuery = class SpcChartQuery {
|
|
9
|
+
async spcChart(dataSetId, startDate, endDate, variable, context) {
|
|
10
|
+
const { domain } = context.state;
|
|
11
|
+
return {
|
|
12
|
+
dataSet: {
|
|
13
|
+
id: 'aaa',
|
|
14
|
+
name: 'bbb'
|
|
15
|
+
},
|
|
16
|
+
analysisResults: [
|
|
17
|
+
{
|
|
18
|
+
chartType: 'X-bar',
|
|
19
|
+
variables: [
|
|
20
|
+
{
|
|
21
|
+
name: 'variable1',
|
|
22
|
+
stats: {
|
|
23
|
+
mean: 22,
|
|
24
|
+
UCL: 25,
|
|
25
|
+
LCL: 19,
|
|
26
|
+
CL: 22
|
|
27
|
+
},
|
|
28
|
+
samples: [
|
|
29
|
+
{ sampleId: '1', value: 22 },
|
|
30
|
+
{ sampleId: '2', value: 23 }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
chartType: 'R',
|
|
37
|
+
variables: [
|
|
38
|
+
{
|
|
39
|
+
name: 'variable2',
|
|
40
|
+
stats: {
|
|
41
|
+
range: 1.3,
|
|
42
|
+
UCL: 2.1,
|
|
43
|
+
LCL: 0.5,
|
|
44
|
+
CL: 1.3
|
|
45
|
+
},
|
|
46
|
+
samples: [
|
|
47
|
+
{ sampleId: '1', value: 1.2 },
|
|
48
|
+
{ sampleId: '2', value: 1.3 }
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
chartType: 'p',
|
|
55
|
+
variables: [
|
|
56
|
+
{
|
|
57
|
+
name: 'variable3',
|
|
58
|
+
stats: {
|
|
59
|
+
proportion: 0.05,
|
|
60
|
+
UCL: 0.1,
|
|
61
|
+
LCL: 0.01
|
|
62
|
+
},
|
|
63
|
+
samples: [
|
|
64
|
+
{ sampleId: '1', value: 0.05 },
|
|
65
|
+
{ sampleId: '2', value: 0.06 }
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
chartType: 'np',
|
|
72
|
+
variables: [
|
|
73
|
+
{
|
|
74
|
+
name: 'variable4',
|
|
75
|
+
stats: {
|
|
76
|
+
nonconforming: 5,
|
|
77
|
+
UCL: 10,
|
|
78
|
+
LCL: 1
|
|
79
|
+
},
|
|
80
|
+
samples: [
|
|
81
|
+
{ sampleId: '1', value: 5 },
|
|
82
|
+
{ sampleId: '2', value: 4 }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
chartType: 'c',
|
|
89
|
+
variables: [
|
|
90
|
+
{
|
|
91
|
+
name: 'variable5',
|
|
92
|
+
stats: {
|
|
93
|
+
count: 20,
|
|
94
|
+
UCL: 25,
|
|
95
|
+
LCL: 15
|
|
96
|
+
},
|
|
97
|
+
samples: [
|
|
98
|
+
{ sampleId: '1', value: 20 },
|
|
99
|
+
{ sampleId: '2', value: 21 }
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
chartType: 'u',
|
|
106
|
+
variables: [
|
|
107
|
+
{
|
|
108
|
+
name: 'variable6',
|
|
109
|
+
stats: {
|
|
110
|
+
defectsPerUnit: 1.2,
|
|
111
|
+
UCL: 1.5,
|
|
112
|
+
LCL: 0.9
|
|
113
|
+
},
|
|
114
|
+
samples: [
|
|
115
|
+
{ sampleId: '1', value: 1.2 },
|
|
116
|
+
{ sampleId: '2', value: 1.1 }
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
chartType: 'I',
|
|
123
|
+
variables: [
|
|
124
|
+
{
|
|
125
|
+
name: 'variable7',
|
|
126
|
+
stats: {
|
|
127
|
+
individualValue: 10,
|
|
128
|
+
UCL: 12,
|
|
129
|
+
LCL: 8
|
|
130
|
+
},
|
|
131
|
+
samples: [
|
|
132
|
+
{ sampleId: '1', value: 10 },
|
|
133
|
+
{ sampleId: '2', value: 11 }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
chartType: 'MR',
|
|
140
|
+
variables: [
|
|
141
|
+
{
|
|
142
|
+
name: 'variable8',
|
|
143
|
+
stats: {
|
|
144
|
+
movingRange: 2,
|
|
145
|
+
UCL: 3,
|
|
146
|
+
LCL: 1
|
|
147
|
+
},
|
|
148
|
+
samples: [
|
|
149
|
+
{ sampleId: '1', value: 2 },
|
|
150
|
+
{ sampleId: '2', value: 2.5 }
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
chartType: 'Histogram',
|
|
157
|
+
variables: [
|
|
158
|
+
{
|
|
159
|
+
name: 'variable9',
|
|
160
|
+
bins: [
|
|
161
|
+
{ binRange: '0-1', count: 5 },
|
|
162
|
+
{ binRange: '1-2', count: 10 }
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
chartType: 'Pareto',
|
|
169
|
+
variables: [
|
|
170
|
+
{
|
|
171
|
+
name: 'defectType',
|
|
172
|
+
categories: [
|
|
173
|
+
{ category: 'Scratch', count: 20 },
|
|
174
|
+
{ category: 'Dent', count: 15 }
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
tslib_1.__decorate([
|
|
184
|
+
(0, type_graphql_1.Query)(returns => spc_chart_type_1.AnalysisResult, { nullable: true, description: 'To fetch a SpcChart' }),
|
|
185
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('dataSetId')),
|
|
186
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('startDate')),
|
|
187
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('endDate')),
|
|
188
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('variable')),
|
|
189
|
+
tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
|
|
190
|
+
tslib_1.__metadata("design:type", Function),
|
|
191
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, Object]),
|
|
192
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
193
|
+
], SpcChartQuery.prototype, "spcChart", null);
|
|
194
|
+
SpcChartQuery = tslib_1.__decorate([
|
|
195
|
+
(0, type_graphql_1.Resolver)(dataset_1.DataSet)
|
|
196
|
+
], SpcChartQuery);
|
|
197
|
+
exports.SpcChartQuery = SpcChartQuery;
|
|
198
|
+
//# sourceMappingURL=spc-chart-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spc-chart-query.js","sourceRoot":"","sources":["../../../server/service/spc-chart/spc-chart-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAI9F,qDAAiD;AAEjD,qDAAiD;AAG1C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAElB,AAAN,KAAK,CAAC,QAAQ,CACM,SAAiB,EACjB,SAAiB,EACnB,OAAe,EACd,QAAgB,EA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AW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,EAAC,SAAS,CAAC,CAAA;IACd,mBAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;IACf,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6CA8KP;AArLU,aAAa;IADzB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,aAAa,CAsLzB;AAtLY,sCAAa","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { DataSet } from '@things-factory/dataset'\n\nimport { AnalysisResult } from './spc-chart-type'\n\n@Resolver(DataSet)\nexport class SpcChartQuery {\n @Query(returns => AnalysisResult!, { nullable: true, description: 'To fetch a SpcChart' })\n async spcChart(\n @Arg('dataSetId') dataSetId: string,\n @Arg('startDate') startDate: string,\n @Arg('endDate') endDate: string,\n @Arg('variable') variable: string,\n @Ctx() context: ResolverContext\n ): Promise<AnalysisResult> {\n const { domain } = context.state\n\n return {\n dataSet: {\n id: 'aaa',\n name: 'bbb'\n },\n analysisResults: [\n {\n chartType: 'X-bar',\n variables: [\n {\n name: 'variable1',\n stats: {\n mean: 22,\n UCL: 25,\n LCL: 19,\n CL: 22\n },\n samples: [\n { sampleId: '1', value: 22 },\n { sampleId: '2', value: 23 }\n ]\n }\n ]\n },\n {\n chartType: 'R',\n variables: [\n {\n name: 'variable2',\n stats: {\n range: 1.3,\n UCL: 2.1,\n LCL: 0.5,\n CL: 1.3\n },\n samples: [\n { sampleId: '1', value: 1.2 },\n { sampleId: '2', value: 1.3 }\n ]\n }\n ]\n },\n {\n chartType: 'p',\n variables: [\n {\n name: 'variable3',\n stats: {\n proportion: 0.05,\n UCL: 0.1,\n LCL: 0.01\n },\n samples: [\n { sampleId: '1', value: 0.05 },\n { sampleId: '2', value: 0.06 }\n ]\n }\n ]\n },\n {\n chartType: 'np',\n variables: [\n {\n name: 'variable4',\n stats: {\n nonconforming: 5,\n UCL: 10,\n LCL: 1\n },\n samples: [\n { sampleId: '1', value: 5 },\n { sampleId: '2', value: 4 }\n ]\n }\n ]\n },\n {\n chartType: 'c',\n variables: [\n {\n name: 'variable5',\n stats: {\n count: 20,\n UCL: 25,\n LCL: 15\n },\n samples: [\n { sampleId: '1', value: 20 },\n { sampleId: '2', value: 21 }\n ]\n }\n ]\n },\n {\n chartType: 'u',\n variables: [\n {\n name: 'variable6',\n stats: {\n defectsPerUnit: 1.2,\n UCL: 1.5,\n LCL: 0.9\n },\n samples: [\n { sampleId: '1', value: 1.2 },\n { sampleId: '2', value: 1.1 }\n ]\n }\n ]\n },\n {\n chartType: 'I',\n variables: [\n {\n name: 'variable7',\n stats: {\n individualValue: 10,\n UCL: 12,\n LCL: 8\n },\n samples: [\n { sampleId: '1', value: 10 },\n { sampleId: '2', value: 11 }\n ]\n }\n ]\n },\n {\n chartType: 'MR',\n variables: [\n {\n name: 'variable8',\n stats: {\n movingRange: 2,\n UCL: 3,\n LCL: 1\n },\n samples: [\n { sampleId: '1', value: 2 },\n { sampleId: '2', value: 2.5 }\n ]\n }\n ]\n },\n {\n chartType: 'Histogram',\n variables: [\n {\n name: 'variable9',\n bins: [\n { binRange: '0-1', count: 5 },\n { binRange: '1-2', count: 10 }\n ]\n }\n ]\n },\n {\n chartType: 'Pareto',\n variables: [\n {\n name: 'defectType',\n categories: [\n { category: 'Scratch', count: 20 },\n { category: 'Dent', count: 15 }\n ]\n }\n ]\n }\n ]\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AnalysisResult = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const dataset_1 = require("@things-factory/dataset");
|
|
8
|
+
let Sample = class Sample {
|
|
9
|
+
};
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], Sample.prototype, "sampleId", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)(),
|
|
16
|
+
tslib_1.__metadata("design:type", Number)
|
|
17
|
+
], Sample.prototype, "value", void 0);
|
|
18
|
+
Sample = tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.ObjectType)()
|
|
20
|
+
], Sample);
|
|
21
|
+
let Stats = class Stats {
|
|
22
|
+
};
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
|
+
], Stats.prototype, "mean", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", Number)
|
|
30
|
+
], Stats.prototype, "UCL", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", Number)
|
|
34
|
+
], Stats.prototype, "LCL", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", Number)
|
|
38
|
+
], Stats.prototype, "CL", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
41
|
+
tslib_1.__metadata("design:type", Number)
|
|
42
|
+
], Stats.prototype, "range", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", Number)
|
|
46
|
+
], Stats.prototype, "proportion", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
49
|
+
tslib_1.__metadata("design:type", Number)
|
|
50
|
+
], Stats.prototype, "nonconforming", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
53
|
+
tslib_1.__metadata("design:type", Number)
|
|
54
|
+
], Stats.prototype, "defectsPerUnit", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", Number)
|
|
58
|
+
], Stats.prototype, "individualValue", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
|
|
61
|
+
tslib_1.__metadata("design:type", Number)
|
|
62
|
+
], Stats.prototype, "movingRange", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
65
|
+
tslib_1.__metadata("design:type", Number)
|
|
66
|
+
], Stats.prototype, "count", void 0);
|
|
67
|
+
Stats = tslib_1.__decorate([
|
|
68
|
+
(0, type_graphql_1.ObjectType)()
|
|
69
|
+
], Stats);
|
|
70
|
+
let Variable = class Variable {
|
|
71
|
+
};
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.Field)(),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], Variable.prototype, "name", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.Field)(type => Stats),
|
|
78
|
+
tslib_1.__metadata("design:type", Stats)
|
|
79
|
+
], Variable.prototype, "stats", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, type_graphql_1.Field)(type => [Sample]),
|
|
82
|
+
tslib_1.__metadata("design:type", Array)
|
|
83
|
+
], Variable.prototype, "samples", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.Field)(type => [Bin], { nullable: true }),
|
|
86
|
+
tslib_1.__metadata("design:type", Array)
|
|
87
|
+
], Variable.prototype, "bins", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, type_graphql_1.Field)(type => [Category], { nullable: true }),
|
|
90
|
+
tslib_1.__metadata("design:type", Array)
|
|
91
|
+
], Variable.prototype, "categories", void 0);
|
|
92
|
+
Variable = tslib_1.__decorate([
|
|
93
|
+
(0, type_graphql_1.ObjectType)()
|
|
94
|
+
], Variable);
|
|
95
|
+
let Bin = class Bin {
|
|
96
|
+
};
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, type_graphql_1.Field)(),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], Bin.prototype, "binRange", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, type_graphql_1.Field)(),
|
|
103
|
+
tslib_1.__metadata("design:type", Number)
|
|
104
|
+
], Bin.prototype, "count", void 0);
|
|
105
|
+
Bin = tslib_1.__decorate([
|
|
106
|
+
(0, type_graphql_1.ObjectType)()
|
|
107
|
+
], Bin);
|
|
108
|
+
let Category = class Category {
|
|
109
|
+
};
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, type_graphql_1.Field)(),
|
|
112
|
+
tslib_1.__metadata("design:type", String)
|
|
113
|
+
], Category.prototype, "category", void 0);
|
|
114
|
+
tslib_1.__decorate([
|
|
115
|
+
(0, type_graphql_1.Field)(),
|
|
116
|
+
tslib_1.__metadata("design:type", Number)
|
|
117
|
+
], Category.prototype, "count", void 0);
|
|
118
|
+
Category = tslib_1.__decorate([
|
|
119
|
+
(0, type_graphql_1.ObjectType)()
|
|
120
|
+
], Category);
|
|
121
|
+
let ChartAnalysis = class ChartAnalysis {
|
|
122
|
+
};
|
|
123
|
+
tslib_1.__decorate([
|
|
124
|
+
(0, type_graphql_1.Field)(),
|
|
125
|
+
tslib_1.__metadata("design:type", String)
|
|
126
|
+
], ChartAnalysis.prototype, "chartType", void 0);
|
|
127
|
+
tslib_1.__decorate([
|
|
128
|
+
(0, type_graphql_1.Field)(type => [Variable]),
|
|
129
|
+
tslib_1.__metadata("design:type", Array)
|
|
130
|
+
], ChartAnalysis.prototype, "variables", void 0);
|
|
131
|
+
ChartAnalysis = tslib_1.__decorate([
|
|
132
|
+
(0, type_graphql_1.ObjectType)()
|
|
133
|
+
], ChartAnalysis);
|
|
134
|
+
let AnalysisResult = class AnalysisResult {
|
|
135
|
+
};
|
|
136
|
+
tslib_1.__decorate([
|
|
137
|
+
(0, type_graphql_1.Field)(type => dataset_1.DataSet),
|
|
138
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof dataset_1.DataSet !== "undefined" && dataset_1.DataSet) === "function" ? _a : Object)
|
|
139
|
+
], AnalysisResult.prototype, "dataSet", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, type_graphql_1.Field)(type => [ChartAnalysis]),
|
|
142
|
+
tslib_1.__metadata("design:type", Array)
|
|
143
|
+
], AnalysisResult.prototype, "analysisResults", void 0);
|
|
144
|
+
AnalysisResult = tslib_1.__decorate([
|
|
145
|
+
(0, type_graphql_1.ObjectType)()
|
|
146
|
+
], AnalysisResult);
|
|
147
|
+
exports.AnalysisResult = AnalysisResult;
|
|
148
|
+
//# sourceMappingURL=spc-chart-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spc-chart-type.js","sourceRoot":"","sources":["../../../server/service/spc-chart/spc-chart-type.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oBAAK,GAAE;;0CACQ;AAEhB;IAAC,IAAA,oBAAK,GAAE;;uCACK;AALT,QAAQ;IADb,IAAA,yBAAU,GAAE;GACP,QAAQ,CAMb;AAGD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMlB,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;gDACS;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;;gDACL;AALjB,aAAa;IADlB,IAAA,yBAAU,GAAE;GACP,aAAa,CAMlB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,CAAC;0DACd,iBAAO,oBAAP,iBAAO;+CAAA;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;;uDACC;AALrB,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { ObjectType, Field, ID, Int, Float } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\nimport { DataSet } from '@things-factory/dataset'\n\n@ObjectType()\nclass Sample {\n @Field(type => ID)\n sampleId: string\n\n @Field()\n value: number\n}\n\n@ObjectType()\nclass Stats {\n @Field(type => Float, { nullable: true })\n mean?: number\n\n @Field(type => Float, { nullable: true })\n UCL?: number\n\n @Field(type => Float, { nullable: true })\n LCL?: number\n\n @Field(type => Float, { nullable: true })\n CL?: number\n\n @Field(type => Float, { nullable: true })\n range?: number\n\n @Field(type => Float, { nullable: true })\n proportion?: number\n\n @Field(type => Float, { nullable: true })\n nonconforming?: number\n\n @Field(type => Float, { nullable: true })\n defectsPerUnit?: number\n\n @Field(type => Float, { nullable: true })\n individualValue?: number\n\n @Field(type => Float, { nullable: true })\n movingRange?: number\n\n @Field(type => Int, { nullable: true })\n count?: number\n}\n\n@ObjectType()\nclass Variable {\n @Field()\n name: string\n\n @Field(type => Stats)\n stats?: Stats\n\n @Field(type => [Sample])\n samples?: Sample[]\n\n @Field(type => [Bin], { nullable: true })\n bins?: Bin[]\n\n @Field(type => [Category], { nullable: true })\n categories?: Category[]\n}\n\n@ObjectType()\nclass Bin {\n @Field()\n binRange: string\n\n @Field()\n count: number\n}\n\n@ObjectType()\nclass Category {\n @Field()\n category: string\n\n @Field()\n count: number\n}\n\n@ObjectType()\nclass ChartAnalysis {\n @Field()\n chartType: string\n\n @Field(type => [Variable])\n variables: Variable[]\n}\n\n@ObjectType()\nexport class AnalysisResult {\n @Field(type => DataSet)\n dataSet: DataSet\n\n @Field(type => [ChartAnalysis])\n analysisResults: ChartAnalysis[]\n}\n"]}
|