@dssp/dkpi 1.0.0-alpha.50 → 1.0.0-alpha.51
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-client/components/kpi-boxplot-chart.d.ts +24 -0
- package/dist-client/components/kpi-boxplot-chart.js +328 -0
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-radar-chart.d.ts +16 -0
- package/dist-client/components/kpi-radar-chart.js +139 -0
- package/dist-client/components/kpi-radar-chart.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +3 -1
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +25 -12
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +6 -3
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +101 -92
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -1
- package/dist-client/pages/sv-project-complete.d.ts +0 -2
- package/dist-client/pages/sv-project-complete.js +14 -20
- package/dist-client/pages/sv-project-complete.js.map +1 -1
- package/dist-client/pages/sv-project-detail.d.ts +3 -0
- package/dist-client/pages/sv-project-detail.js +98 -34
- package/dist-client/pages/sv-project-detail.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +4 -1
- package/dist-client/shared/complete-api.js +68 -16
- package/dist-client/shared/complete-api.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +2 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +28 -20
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/schema.graphql +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiBoxplotChart extends LitElement {
|
|
3
|
+
data: any[];
|
|
4
|
+
groups: string[];
|
|
5
|
+
minKey: string;
|
|
6
|
+
maxKey: string;
|
|
7
|
+
meanKey: string;
|
|
8
|
+
medianKey: string;
|
|
9
|
+
q1Key: string;
|
|
10
|
+
q3Key: string;
|
|
11
|
+
valueKey: string;
|
|
12
|
+
currentGroup: string;
|
|
13
|
+
independentScale: boolean;
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
private chartWidth;
|
|
16
|
+
private chartHeight;
|
|
17
|
+
private resizeObserver?;
|
|
18
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
updated(): void;
|
|
22
|
+
private getOrgValue;
|
|
23
|
+
drawBoxplot(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { LitElement, html, css } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import * as d3 from 'd3';
|
|
5
|
+
let KpiBoxplotChart = class KpiBoxplotChart extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.data = [];
|
|
9
|
+
this.groups = []; // 조직 단위 목록 (빈 배열이면 데이터에서 자동 추출)
|
|
10
|
+
this.minKey = 'min';
|
|
11
|
+
this.maxKey = 'max';
|
|
12
|
+
this.meanKey = 'mean';
|
|
13
|
+
this.medianKey = 'median';
|
|
14
|
+
this.q1Key = 'q1';
|
|
15
|
+
this.q3Key = 'q3';
|
|
16
|
+
this.valueKey = 'value';
|
|
17
|
+
this.currentGroup = '';
|
|
18
|
+
this.independentScale = false;
|
|
19
|
+
this.chartWidth = 0;
|
|
20
|
+
this.chartHeight = 0;
|
|
21
|
+
this.getOrgValue = (d) => d.org || d.group;
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return html `<svg
|
|
25
|
+
id="boxplot"
|
|
26
|
+
width=${this.chartWidth}
|
|
27
|
+
height=${this.chartHeight}
|
|
28
|
+
viewBox="0 0 ${this.chartWidth} ${this.chartHeight}"
|
|
29
|
+
preserveAspectRatio="xMidYMid meet"
|
|
30
|
+
></svg>`;
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
35
|
+
for (const entry of entries) {
|
|
36
|
+
const rect = entry.contentRect;
|
|
37
|
+
this.chartWidth = rect.width;
|
|
38
|
+
this.chartHeight = rect.height;
|
|
39
|
+
this.requestUpdate();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
this.resizeObserver.observe(this);
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
}
|
|
49
|
+
updated() {
|
|
50
|
+
this.drawBoxplot();
|
|
51
|
+
}
|
|
52
|
+
drawBoxplot() {
|
|
53
|
+
var _a, _b, _c, _d, _e;
|
|
54
|
+
const svg = d3.select(this.renderRoot.querySelector('#boxplot'));
|
|
55
|
+
svg.selectAll('*').remove();
|
|
56
|
+
// 데이터 검증
|
|
57
|
+
if (!this.data || this.data.length === 0) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const w = this.chartWidth || 300;
|
|
61
|
+
const h = this.chartHeight || 300;
|
|
62
|
+
const margin = {
|
|
63
|
+
top: 20,
|
|
64
|
+
right: 20,
|
|
65
|
+
bottom: 40,
|
|
66
|
+
left: this.independentScale ? 20 : 40
|
|
67
|
+
};
|
|
68
|
+
const plotW = w - margin.left - margin.right;
|
|
69
|
+
const plotH = h - margin.top - margin.bottom;
|
|
70
|
+
// x축: 조직 단위 (그룹) - org 또는 group 필드 지원
|
|
71
|
+
const groups = this.groups.length > 0 ? this.groups : [...new Set(this.data.map(d => this.getOrgValue(d)).filter(org => org != null))];
|
|
72
|
+
if (groups.length === 0) {
|
|
73
|
+
console.warn('No valid groups found in data:', this.data);
|
|
74
|
+
return; // 유효한 그룹이 없으면 차트를 그리지 않음
|
|
75
|
+
}
|
|
76
|
+
console.log('Boxplot groups:', groups);
|
|
77
|
+
console.log('Data org values:', this.data.map(d => this.getOrgValue(d)));
|
|
78
|
+
console.log('Full data:', this.data);
|
|
79
|
+
console.log('Chart dimensions:', { w, h, plotW, plotH });
|
|
80
|
+
const x = d3.scaleBand().domain(groups).range([0, plotW]).padding(0.4);
|
|
81
|
+
// y축 스케일 설정
|
|
82
|
+
let y;
|
|
83
|
+
if (this.independentScale) {
|
|
84
|
+
// 독립 스케일: 각 시리즈별로 개별 스케일 생성
|
|
85
|
+
const yScales = this.data.map(d => {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const values = [
|
|
88
|
+
d[this.minKey],
|
|
89
|
+
d[this.maxKey],
|
|
90
|
+
d[this.q1Key],
|
|
91
|
+
d[this.q3Key],
|
|
92
|
+
d[this.medianKey],
|
|
93
|
+
d[this.meanKey],
|
|
94
|
+
d[this.valueKey]
|
|
95
|
+
];
|
|
96
|
+
const min = (_a = d3.min(values)) !== null && _a !== void 0 ? _a : 0;
|
|
97
|
+
const max = (_b = d3.max(values)) !== null && _b !== void 0 ? _b : 1;
|
|
98
|
+
return {
|
|
99
|
+
org: d.org,
|
|
100
|
+
scale: d3.scaleLinear().domain([min, max]).nice().range([plotH, 0])
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
// 기본 y축은 첫 번째 스케일 사용
|
|
104
|
+
y = ((_a = yScales[0]) === null || _a === void 0 ? void 0 : _a.scale) || d3.scaleLinear().domain([0, 1]).range([plotH, 0]);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// 통합 스케일: 모든 데이터를 하나의 스케일에 맞춤
|
|
108
|
+
const allValues = this.data.flatMap(d => [
|
|
109
|
+
d[this.minKey],
|
|
110
|
+
d[this.maxKey],
|
|
111
|
+
d[this.q1Key],
|
|
112
|
+
d[this.q3Key],
|
|
113
|
+
d[this.medianKey],
|
|
114
|
+
d[this.meanKey],
|
|
115
|
+
d[this.valueKey]
|
|
116
|
+
]);
|
|
117
|
+
y = d3
|
|
118
|
+
.scaleLinear()
|
|
119
|
+
.domain([(_b = d3.min(allValues)) !== null && _b !== void 0 ? _b : 0, (_c = d3.max(allValues)) !== null && _c !== void 0 ? _c : 1])
|
|
120
|
+
.nice()
|
|
121
|
+
.range([plotH, 0]);
|
|
122
|
+
}
|
|
123
|
+
const g = svg
|
|
124
|
+
.attr('width', w)
|
|
125
|
+
.attr('height', h)
|
|
126
|
+
.append('g')
|
|
127
|
+
.attr('transform', `translate(${margin.left},${margin.top})`);
|
|
128
|
+
// 축
|
|
129
|
+
if (!this.independentScale) {
|
|
130
|
+
g.append('g').call(d3.axisLeft(y));
|
|
131
|
+
}
|
|
132
|
+
g.append('g').attr('transform', `translate(0,${plotH})`).call(d3.axisBottom(x));
|
|
133
|
+
// 박스플롯 - 각 그룹별로 박스 생성
|
|
134
|
+
groups.forEach(groupName => {
|
|
135
|
+
var _a, _b, _c;
|
|
136
|
+
// 해당 그룹의 데이터 찾기
|
|
137
|
+
const groupData = this.data.find(d => this.getOrgValue(d) === groupName);
|
|
138
|
+
console.log(`Searching for group: ${groupName}, found:`, groupData);
|
|
139
|
+
if (!groupData) {
|
|
140
|
+
console.warn(`No data found for group: ${groupName}. Available data:`, this.data.map(d => ({ org: d.org, keys: Object.keys(d) })));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
// 필수 필드 검증
|
|
144
|
+
const requiredFields = [this.minKey, this.maxKey, this.q1Key, this.q3Key, this.medianKey, this.meanKey];
|
|
145
|
+
const missingFields = requiredFields.filter(field => groupData[field] == null);
|
|
146
|
+
if (missingFields.length > 0) {
|
|
147
|
+
console.warn(`Missing required fields for group ${groupName}:`, missingFields);
|
|
148
|
+
console.log('Group data:', groupData);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const gx = (_a = x(groupName)) !== null && _a !== void 0 ? _a : 0;
|
|
152
|
+
console.log(`Drawing box for ${groupName} at x=${gx}, bandwidth=${x.bandwidth()}`);
|
|
153
|
+
// 독립 스케일 사용 시 해당 그룹의 스케일 찾기
|
|
154
|
+
let currentY = y;
|
|
155
|
+
if (this.independentScale) {
|
|
156
|
+
const values = [
|
|
157
|
+
groupData[this.minKey],
|
|
158
|
+
groupData[this.maxKey],
|
|
159
|
+
groupData[this.q1Key],
|
|
160
|
+
groupData[this.q3Key],
|
|
161
|
+
groupData[this.medianKey],
|
|
162
|
+
groupData[this.meanKey],
|
|
163
|
+
groupData[this.valueKey]
|
|
164
|
+
];
|
|
165
|
+
const min = (_b = d3.min(values)) !== null && _b !== void 0 ? _b : 0;
|
|
166
|
+
const max = (_c = d3.max(values)) !== null && _c !== void 0 ? _c : 1;
|
|
167
|
+
currentY = d3.scaleLinear().domain([min, max]).nice().range([plotH, 0]);
|
|
168
|
+
}
|
|
169
|
+
// Outlier 계산 (1.5 * IQR 규칙)
|
|
170
|
+
const iqr = groupData[this.q3Key] - groupData[this.q1Key];
|
|
171
|
+
const lowerFence = groupData[this.q1Key] - 1.5 * iqr;
|
|
172
|
+
const upperFence = groupData[this.q3Key] + 1.5 * iqr;
|
|
173
|
+
// 실제 min/max 값 (fence 내부)
|
|
174
|
+
const actualMin = Math.max(groupData[this.minKey], lowerFence);
|
|
175
|
+
const actualMax = Math.min(groupData[this.maxKey], upperFence);
|
|
176
|
+
// 박스
|
|
177
|
+
g.append('rect')
|
|
178
|
+
.attr('x', gx)
|
|
179
|
+
.attr('y', currentY(groupData[this.q3Key]))
|
|
180
|
+
.attr('width', x.bandwidth())
|
|
181
|
+
.attr('height', currentY(groupData[this.q1Key]) - currentY(groupData[this.q3Key]))
|
|
182
|
+
.attr('fill', this.getOrgValue(groupData) === this.currentGroup ? '#2196f3' : '#bbb')
|
|
183
|
+
.attr('opacity', 0.5);
|
|
184
|
+
// 중앙선(중앙값)
|
|
185
|
+
g.append('line')
|
|
186
|
+
.attr('x1', gx)
|
|
187
|
+
.attr('x2', gx + x.bandwidth())
|
|
188
|
+
.attr('y1', currentY(groupData[this.medianKey]))
|
|
189
|
+
.attr('y2', currentY(groupData[this.medianKey]))
|
|
190
|
+
.attr('stroke', '#333')
|
|
191
|
+
.attr('stroke-width', 2);
|
|
192
|
+
// 수염 (fence 내부의 min-max)
|
|
193
|
+
g.append('line')
|
|
194
|
+
.attr('x1', gx + x.bandwidth() / 2)
|
|
195
|
+
.attr('x2', gx + x.bandwidth() / 2)
|
|
196
|
+
.attr('y1', currentY(actualMin))
|
|
197
|
+
.attr('y2', currentY(actualMax))
|
|
198
|
+
.attr('stroke', '#333');
|
|
199
|
+
// min/max 선 (fence 내부)
|
|
200
|
+
g.append('line')
|
|
201
|
+
.attr('x1', gx + x.bandwidth() / 4)
|
|
202
|
+
.attr('x2', gx + (x.bandwidth() * 3) / 4)
|
|
203
|
+
.attr('y1', currentY(actualMin))
|
|
204
|
+
.attr('y2', currentY(actualMin))
|
|
205
|
+
.attr('stroke', '#333');
|
|
206
|
+
g.append('line')
|
|
207
|
+
.attr('x1', gx + x.bandwidth() / 4)
|
|
208
|
+
.attr('x2', gx + (x.bandwidth() * 3) / 4)
|
|
209
|
+
.attr('y1', currentY(actualMax))
|
|
210
|
+
.attr('y2', currentY(actualMax))
|
|
211
|
+
.attr('stroke', '#333');
|
|
212
|
+
// Outlier 표시 (fence 외부의 값들)
|
|
213
|
+
if (groupData[this.minKey] < lowerFence) {
|
|
214
|
+
g.append('circle')
|
|
215
|
+
.attr('cx', gx + x.bandwidth() / 2)
|
|
216
|
+
.attr('cy', currentY(groupData[this.minKey]))
|
|
217
|
+
.attr('r', 3)
|
|
218
|
+
.attr('fill', '#ff4444')
|
|
219
|
+
.attr('stroke', '#333')
|
|
220
|
+
.attr('stroke-width', 1);
|
|
221
|
+
}
|
|
222
|
+
if (groupData[this.maxKey] > upperFence) {
|
|
223
|
+
g.append('circle')
|
|
224
|
+
.attr('cx', gx + x.bandwidth() / 2)
|
|
225
|
+
.attr('cy', currentY(groupData[this.maxKey]))
|
|
226
|
+
.attr('r', 3)
|
|
227
|
+
.attr('fill', '#ff4444')
|
|
228
|
+
.attr('stroke', '#333')
|
|
229
|
+
.attr('stroke-width', 1);
|
|
230
|
+
}
|
|
231
|
+
// 평균값
|
|
232
|
+
g.append('circle')
|
|
233
|
+
.attr('cx', gx + x.bandwidth() / 2)
|
|
234
|
+
.attr('cy', currentY(groupData[this.meanKey]))
|
|
235
|
+
.attr('r', 4)
|
|
236
|
+
.attr('fill', 'orange');
|
|
237
|
+
});
|
|
238
|
+
// 현재 그룹 값 강조
|
|
239
|
+
if (this.currentGroup && groups.includes(this.currentGroup)) {
|
|
240
|
+
const currentGroupData = this.data.find(d => this.getOrgValue(d) === this.currentGroup);
|
|
241
|
+
if (currentGroupData) {
|
|
242
|
+
let currentY = y;
|
|
243
|
+
if (this.independentScale) {
|
|
244
|
+
const values = [
|
|
245
|
+
currentGroupData[this.minKey],
|
|
246
|
+
currentGroupData[this.maxKey],
|
|
247
|
+
currentGroupData[this.q1Key],
|
|
248
|
+
currentGroupData[this.q3Key],
|
|
249
|
+
currentGroupData[this.medianKey],
|
|
250
|
+
currentGroupData[this.meanKey],
|
|
251
|
+
currentGroupData[this.valueKey]
|
|
252
|
+
];
|
|
253
|
+
const min = (_d = d3.min(values)) !== null && _d !== void 0 ? _d : 0;
|
|
254
|
+
const max = (_e = d3.max(values)) !== null && _e !== void 0 ? _e : 1;
|
|
255
|
+
currentY = d3.scaleLinear().domain([min, max]).nice().range([plotH, 0]);
|
|
256
|
+
}
|
|
257
|
+
g.append('circle')
|
|
258
|
+
.attr('cx', x(this.currentGroup) + x.bandwidth() / 2)
|
|
259
|
+
.attr('cy', currentY(currentGroupData[this.valueKey]))
|
|
260
|
+
.attr('r', 6)
|
|
261
|
+
.attr('fill', '#e91e63')
|
|
262
|
+
.attr('stroke', '#fff')
|
|
263
|
+
.attr('stroke-width', 2);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
KpiBoxplotChart.styles = css `
|
|
269
|
+
:host {
|
|
270
|
+
display: block;
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
}
|
|
274
|
+
svg {
|
|
275
|
+
width: 100%;
|
|
276
|
+
height: 100%;
|
|
277
|
+
display: block;
|
|
278
|
+
}
|
|
279
|
+
`;
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ type: Array }),
|
|
282
|
+
__metadata("design:type", Array)
|
|
283
|
+
], KpiBoxplotChart.prototype, "data", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
property({ type: Array }),
|
|
286
|
+
__metadata("design:type", Array)
|
|
287
|
+
], KpiBoxplotChart.prototype, "groups", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
property({ type: String }),
|
|
290
|
+
__metadata("design:type", String)
|
|
291
|
+
], KpiBoxplotChart.prototype, "minKey", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: String }),
|
|
294
|
+
__metadata("design:type", String)
|
|
295
|
+
], KpiBoxplotChart.prototype, "maxKey", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
property({ type: String }),
|
|
298
|
+
__metadata("design:type", String)
|
|
299
|
+
], KpiBoxplotChart.prototype, "meanKey", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
property({ type: String }),
|
|
302
|
+
__metadata("design:type", String)
|
|
303
|
+
], KpiBoxplotChart.prototype, "medianKey", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
property({ type: String }),
|
|
306
|
+
__metadata("design:type", String)
|
|
307
|
+
], KpiBoxplotChart.prototype, "q1Key", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ type: String }),
|
|
310
|
+
__metadata("design:type", String)
|
|
311
|
+
], KpiBoxplotChart.prototype, "q3Key", void 0);
|
|
312
|
+
__decorate([
|
|
313
|
+
property({ type: String }),
|
|
314
|
+
__metadata("design:type", String)
|
|
315
|
+
], KpiBoxplotChart.prototype, "valueKey", void 0);
|
|
316
|
+
__decorate([
|
|
317
|
+
property({ type: String }),
|
|
318
|
+
__metadata("design:type", String)
|
|
319
|
+
], KpiBoxplotChart.prototype, "currentGroup", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
property({ type: Boolean }),
|
|
322
|
+
__metadata("design:type", Boolean)
|
|
323
|
+
], KpiBoxplotChart.prototype, "independentScale", void 0);
|
|
324
|
+
KpiBoxplotChart = __decorate([
|
|
325
|
+
customElement('kpi-boxplot-chart')
|
|
326
|
+
], KpiBoxplotChart);
|
|
327
|
+
export { KpiBoxplotChart };
|
|
328
|
+
//# sourceMappingURL=kpi-boxplot-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-boxplot-chart.js","sourceRoot":"","sources":["../../client/components/kpi-boxplot-chart.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAGjB,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QACsB,SAAI,GAAU,EAAE,CAAA;QAChB,WAAM,GAAa,EAAE,CAAA,CAAC,gCAAgC;QACrD,WAAM,GAAW,KAAK,CAAA;QACtB,WAAM,GAAW,KAAK,CAAA;QACtB,YAAO,GAAW,MAAM,CAAA;QACxB,cAAS,GAAW,QAAQ,CAAA;QAC5B,UAAK,GAAW,IAAI,CAAA;QACpB,UAAK,GAAW,IAAI,CAAA;QACpB,aAAQ,GAAW,OAAO,CAAA;QAC1B,iBAAY,GAAW,EA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AuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAA0B;AACxB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;yDAAkC;AAXnD,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAyS3B","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport * as d3 from 'd3'\n\n@customElement('kpi-boxplot-chart')\nexport class KpiBoxplotChart extends LitElement {\n @property({ type: Array }) data: any[] = []\n @property({ type: Array }) groups: string[] = [] // 조직 단위 목록 (빈 배열이면 데이터에서 자동 추출)\n @property({ type: String }) minKey: string = 'min'\n @property({ type: String }) maxKey: string = 'max'\n @property({ type: String }) meanKey: string = 'mean'\n @property({ type: String }) medianKey: string = 'median'\n @property({ type: String }) q1Key: string = 'q1'\n @property({ type: String }) q3Key: string = 'q3'\n @property({ type: String }) valueKey: string = 'value'\n @property({ type: String }) currentGroup: string = ''\n @property({ type: Boolean }) independentScale: boolean = false\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n `\n\n private chartWidth = 0\n private chartHeight = 0\n private resizeObserver?: ResizeObserver\n\n render() {\n return html`<svg\n id=\"boxplot\"\n width=${this.chartWidth}\n height=${this.chartHeight}\n viewBox=\"0 0 ${this.chartWidth} ${this.chartHeight}\"\n preserveAspectRatio=\"xMidYMid meet\"\n ></svg>`\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const rect = entry.contentRect\n this.chartWidth = rect.width\n this.chartHeight = rect.height\n this.requestUpdate()\n }\n })\n this.resizeObserver.observe(this)\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect()\n super.disconnectedCallback()\n }\n\n updated() {\n this.drawBoxplot()\n }\n\n private getOrgValue = (d: any) => d.org || d.group\n\n drawBoxplot() {\n const svg = d3.select(this.renderRoot.querySelector('#boxplot'))\n svg.selectAll('*').remove()\n \n // 데이터 검증\n if (!this.data || this.data.length === 0) {\n return\n }\n const w = this.chartWidth || 300\n const h = this.chartHeight || 300\n const margin = {\n top: 20,\n right: 20,\n bottom: 40,\n left: this.independentScale ? 20 : 40\n }\n const plotW = w - margin.left - margin.right\n const plotH = h - margin.top - margin.bottom\n\n // x축: 조직 단위 (그룹) - org 또는 group 필드 지원\n const groups = this.groups.length > 0 ? this.groups : [...new Set(this.data.map(d => this.getOrgValue(d)).filter(org => org != null))]\n if (groups.length === 0) {\n console.warn('No valid groups found in data:', this.data)\n return // 유효한 그룹이 없으면 차트를 그리지 않음\n }\n \n console.log('Boxplot groups:', groups)\n console.log('Data org values:', this.data.map(d => this.getOrgValue(d)))\n console.log('Full data:', this.data)\n console.log('Chart dimensions:', { w, h, plotW, plotH })\n \n const x = d3.scaleBand().domain(groups).range([0, plotW]).padding(0.4)\n\n // y축 스케일 설정\n let y: d3.ScaleLinear<number, number>\n\n if (this.independentScale) {\n // 독립 스케일: 각 시리즈별로 개별 스케일 생성\n const yScales = this.data.map(d => {\n const values = [\n d[this.minKey],\n d[this.maxKey],\n d[this.q1Key],\n d[this.q3Key],\n d[this.medianKey],\n d[this.meanKey],\n d[this.valueKey]\n ]\n const min = d3.min(values) ?? 0\n const max = d3.max(values) ?? 1\n return {\n org: d.org,\n scale: d3.scaleLinear().domain([min, max]).nice().range([plotH, 0])\n }\n })\n\n // 기본 y축은 첫 번째 스케일 사용\n y = yScales[0]?.scale || d3.scaleLinear().domain([0, 1]).range([plotH, 0])\n } else {\n // 통합 스케일: 모든 데이터를 하나의 스케일에 맞춤\n const allValues = this.data.flatMap(d => [\n d[this.minKey],\n d[this.maxKey],\n d[this.q1Key],\n d[this.q3Key],\n d[this.medianKey],\n d[this.meanKey],\n d[this.valueKey]\n ])\n y = d3\n .scaleLinear()\n .domain([d3.min(allValues) ?? 0, d3.max(allValues) ?? 1])\n .nice()\n .range([plotH, 0])\n }\n\n const g = svg\n .attr('width', w)\n .attr('height', h)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`)\n\n // 축\n if (!this.independentScale) {\n g.append('g').call(d3.axisLeft(y))\n }\n g.append('g').attr('transform', `translate(0,${plotH})`).call(d3.axisBottom(x))\n\n // 박스플롯 - 각 그룹별로 박스 생성\n groups.forEach(groupName => {\n // 해당 그룹의 데이터 찾기\n const groupData = this.data.find(d => this.getOrgValue(d) === groupName)\n console.log(`Searching for group: ${groupName}, found:`, groupData)\n if (!groupData) {\n console.warn(`No data found for group: ${groupName}. Available data:`, this.data.map(d => ({ org: d.org, keys: Object.keys(d) })))\n return\n }\n \n // 필수 필드 검증\n const requiredFields = [this.minKey, this.maxKey, this.q1Key, this.q3Key, this.medianKey, this.meanKey]\n const missingFields = requiredFields.filter(field => groupData[field] == null)\n if (missingFields.length > 0) {\n console.warn(`Missing required fields for group ${groupName}:`, missingFields)\n console.log('Group data:', groupData)\n return\n }\n \n const gx = x(groupName) ?? 0\n console.log(`Drawing box for ${groupName} at x=${gx}, bandwidth=${x.bandwidth()}`)\n\n // 독립 스케일 사용 시 해당 그룹의 스케일 찾기\n let currentY = y\n if (this.independentScale) {\n const values = [\n groupData[this.minKey],\n groupData[this.maxKey],\n groupData[this.q1Key],\n groupData[this.q3Key],\n groupData[this.medianKey],\n groupData[this.meanKey],\n groupData[this.valueKey]\n ]\n const min = d3.min(values) ?? 0\n const max = d3.max(values) ?? 1\n currentY = d3.scaleLinear().domain([min, max]).nice().range([plotH, 0])\n }\n\n // Outlier 계산 (1.5 * IQR 규칙)\n const iqr = groupData[this.q3Key] - groupData[this.q1Key]\n const lowerFence = groupData[this.q1Key] - 1.5 * iqr\n const upperFence = groupData[this.q3Key] + 1.5 * iqr\n\n // 실제 min/max 값 (fence 내부)\n const actualMin = Math.max(groupData[this.minKey], lowerFence)\n const actualMax = Math.min(groupData[this.maxKey], upperFence)\n\n // 박스\n g.append('rect')\n .attr('x', gx)\n .attr('y', currentY(groupData[this.q3Key]))\n .attr('width', x.bandwidth())\n .attr('height', currentY(groupData[this.q1Key]) - currentY(groupData[this.q3Key]))\n .attr('fill', this.getOrgValue(groupData) === this.currentGroup ? '#2196f3' : '#bbb')\n .attr('opacity', 0.5)\n\n // 중앙선(중앙값)\n g.append('line')\n .attr('x1', gx)\n .attr('x2', gx + x.bandwidth())\n .attr('y1', currentY(groupData[this.medianKey]))\n .attr('y2', currentY(groupData[this.medianKey]))\n .attr('stroke', '#333')\n .attr('stroke-width', 2)\n\n // 수염 (fence 내부의 min-max)\n g.append('line')\n .attr('x1', gx + x.bandwidth() / 2)\n .attr('x2', gx + x.bandwidth() / 2)\n .attr('y1', currentY(actualMin))\n .attr('y2', currentY(actualMax))\n .attr('stroke', '#333')\n\n // min/max 선 (fence 내부)\n g.append('line')\n .attr('x1', gx + x.bandwidth() / 4)\n .attr('x2', gx + (x.bandwidth() * 3) / 4)\n .attr('y1', currentY(actualMin))\n .attr('y2', currentY(actualMin))\n .attr('stroke', '#333')\n g.append('line')\n .attr('x1', gx + x.bandwidth() / 4)\n .attr('x2', gx + (x.bandwidth() * 3) / 4)\n .attr('y1', currentY(actualMax))\n .attr('y2', currentY(actualMax))\n .attr('stroke', '#333')\n\n // Outlier 표시 (fence 외부의 값들)\n if (groupData[this.minKey] < lowerFence) {\n g.append('circle')\n .attr('cx', gx + x.bandwidth() / 2)\n .attr('cy', currentY(groupData[this.minKey]))\n .attr('r', 3)\n .attr('fill', '#ff4444')\n .attr('stroke', '#333')\n .attr('stroke-width', 1)\n }\n if (groupData[this.maxKey] > upperFence) {\n g.append('circle')\n .attr('cx', gx + x.bandwidth() / 2)\n .attr('cy', currentY(groupData[this.maxKey]))\n .attr('r', 3)\n .attr('fill', '#ff4444')\n .attr('stroke', '#333')\n .attr('stroke-width', 1)\n }\n\n // 평균값\n g.append('circle')\n .attr('cx', gx + x.bandwidth() / 2)\n .attr('cy', currentY(groupData[this.meanKey]))\n .attr('r', 4)\n .attr('fill', 'orange')\n })\n // 현재 그룹 값 강조\n if (this.currentGroup && groups.includes(this.currentGroup)) {\n const currentGroupData = this.data.find(d => this.getOrgValue(d) === this.currentGroup)\n if (currentGroupData) {\n let currentY = y\n if (this.independentScale) {\n const values = [\n currentGroupData[this.minKey],\n currentGroupData[this.maxKey],\n currentGroupData[this.q1Key],\n currentGroupData[this.q3Key],\n currentGroupData[this.medianKey],\n currentGroupData[this.meanKey],\n currentGroupData[this.valueKey]\n ]\n const min = d3.min(values) ?? 0\n const max = d3.max(values) ?? 1\n currentY = d3.scaleLinear().domain([min, max]).nice().range([plotH, 0])\n }\n\n g.append('circle')\n .attr('cx', x(this.currentGroup) + x.bandwidth() / 2)\n .attr('cy', currentY(currentGroupData[this.valueKey]))\n .attr('r', 6)\n .attr('fill', '#e91e63')\n .attr('stroke', '#fff')\n .attr('stroke-width', 2)\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiRadarChart extends LitElement {
|
|
3
|
+
data: any[];
|
|
4
|
+
categories: string[];
|
|
5
|
+
valueKey: string;
|
|
6
|
+
currentGroup: string;
|
|
7
|
+
static styles: import("lit").CSSResult;
|
|
8
|
+
private chartWidth;
|
|
9
|
+
private chartHeight;
|
|
10
|
+
private resizeObserver?;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
updated(): void;
|
|
15
|
+
drawRadar(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { LitElement, html, css } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import * as d3 from 'd3';
|
|
5
|
+
let KpiRadarChart = class KpiRadarChart extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.data = [];
|
|
9
|
+
this.categories = [];
|
|
10
|
+
this.valueKey = 'value';
|
|
11
|
+
this.currentGroup = '';
|
|
12
|
+
this.chartWidth = 0;
|
|
13
|
+
this.chartHeight = 0;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return html `<svg
|
|
17
|
+
id="radar"
|
|
18
|
+
width=${this.chartWidth}
|
|
19
|
+
height=${this.chartHeight}
|
|
20
|
+
viewBox="0 0 ${this.chartWidth} ${this.chartHeight}"
|
|
21
|
+
preserveAspectRatio="xMidYMid meet"
|
|
22
|
+
></svg>`;
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
const rect = entry.contentRect;
|
|
29
|
+
this.chartWidth = rect.width;
|
|
30
|
+
this.chartHeight = rect.height;
|
|
31
|
+
this.requestUpdate();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
this.resizeObserver.observe(this);
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
}
|
|
41
|
+
updated() {
|
|
42
|
+
this.drawRadar();
|
|
43
|
+
}
|
|
44
|
+
drawRadar() {
|
|
45
|
+
const svg = d3.select(this.renderRoot.querySelector('#radar'));
|
|
46
|
+
svg.selectAll('*').remove();
|
|
47
|
+
const w = this.chartWidth || 300;
|
|
48
|
+
const h = this.chartHeight || 300;
|
|
49
|
+
const r = Math.min(w, h) / 2 - 40;
|
|
50
|
+
const angleSlice = (2 * Math.PI) / (this.categories.length || 1);
|
|
51
|
+
// 데이터 변환: { org, values: [ {category, value} ... ] }
|
|
52
|
+
const orgData = d3
|
|
53
|
+
.groups(this.data, d => d.org)
|
|
54
|
+
.map(([org, values]) => ({
|
|
55
|
+
org,
|
|
56
|
+
values: this.categories.map((cat, i) => {
|
|
57
|
+
const found = values.find(v => v.category === cat);
|
|
58
|
+
return { category: cat, value: found ? found[this.valueKey] : 0 };
|
|
59
|
+
})
|
|
60
|
+
}));
|
|
61
|
+
// 스케일
|
|
62
|
+
const maxValue = d3.max(this.data, d => d[this.valueKey]) || 1;
|
|
63
|
+
const radius = d3.scaleLinear().domain([0, maxValue]).range([0, r]);
|
|
64
|
+
// SVG 기본
|
|
65
|
+
svg.attr('width', w).attr('height', h);
|
|
66
|
+
const g = svg.append('g').attr('transform', `translate(${w / 2},${h / 2})`);
|
|
67
|
+
// 그리드/축
|
|
68
|
+
for (let i = 1; i <= 5; i++) {
|
|
69
|
+
g.append('circle')
|
|
70
|
+
.attr('r', (r / 5) * i)
|
|
71
|
+
.attr('fill', 'none')
|
|
72
|
+
.attr('stroke', '#ccc');
|
|
73
|
+
}
|
|
74
|
+
this.categories.forEach((cat, i) => {
|
|
75
|
+
const angle = i * angleSlice - Math.PI / 2;
|
|
76
|
+
g.append('line')
|
|
77
|
+
.attr('x1', 0)
|
|
78
|
+
.attr('y1', 0)
|
|
79
|
+
.attr('x2', radius(maxValue) * Math.cos(angle))
|
|
80
|
+
.attr('y2', radius(maxValue) * Math.sin(angle))
|
|
81
|
+
.attr('stroke', '#ccc');
|
|
82
|
+
g.append('text')
|
|
83
|
+
.attr('x', (radius(maxValue) + 10) * Math.cos(angle))
|
|
84
|
+
.attr('y', (radius(maxValue) + 10) * Math.sin(angle))
|
|
85
|
+
.attr('text-anchor', 'middle')
|
|
86
|
+
.attr('alignment-baseline', 'middle')
|
|
87
|
+
.attr('font-size', 12)
|
|
88
|
+
.text(cat);
|
|
89
|
+
});
|
|
90
|
+
// 그룹별 폴리곤
|
|
91
|
+
orgData.forEach(gd => {
|
|
92
|
+
// 마지막에 첫 점을 한 번 더 추가
|
|
93
|
+
const closedValues = [...gd.values, gd.values[0]];
|
|
94
|
+
const line = d3
|
|
95
|
+
.lineRadial()
|
|
96
|
+
.radius((d) => radius(d.value))
|
|
97
|
+
.angle((d, i) => i * angleSlice);
|
|
98
|
+
g.append('path')
|
|
99
|
+
.datum(closedValues)
|
|
100
|
+
.attr('d', line)
|
|
101
|
+
.attr('fill', gd.org === this.currentGroup ? 'rgba(33,150,243,0.4)' : 'rgba(200,200,200,0.2)')
|
|
102
|
+
.attr('stroke', gd.org === this.currentGroup ? '#2196f3' : '#aaa')
|
|
103
|
+
.attr('stroke-width', gd.org === this.currentGroup ? 3 : 1);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
KpiRadarChart.styles = css `
|
|
108
|
+
:host {
|
|
109
|
+
display: block;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
}
|
|
113
|
+
svg {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
display: block;
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ type: Array }),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], KpiRadarChart.prototype, "data", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ type: Array }),
|
|
125
|
+
__metadata("design:type", Array)
|
|
126
|
+
], KpiRadarChart.prototype, "categories", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ type: String }),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], KpiRadarChart.prototype, "valueKey", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ type: String }),
|
|
133
|
+
__metadata("design:type", String)
|
|
134
|
+
], KpiRadarChart.prototype, "currentGroup", void 0);
|
|
135
|
+
KpiRadarChart = __decorate([
|
|
136
|
+
customElement('kpi-radar-chart')
|
|
137
|
+
], KpiRadarChart);
|
|
138
|
+
export { KpiRadarChart };
|
|
139
|
+
//# sourceMappingURL=kpi-radar-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-radar-chart.js","sourceRoot":"","sources":["../../client/components/kpi-radar-chart.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAGjB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACsB,SAAI,GAAU,EAAE,CAAA;QAChB,eAAU,GAAa,EAAE,CAAA;QACxB,aAAQ,GAAW,OAAO,CAAA;QAC1B,iBAAY,GAAW,EAAE,CAAA;QAe7C,eAAU,GAAG,CAAC,CAAA;QACd,gBAAW,GAAG,CAAC,CAAA;IAsGzB,CAAC;IAnGC,MAAM;QACJ,OAAO,IAAI,CAAA;;cAED,IAAI,CAAC,UAAU;eACd,IAAI,CAAC,WAAW;qBACV,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW;;YAE5C,CAAA;IACV,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,cAAc,GAAG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EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAA0B;AAJ1C,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA0HzB","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport * as d3 from 'd3'\n\n@customElement('kpi-radar-chart')\nexport class KpiRadarChart extends LitElement {\n @property({ type: Array }) data: any[] = []\n @property({ type: Array }) categories: string[] = []\n @property({ type: String }) valueKey: string = 'value'\n @property({ type: String }) currentGroup: string = ''\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n `\n\n private chartWidth = 0\n private chartHeight = 0\n private resizeObserver?: ResizeObserver\n\n render() {\n return html`<svg\n id=\"radar\"\n width=${this.chartWidth}\n height=${this.chartHeight}\n viewBox=\"0 0 ${this.chartWidth} ${this.chartHeight}\"\n preserveAspectRatio=\"xMidYMid meet\"\n ></svg>`\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const rect = entry.contentRect\n this.chartWidth = rect.width\n this.chartHeight = rect.height\n this.requestUpdate()\n }\n })\n this.resizeObserver.observe(this)\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect()\n super.disconnectedCallback()\n }\n\n updated() {\n this.drawRadar()\n }\n\n drawRadar() {\n const svg = d3.select(this.renderRoot.querySelector('#radar'))\n svg.selectAll('*').remove()\n const w = this.chartWidth || 300\n const h = this.chartHeight || 300\n const r = Math.min(w, h) / 2 - 40\n const angleSlice = (2 * Math.PI) / (this.categories.length || 1)\n\n // 데이터 변환: { org, values: [ {category, value} ... ] }\n const orgData = d3\n .groups(this.data, d => d.org)\n .map(([org, values]) => ({\n org,\n values: this.categories.map((cat, i) => {\n const found = values.find(v => v.category === cat)\n return { category: cat, value: found ? found[this.valueKey] : 0 }\n })\n }))\n\n // 스케일\n const maxValue = d3.max(this.data, d => d[this.valueKey]) || 1\n const radius = d3.scaleLinear().domain([0, maxValue]).range([0, r])\n\n // SVG 기본\n svg.attr('width', w).attr('height', h)\n const g = svg.append('g').attr('transform', `translate(${w / 2},${h / 2})`)\n\n // 그리드/축\n for (let i = 1; i <= 5; i++) {\n g.append('circle')\n .attr('r', (r / 5) * i)\n .attr('fill', 'none')\n .attr('stroke', '#ccc')\n }\n this.categories.forEach((cat, i) => {\n const angle = i * angleSlice - Math.PI / 2\n g.append('line')\n .attr('x1', 0)\n .attr('y1', 0)\n .attr('x2', radius(maxValue) * Math.cos(angle))\n .attr('y2', radius(maxValue) * Math.sin(angle))\n .attr('stroke', '#ccc')\n g.append('text')\n .attr('x', (radius(maxValue) + 10) * Math.cos(angle))\n .attr('y', (radius(maxValue) + 10) * Math.sin(angle))\n .attr('text-anchor', 'middle')\n .attr('alignment-baseline', 'middle')\n .attr('font-size', 12)\n .text(cat)\n })\n\n // 그룹별 폴리곤\n orgData.forEach(gd => {\n // 마지막에 첫 점을 한 번 더 추가\n const closedValues = [...gd.values, gd.values[0]]\n const line = d3\n .lineRadial()\n .radius((d: any) => radius(d.value))\n .angle((d, i) => i * angleSlice)\n g.append('path')\n .datum(closedValues)\n .attr('d', line as any)\n .attr('fill', gd.org === this.currentGroup ? 'rgba(33,150,243,0.4)' : 'rgba(200,200,200,0.2)')\n .attr('stroke', gd.org === this.currentGroup ? '#2196f3' : '#aaa')\n .attr('stroke-width', gd.org === this.currentGroup ? 3 : 1)\n })\n }\n}\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare class SvProjectCompleteTab2Rating extends LitElement {
|
|
3
3
|
static styles: import("lit").CSSResult[];
|
|
4
|
-
data: any;
|
|
5
4
|
kpiCategories: any;
|
|
5
|
+
kpiMetrics: any;
|
|
6
6
|
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
private _getInitData;
|
|
7
9
|
private _setRatingHalf;
|
|
8
10
|
private _save;
|
|
9
11
|
private _reset;
|