@dssp/dkpi 1.0.0-alpha.65 → 1.0.0-alpha.66
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/_index.html +0 -5
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +63 -0
- package/dist-client/components/kpi-2d-lookup-chart.js +470 -0
- package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +22 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +57 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +20 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +445 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +6 -5
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +47 -68
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +3 -2
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +79 -122
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +3 -2
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +71 -107
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +4 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +239 -28
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +2 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +10 -203
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +4 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +18 -15
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +4 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +66 -4
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +1 -2
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +1 -2
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/sv-project-detail.d.ts +1 -0
- package/dist-client/pages/sv-project-detail.js +26 -13
- package/dist-client/pages/sv-project-detail.js.map +1 -1
- package/dist-client/pages/sv-project-list.js +6 -6
- package/dist-client/pages/sv-project-list.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +4 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +1 -2
- package/dist-client/viewparts/menu-tools.js +1 -2
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-server/scripts/calculate-kpi-scores.js +65 -3
- package/dist-server/scripts/calculate-kpi-scores.js.map +1 -1
- package/dist-server/scripts/load-grade-data-migration.d.ts +4 -0
- package/dist-server/scripts/load-grade-data-migration.js +95 -10
- package/dist-server/scripts/load-grade-data-migration.js.map +1 -1
- package/dist-server/scripts/propagate-parent-kpi-values.js +58 -4
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +6 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +57 -7
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +6 -5
- package/dist-server/service/kpi-stat/kpi-stat-query.js +109 -12
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -1
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +12 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js +47 -1
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -54
- package/schema.graphql +88 -58
- package/things-factory.config.js +3 -1
- package/views/auth-page.html +0 -1
- package/views/public/home.html +0 -1
package/_index.html
CHANGED
|
@@ -61,10 +61,5 @@
|
|
|
61
61
|
<body class="light">
|
|
62
62
|
<things-app></things-app>
|
|
63
63
|
<noscript> Please enable JavaScript to view this website. </noscript>
|
|
64
|
-
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
|
|
65
|
-
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
|
66
|
-
<script src="/node_modules/web-animations-js/web-animations-next.min.js"></script>
|
|
67
|
-
<script src="/node_modules/@hatiolab/things-scene/things-scene-min.js"></script>
|
|
68
|
-
<!-- Built with love using PWA Starter Kit -->
|
|
69
64
|
</body>
|
|
70
65
|
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* X13 등 2D lookup KPI를 위한 차트 컴포넌트
|
|
4
|
+
*
|
|
5
|
+
* Y축: 성과수준 (0~1) — 다른 1D 차트와 동일
|
|
6
|
+
* X축: 편차율 (KPI value)
|
|
7
|
+
* 실선 계단: 현재 공정률 기준 편차→성과 매핑
|
|
8
|
+
* 반투명 밴드: 공정률 0~100% 범위에서 경계 이동 폭
|
|
9
|
+
* ● 점: 현재 프로젝트 위치
|
|
10
|
+
*/
|
|
11
|
+
interface Grade2DRow {
|
|
12
|
+
progressRate: number;
|
|
13
|
+
boundary5to4: number;
|
|
14
|
+
boundary4to3: number;
|
|
15
|
+
boundary3to2: number;
|
|
16
|
+
boundary2to1: number;
|
|
17
|
+
}
|
|
18
|
+
interface Grade2DLookup {
|
|
19
|
+
type: 'PROGRESS_DEVIATION_LOOKUP';
|
|
20
|
+
description?: string;
|
|
21
|
+
rows: Grade2DRow[];
|
|
22
|
+
}
|
|
23
|
+
export declare class Kpi2dLookupChart extends LitElement {
|
|
24
|
+
/** 2D grades 객체 ({ type: 'PROGRESS_DEVIATION_LOOKUP', rows: [...] }) */
|
|
25
|
+
grades: Grade2DLookup | null;
|
|
26
|
+
/** 현재 편차율 (KPI value = formula 결과) */
|
|
27
|
+
value: number | null;
|
|
28
|
+
/** 현재 공정률 (0~100) */
|
|
29
|
+
progressRate: number;
|
|
30
|
+
/** 단위 표시 */
|
|
31
|
+
unit: string;
|
|
32
|
+
/** 차트 제목 */
|
|
33
|
+
kpiName: string;
|
|
34
|
+
static styles: import("lit").CSSResult;
|
|
35
|
+
private chartWidth;
|
|
36
|
+
private chartHeight;
|
|
37
|
+
private resizeObserver?;
|
|
38
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
39
|
+
connectedCallback(): void;
|
|
40
|
+
disconnectedCallback(): void;
|
|
41
|
+
updated(): void;
|
|
42
|
+
private renderChart;
|
|
43
|
+
/**
|
|
44
|
+
* 현재 공정률에서의 점수 계산
|
|
45
|
+
*/
|
|
46
|
+
private getCurrentScore;
|
|
47
|
+
private drawHeader;
|
|
48
|
+
private draw2DChart;
|
|
49
|
+
/**
|
|
50
|
+
* 반투명 밴드: 공정률 0~100% 전체에서 각 경계가 이동하는 범위
|
|
51
|
+
*/
|
|
52
|
+
private drawBands;
|
|
53
|
+
/**
|
|
54
|
+
* 현재 공정률 기준 계단 함수 그리기
|
|
55
|
+
*/
|
|
56
|
+
private drawStepFunction;
|
|
57
|
+
/**
|
|
58
|
+
* 현재 프로젝트 위치 표시
|
|
59
|
+
*/
|
|
60
|
+
private drawCurrentValuePointer;
|
|
61
|
+
private drawEmptyState;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,470 @@
|
|
|
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
|
+
/* 5점→1.0, 4점→0.8, 3점→0.6, 2점→0.4, 1점→0.2 */
|
|
6
|
+
const SCORE_LEVELS = [
|
|
7
|
+
{ score: 5, normalized: 1.0, label: '5점', color: '#1565c0' },
|
|
8
|
+
{ score: 4, normalized: 0.8, label: '4점', color: '#4caf50' },
|
|
9
|
+
{ score: 3, normalized: 0.6, label: '3점', color: '#ffc107' },
|
|
10
|
+
{ score: 2, normalized: 0.4, label: '2점', color: '#ff9800' },
|
|
11
|
+
{ score: 1, normalized: 0.2, label: '1점', color: '#e53935' }
|
|
12
|
+
];
|
|
13
|
+
let Kpi2dLookupChart = class Kpi2dLookupChart extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/** 2D grades 객체 ({ type: 'PROGRESS_DEVIATION_LOOKUP', rows: [...] }) */
|
|
17
|
+
this.grades = null;
|
|
18
|
+
/** 현재 편차율 (KPI value = formula 결과) */
|
|
19
|
+
this.value = null;
|
|
20
|
+
/** 현재 공정률 (0~100) */
|
|
21
|
+
this.progressRate = 50;
|
|
22
|
+
/** 단위 표시 */
|
|
23
|
+
this.unit = '%';
|
|
24
|
+
/** 차트 제목 */
|
|
25
|
+
this.kpiName = '';
|
|
26
|
+
this.chartWidth = 0;
|
|
27
|
+
this.chartHeight = 0;
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return html `
|
|
31
|
+
<svg
|
|
32
|
+
id="lookup-2d-chart"
|
|
33
|
+
width=${this.chartWidth}
|
|
34
|
+
height=${this.chartHeight}
|
|
35
|
+
viewBox="0 0 ${this.chartWidth} ${this.chartHeight}"
|
|
36
|
+
preserveAspectRatio="xMidYMid meet"
|
|
37
|
+
></svg>
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
const rect = entry.contentRect;
|
|
45
|
+
this.chartWidth = rect.width;
|
|
46
|
+
this.chartHeight = rect.height;
|
|
47
|
+
this.requestUpdate();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
this.resizeObserver.observe(this);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
55
|
+
super.disconnectedCallback();
|
|
56
|
+
}
|
|
57
|
+
updated() {
|
|
58
|
+
this.renderChart();
|
|
59
|
+
}
|
|
60
|
+
renderChart() {
|
|
61
|
+
const svg = d3.select(this.renderRoot.querySelector('#lookup-2d-chart'));
|
|
62
|
+
svg.selectAll('*').remove();
|
|
63
|
+
if (!this.grades || !this.grades.rows || this.grades.rows.length === 0) {
|
|
64
|
+
this.drawEmptyState(svg);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const w = this.chartWidth || 400;
|
|
68
|
+
const h = this.chartHeight || 250;
|
|
69
|
+
const margin = { top: 45, right: 30, bottom: 55, left: 65 };
|
|
70
|
+
const plotW = w - margin.left - margin.right;
|
|
71
|
+
const plotH = h - margin.top - margin.bottom;
|
|
72
|
+
if (plotW <= 0 || plotH <= 0)
|
|
73
|
+
return;
|
|
74
|
+
const g = svg.append('g').attr('transform', `translate(${margin.left},${margin.top})`);
|
|
75
|
+
// 제목
|
|
76
|
+
if (this.kpiName) {
|
|
77
|
+
svg
|
|
78
|
+
.append('text')
|
|
79
|
+
.attr('class', 'chart-title')
|
|
80
|
+
.attr('x', w / 2)
|
|
81
|
+
.attr('y', 15)
|
|
82
|
+
.attr('text-anchor', 'middle')
|
|
83
|
+
.text(this.kpiName);
|
|
84
|
+
}
|
|
85
|
+
// 헤더 (현재 값, 점수)
|
|
86
|
+
this.drawHeader(svg, w);
|
|
87
|
+
// 차트 본체
|
|
88
|
+
this.draw2DChart(g, plotW, plotH);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 현재 공정률에서의 점수 계산
|
|
92
|
+
*/
|
|
93
|
+
getCurrentScore() {
|
|
94
|
+
var _a;
|
|
95
|
+
if (this.value === null || !((_a = this.grades) === null || _a === void 0 ? void 0 : _a.rows))
|
|
96
|
+
return null;
|
|
97
|
+
const progressIdx = Math.min(99, Math.max(0, Math.floor(this.progressRate)));
|
|
98
|
+
const row = this.grades.rows.find(r => r.progressRate === progressIdx);
|
|
99
|
+
if (!row)
|
|
100
|
+
return null;
|
|
101
|
+
if (this.value < row.boundary5to4)
|
|
102
|
+
return 5;
|
|
103
|
+
if (this.value < row.boundary4to3)
|
|
104
|
+
return 4;
|
|
105
|
+
if (this.value < row.boundary3to2)
|
|
106
|
+
return 3;
|
|
107
|
+
if (this.value < row.boundary2to1)
|
|
108
|
+
return 2;
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
111
|
+
drawHeader(svg, chartWidth) {
|
|
112
|
+
const headerY = 32;
|
|
113
|
+
// 편차율(value) 표시
|
|
114
|
+
if (this.value !== null) {
|
|
115
|
+
svg
|
|
116
|
+
.append('text')
|
|
117
|
+
.attr('class', 'value-label')
|
|
118
|
+
.attr('x', 10)
|
|
119
|
+
.attr('y', headerY)
|
|
120
|
+
.attr('font-size', '11px')
|
|
121
|
+
.text(`편차율: ${(this.value * 100).toFixed(2)}%`);
|
|
122
|
+
}
|
|
123
|
+
// 공정률 표시
|
|
124
|
+
svg
|
|
125
|
+
.append('text')
|
|
126
|
+
.attr('class', 'progress-label')
|
|
127
|
+
.attr('x', chartWidth / 2)
|
|
128
|
+
.attr('y', headerY)
|
|
129
|
+
.attr('text-anchor', 'middle')
|
|
130
|
+
.attr('font-size', '11px')
|
|
131
|
+
.text(`공정률: ${this.progressRate.toFixed(0)}%`);
|
|
132
|
+
// Score 표시
|
|
133
|
+
const currentScore = this.getCurrentScore();
|
|
134
|
+
if (currentScore !== null) {
|
|
135
|
+
const normalized = currentScore / 5;
|
|
136
|
+
svg
|
|
137
|
+
.append('text')
|
|
138
|
+
.attr('class', 'value-label')
|
|
139
|
+
.attr('x', chartWidth - 10)
|
|
140
|
+
.attr('y', headerY)
|
|
141
|
+
.attr('text-anchor', 'end')
|
|
142
|
+
.attr('font-size', '11px')
|
|
143
|
+
.text(`성과수준: ${normalized.toFixed(1)} (${currentScore}점)`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
draw2DChart(g, width, height) {
|
|
147
|
+
const rows = this.grades.rows;
|
|
148
|
+
// --- X축 범위 계산 (편차율) ---
|
|
149
|
+
// 모든 공정률에서의 최소/최대 경계값
|
|
150
|
+
const allBoundaries = rows.flatMap(r => [r.boundary5to4, r.boundary2to1]);
|
|
151
|
+
let xMin = Math.min(...allBoundaries);
|
|
152
|
+
let xMax = Math.max(...allBoundaries);
|
|
153
|
+
// 현재 value 포함
|
|
154
|
+
if (this.value !== null) {
|
|
155
|
+
xMin = Math.min(xMin, this.value);
|
|
156
|
+
xMax = Math.max(xMax, this.value);
|
|
157
|
+
}
|
|
158
|
+
// 약간의 여백
|
|
159
|
+
const xPadding = (xMax - xMin) * 0.08;
|
|
160
|
+
xMin -= xPadding;
|
|
161
|
+
xMax += xPadding;
|
|
162
|
+
const xScale = d3.scaleLinear().domain([xMin, xMax]).range([0, width]);
|
|
163
|
+
// --- Y축 (성과수준 0~1) ---
|
|
164
|
+
const yScale = d3.scaleLinear().domain([0, 1.05]).range([height, 0]);
|
|
165
|
+
// --- 반투명 밴드: 모든 공정률에서의 경계 변동 범위 ---
|
|
166
|
+
this.drawBands(g, rows, xScale, yScale, width);
|
|
167
|
+
// --- 현재 공정률 기준 계단 함수 ---
|
|
168
|
+
this.drawStepFunction(g, xScale, yScale, xMin, xMax);
|
|
169
|
+
// --- 현재 위치 포인터 ---
|
|
170
|
+
this.drawCurrentValuePointer(g, xScale, yScale);
|
|
171
|
+
// --- 축 그리기 ---
|
|
172
|
+
// Y축
|
|
173
|
+
const yAxis = d3.axisLeft(yScale).tickValues([0, 0.2, 0.4, 0.6, 0.8, 1.0]);
|
|
174
|
+
g.append('g').call(yAxis);
|
|
175
|
+
g.append('text')
|
|
176
|
+
.attr('class', 'axis-label')
|
|
177
|
+
.attr('transform', 'rotate(-90)')
|
|
178
|
+
.attr('x', -height / 2)
|
|
179
|
+
.attr('y', -50)
|
|
180
|
+
.attr('text-anchor', 'middle')
|
|
181
|
+
.attr('font-weight', 'bold')
|
|
182
|
+
.text('성과수준');
|
|
183
|
+
// X축
|
|
184
|
+
const xAxis = d3
|
|
185
|
+
.axisBottom(xScale)
|
|
186
|
+
.ticks(8)
|
|
187
|
+
.tickFormat((d) => `${(d * 100).toFixed(1)}%`);
|
|
188
|
+
g.append('g').attr('transform', `translate(0,${height})`).call(xAxis);
|
|
189
|
+
g.append('text')
|
|
190
|
+
.attr('class', 'axis-label')
|
|
191
|
+
.attr('x', width / 2)
|
|
192
|
+
.attr('y', height + 42)
|
|
193
|
+
.attr('text-anchor', 'middle')
|
|
194
|
+
.text('편차율');
|
|
195
|
+
// --- 점수 라벨 (우측) ---
|
|
196
|
+
SCORE_LEVELS.forEach(level => {
|
|
197
|
+
g.append('text')
|
|
198
|
+
.attr('class', 'score-label')
|
|
199
|
+
.attr('x', width + 5)
|
|
200
|
+
.attr('y', yScale(level.normalized) + 4)
|
|
201
|
+
.attr('fill', level.color)
|
|
202
|
+
.text(level.label);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 반투명 밴드: 공정률 0~100% 전체에서 각 경계가 이동하는 범위
|
|
207
|
+
*/
|
|
208
|
+
drawBands(g, rows, xScale, yScale, width) {
|
|
209
|
+
// 각 점수 경계별로 min/max 범위 계산
|
|
210
|
+
const b5to4_min = Math.min(...rows.map(r => r.boundary5to4));
|
|
211
|
+
const b5to4_max = Math.max(...rows.map(r => r.boundary5to4));
|
|
212
|
+
const b3to2_min = Math.min(...rows.map(r => r.boundary3to2));
|
|
213
|
+
const b3to2_max = Math.max(...rows.map(r => r.boundary3to2));
|
|
214
|
+
const b2to1_min = Math.min(...rows.map(r => r.boundary2to1));
|
|
215
|
+
const b2to1_max = Math.max(...rows.map(r => r.boundary2to1));
|
|
216
|
+
// 5점 영역 (맨 왼쪽)
|
|
217
|
+
g.append('rect')
|
|
218
|
+
.attr('x', 0)
|
|
219
|
+
.attr('y', yScale(1.0))
|
|
220
|
+
.attr('width', xScale(b5to4_max) - xScale(xScale.domain()[0]))
|
|
221
|
+
.attr('height', yScale(0.8) - yScale(1.0))
|
|
222
|
+
.attr('fill', SCORE_LEVELS[0].color)
|
|
223
|
+
.attr('opacity', 0.06);
|
|
224
|
+
// 4점 영역
|
|
225
|
+
g.append('rect')
|
|
226
|
+
.attr('x', xScale(b5to4_min))
|
|
227
|
+
.attr('y', yScale(0.8))
|
|
228
|
+
.attr('width', xScale(0) - xScale(b5to4_min))
|
|
229
|
+
.attr('height', yScale(0.6) - yScale(0.8))
|
|
230
|
+
.attr('fill', SCORE_LEVELS[1].color)
|
|
231
|
+
.attr('opacity', 0.06);
|
|
232
|
+
// 3점 영역
|
|
233
|
+
g.append('rect')
|
|
234
|
+
.attr('x', xScale(0))
|
|
235
|
+
.attr('y', yScale(0.6))
|
|
236
|
+
.attr('width', xScale(b3to2_max) - xScale(0))
|
|
237
|
+
.attr('height', yScale(0.4) - yScale(0.6))
|
|
238
|
+
.attr('fill', SCORE_LEVELS[2].color)
|
|
239
|
+
.attr('opacity', 0.06);
|
|
240
|
+
// 2점 영역
|
|
241
|
+
g.append('rect')
|
|
242
|
+
.attr('x', xScale(b3to2_min))
|
|
243
|
+
.attr('y', yScale(0.4))
|
|
244
|
+
.attr('width', xScale(b2to1_max) - xScale(b3to2_min))
|
|
245
|
+
.attr('height', yScale(0.2) - yScale(0.4))
|
|
246
|
+
.attr('fill', SCORE_LEVELS[3].color)
|
|
247
|
+
.attr('opacity', 0.06);
|
|
248
|
+
// 1점 영역 (맨 오른쪽)
|
|
249
|
+
g.append('rect')
|
|
250
|
+
.attr('x', xScale(b2to1_min))
|
|
251
|
+
.attr('y', yScale(0.2))
|
|
252
|
+
.attr('width', width - xScale(b2to1_min))
|
|
253
|
+
.attr('height', yScale(0) - yScale(0.2))
|
|
254
|
+
.attr('fill', SCORE_LEVELS[4].color)
|
|
255
|
+
.attr('opacity', 0.06);
|
|
256
|
+
// 경계 변동 범위를 수직 반투명 밴드로 표시
|
|
257
|
+
const boundaryRanges = [
|
|
258
|
+
{ min: b5to4_min, max: b5to4_max, color: '#666' },
|
|
259
|
+
{ min: b3to2_min, max: b3to2_max, color: '#666' },
|
|
260
|
+
{ min: b2to1_min, max: b2to1_max, color: '#666' }
|
|
261
|
+
];
|
|
262
|
+
boundaryRanges.forEach(br => {
|
|
263
|
+
if (Math.abs(br.max - br.min) > 0.0001) {
|
|
264
|
+
g.append('rect')
|
|
265
|
+
.attr('x', xScale(br.min))
|
|
266
|
+
.attr('y', 0)
|
|
267
|
+
.attr('width', xScale(br.max) - xScale(br.min))
|
|
268
|
+
.attr('height', yScale(0))
|
|
269
|
+
.attr('fill', br.color)
|
|
270
|
+
.attr('opacity', 0.05);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* 현재 공정률 기준 계단 함수 그리기
|
|
276
|
+
*/
|
|
277
|
+
drawStepFunction(g, xScale, yScale, xMin, xMax) {
|
|
278
|
+
var _a;
|
|
279
|
+
const progressIdx = Math.min(99, Math.max(0, Math.floor(this.progressRate)));
|
|
280
|
+
const row = (_a = this.grades) === null || _a === void 0 ? void 0 : _a.rows.find(r => r.progressRate === progressIdx);
|
|
281
|
+
if (!row)
|
|
282
|
+
return;
|
|
283
|
+
const boundaries = [
|
|
284
|
+
{ x: xMin, score: 1.0 }, // 5점 시작 (왼쪽 끝)
|
|
285
|
+
{ x: row.boundary5to4, score: 1.0 }, // 5점→4점 전환점
|
|
286
|
+
{ x: row.boundary5to4, score: 0.8 }, // 4점 시작
|
|
287
|
+
{ x: row.boundary4to3, score: 0.8 }, // 4점→3점 전환점
|
|
288
|
+
{ x: row.boundary4to3, score: 0.6 }, // 3점 시작
|
|
289
|
+
{ x: row.boundary3to2, score: 0.6 }, // 3점→2점 전환점
|
|
290
|
+
{ x: row.boundary3to2, score: 0.4 }, // 2점 시작
|
|
291
|
+
{ x: row.boundary2to1, score: 0.4 }, // 2점→1점 전환점
|
|
292
|
+
{ x: row.boundary2to1, score: 0.2 }, // 1점 시작
|
|
293
|
+
{ x: xMax, score: 0.2 } // 1점 끝 (오른쪽 끝)
|
|
294
|
+
];
|
|
295
|
+
// 계단 함수 영역 채우기 (반투명)
|
|
296
|
+
const areaData = [...boundaries];
|
|
297
|
+
const areaBottom = [...boundaries].reverse().map(b => ({ x: b.x, score: 0 }));
|
|
298
|
+
const area = d3
|
|
299
|
+
.area()
|
|
300
|
+
.x(d => xScale(d.x))
|
|
301
|
+
.y0(yScale(0))
|
|
302
|
+
.y1(d => yScale(d.score));
|
|
303
|
+
g.append('path')
|
|
304
|
+
.datum(boundaries)
|
|
305
|
+
.attr('d', area)
|
|
306
|
+
.attr('fill', '#1565c0')
|
|
307
|
+
.attr('opacity', 0.1);
|
|
308
|
+
// 계단 함수 라인
|
|
309
|
+
const line = d3
|
|
310
|
+
.line()
|
|
311
|
+
.x(d => xScale(d.x))
|
|
312
|
+
.y(d => yScale(d.score));
|
|
313
|
+
g.append('path')
|
|
314
|
+
.datum(boundaries)
|
|
315
|
+
.attr('d', line)
|
|
316
|
+
.attr('fill', 'none')
|
|
317
|
+
.attr('stroke', '#1565c0')
|
|
318
|
+
.attr('stroke-width', 2.5);
|
|
319
|
+
// 경계 전환점에 수직 점선
|
|
320
|
+
const verticalBoundaries = [row.boundary5to4, row.boundary4to3, row.boundary3to2, row.boundary2to1];
|
|
321
|
+
const verticalScorePairs = [
|
|
322
|
+
[1.0, 0.8],
|
|
323
|
+
[0.8, 0.6],
|
|
324
|
+
[0.6, 0.4],
|
|
325
|
+
[0.4, 0.2]
|
|
326
|
+
];
|
|
327
|
+
verticalBoundaries.forEach((bx, i) => {
|
|
328
|
+
// 수직 점선 (X축까지)
|
|
329
|
+
g.append('line')
|
|
330
|
+
.attr('x1', xScale(bx))
|
|
331
|
+
.attr('x2', xScale(bx))
|
|
332
|
+
.attr('y1', yScale(verticalScorePairs[i][0]))
|
|
333
|
+
.attr('y2', yScale(0))
|
|
334
|
+
.attr('stroke', '#999')
|
|
335
|
+
.attr('stroke-width', 0.8)
|
|
336
|
+
.attr('stroke-dasharray', '3,3');
|
|
337
|
+
// 경계값 라벨 (X축 아래)
|
|
338
|
+
g.append('text')
|
|
339
|
+
.attr('class', 'axis-label')
|
|
340
|
+
.attr('x', xScale(bx))
|
|
341
|
+
.attr('y', yScale(0) + 12)
|
|
342
|
+
.attr('text-anchor', 'middle')
|
|
343
|
+
.attr('font-size', '9px')
|
|
344
|
+
.attr('fill', '#1565c0')
|
|
345
|
+
.text(`${(bx * 100).toFixed(1)}%`);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* 현재 프로젝트 위치 표시
|
|
350
|
+
*/
|
|
351
|
+
drawCurrentValuePointer(g, xScale, yScale) {
|
|
352
|
+
if (this.value === null)
|
|
353
|
+
return;
|
|
354
|
+
const currentScore = this.getCurrentScore();
|
|
355
|
+
if (currentScore === null)
|
|
356
|
+
return;
|
|
357
|
+
const normalizedScore = currentScore / 5;
|
|
358
|
+
const cx = xScale(this.value);
|
|
359
|
+
const cy = yScale(normalizedScore);
|
|
360
|
+
// 수평 가이드라인 (Y축까지)
|
|
361
|
+
g.append('line')
|
|
362
|
+
.attr('x1', 0)
|
|
363
|
+
.attr('x2', cx)
|
|
364
|
+
.attr('y1', cy)
|
|
365
|
+
.attr('y2', cy)
|
|
366
|
+
.attr('stroke', '#e53935')
|
|
367
|
+
.attr('stroke-width', 1)
|
|
368
|
+
.attr('stroke-dasharray', '4,3')
|
|
369
|
+
.attr('opacity', 0.6);
|
|
370
|
+
// 수직 가이드라인 (X축까지)
|
|
371
|
+
g.append('line')
|
|
372
|
+
.attr('x1', cx)
|
|
373
|
+
.attr('x2', cx)
|
|
374
|
+
.attr('y1', cy)
|
|
375
|
+
.attr('y2', yScale(0))
|
|
376
|
+
.attr('stroke', '#e53935')
|
|
377
|
+
.attr('stroke-width', 1)
|
|
378
|
+
.attr('stroke-dasharray', '4,3')
|
|
379
|
+
.attr('opacity', 0.6);
|
|
380
|
+
// 포인터 원
|
|
381
|
+
g.append('circle')
|
|
382
|
+
.attr('cx', cx)
|
|
383
|
+
.attr('cy', cy)
|
|
384
|
+
.attr('r', 7)
|
|
385
|
+
.attr('fill', '#e53935')
|
|
386
|
+
.attr('stroke', '#fff')
|
|
387
|
+
.attr('stroke-width', 2.5);
|
|
388
|
+
// 포인터 위에 값 라벨
|
|
389
|
+
g.append('text')
|
|
390
|
+
.attr('x', cx)
|
|
391
|
+
.attr('y', cy - 14)
|
|
392
|
+
.attr('text-anchor', 'middle')
|
|
393
|
+
.attr('font-size', '11px')
|
|
394
|
+
.attr('font-weight', '700')
|
|
395
|
+
.attr('fill', '#e53935')
|
|
396
|
+
.text(`${(this.value * 100).toFixed(2)}% → ${normalizedScore.toFixed(1)}`);
|
|
397
|
+
}
|
|
398
|
+
drawEmptyState(svg) {
|
|
399
|
+
svg
|
|
400
|
+
.append('text')
|
|
401
|
+
.attr('x', this.chartWidth / 2)
|
|
402
|
+
.attr('y', this.chartHeight / 2)
|
|
403
|
+
.attr('text-anchor', 'middle')
|
|
404
|
+
.attr('fill', '#999')
|
|
405
|
+
.attr('font-size', '14px')
|
|
406
|
+
.text('No 2D grade data available');
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
Kpi2dLookupChart.styles = css `
|
|
410
|
+
:host {
|
|
411
|
+
display: block;
|
|
412
|
+
width: 100%;
|
|
413
|
+
height: 100%;
|
|
414
|
+
min-height: 200px;
|
|
415
|
+
}
|
|
416
|
+
svg {
|
|
417
|
+
width: 100%;
|
|
418
|
+
height: 100%;
|
|
419
|
+
display: block;
|
|
420
|
+
}
|
|
421
|
+
.chart-title {
|
|
422
|
+
font-size: 14px;
|
|
423
|
+
font-weight: 600;
|
|
424
|
+
fill: #333;
|
|
425
|
+
}
|
|
426
|
+
.value-label {
|
|
427
|
+
font-size: 12px;
|
|
428
|
+
font-weight: 600;
|
|
429
|
+
fill: #e53935;
|
|
430
|
+
}
|
|
431
|
+
.axis-label {
|
|
432
|
+
font-size: 11px;
|
|
433
|
+
fill: #999;
|
|
434
|
+
}
|
|
435
|
+
.score-label {
|
|
436
|
+
font-size: 10px;
|
|
437
|
+
fill: #666;
|
|
438
|
+
font-weight: 500;
|
|
439
|
+
}
|
|
440
|
+
.progress-label {
|
|
441
|
+
font-size: 10px;
|
|
442
|
+
fill: #1565c0;
|
|
443
|
+
font-weight: 600;
|
|
444
|
+
}
|
|
445
|
+
`;
|
|
446
|
+
__decorate([
|
|
447
|
+
property({ type: Object }),
|
|
448
|
+
__metadata("design:type", Object)
|
|
449
|
+
], Kpi2dLookupChart.prototype, "grades", void 0);
|
|
450
|
+
__decorate([
|
|
451
|
+
property({ type: Number }),
|
|
452
|
+
__metadata("design:type", Object)
|
|
453
|
+
], Kpi2dLookupChart.prototype, "value", void 0);
|
|
454
|
+
__decorate([
|
|
455
|
+
property({ type: Number }),
|
|
456
|
+
__metadata("design:type", Number)
|
|
457
|
+
], Kpi2dLookupChart.prototype, "progressRate", void 0);
|
|
458
|
+
__decorate([
|
|
459
|
+
property({ type: String }),
|
|
460
|
+
__metadata("design:type", String)
|
|
461
|
+
], Kpi2dLookupChart.prototype, "unit", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
property({ type: String }),
|
|
464
|
+
__metadata("design:type", String)
|
|
465
|
+
], Kpi2dLookupChart.prototype, "kpiName", void 0);
|
|
466
|
+
Kpi2dLookupChart = __decorate([
|
|
467
|
+
customElement('kpi-2d-lookup-chart')
|
|
468
|
+
], Kpi2dLookupChart);
|
|
469
|
+
export { Kpi2dLookupChart };
|
|
470
|
+
//# sourceMappingURL=kpi-2d-lookup-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-2d-lookup-chart.js","sourceRoot":"","sources":["../../client/components/kpi-2d-lookup-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;AA0BxB,4CAA4C;AAC5C,MAAM,YAAY,GAAG;IACnB,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;IAC5D,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EA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ement, property } from 'lit/decorators.js'\nimport * as d3 from 'd3'\n\n/**\n * X13 등 2D lookup KPI를 위한 차트 컴포넌트\n *\n * Y축: 성과수준 (0~1) — 다른 1D 차트와 동일\n * X축: 편차율 (KPI value)\n * 실선 계단: 현재 공정률 기준 편차→성과 매핑\n * 반투명 밴드: 공정률 0~100% 범위에서 경계 이동 폭\n * ● 점: 현재 프로젝트 위치\n */\n\ninterface Grade2DRow {\n progressRate: number\n boundary5to4: number\n boundary4to3: number\n boundary3to2: number\n boundary2to1: number\n}\n\ninterface Grade2DLookup {\n type: 'PROGRESS_DEVIATION_LOOKUP'\n description?: string\n rows: Grade2DRow[]\n}\n\n/* 5점→1.0, 4점→0.8, 3점→0.6, 2점→0.4, 1점→0.2 */\nconst SCORE_LEVELS = [\n { score: 5, normalized: 1.0, label: '5점', color: '#1565c0' },\n { score: 4, normalized: 0.8, label: '4점', color: '#4caf50' },\n { score: 3, normalized: 0.6, label: '3점', color: '#ffc107' },\n { score: 2, normalized: 0.4, label: '2점', color: '#ff9800' },\n { score: 1, normalized: 0.2, label: '1점', color: '#e53935' }\n]\n\n@customElement('kpi-2d-lookup-chart')\nexport class Kpi2dLookupChart extends LitElement {\n /** 2D grades 객체 ({ type: 'PROGRESS_DEVIATION_LOOKUP', rows: [...] }) */\n @property({ type: Object }) grades: Grade2DLookup | null = null\n\n /** 현재 편차율 (KPI value = formula 결과) */\n @property({ type: Number }) value: number | null = null\n\n /** 현재 공정률 (0~100) */\n @property({ type: Number }) progressRate: number = 50\n\n /** 단위 표시 */\n @property({ type: String }) unit: string = '%'\n\n /** 차트 제목 */\n @property({ type: String }) kpiName: string = ''\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n min-height: 200px;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n .chart-title {\n font-size: 14px;\n font-weight: 600;\n fill: #333;\n }\n .value-label {\n font-size: 12px;\n font-weight: 600;\n fill: #e53935;\n }\n .axis-label {\n font-size: 11px;\n fill: #999;\n }\n .score-label {\n font-size: 10px;\n fill: #666;\n font-weight: 500;\n }\n .progress-label {\n font-size: 10px;\n fill: #1565c0;\n font-weight: 600;\n }\n `\n\n private chartWidth = 0\n private chartHeight = 0\n private resizeObserver?: ResizeObserver\n\n render() {\n return html`\n <svg\n id=\"lookup-2d-chart\"\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\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.renderChart()\n }\n\n private renderChart() {\n const svg = d3.select(this.renderRoot.querySelector('#lookup-2d-chart'))\n svg.selectAll('*').remove()\n\n if (!this.grades || !this.grades.rows || this.grades.rows.length === 0) {\n this.drawEmptyState(svg)\n return\n }\n\n const w = this.chartWidth || 400\n const h = this.chartHeight || 250\n const margin = { top: 45, right: 30, bottom: 55, left: 65 }\n const plotW = w - margin.left - margin.right\n const plotH = h - margin.top - margin.bottom\n\n if (plotW <= 0 || plotH <= 0) return\n\n const g = svg.append('g').attr('transform', `translate(${margin.left},${margin.top})`)\n\n // 제목\n if (this.kpiName) {\n svg\n .append('text')\n .attr('class', 'chart-title')\n .attr('x', w / 2)\n .attr('y', 15)\n .attr('text-anchor', 'middle')\n .text(this.kpiName)\n }\n\n // 헤더 (현재 값, 점수)\n this.drawHeader(svg, w)\n\n // 차트 본체\n this.draw2DChart(g, plotW, plotH)\n }\n\n /**\n * 현재 공정률에서의 점수 계산\n */\n private getCurrentScore(): number | null {\n if (this.value === null || !this.grades?.rows) return null\n\n const progressIdx = Math.min(99, Math.max(0, Math.floor(this.progressRate)))\n const row = this.grades.rows.find(r => r.progressRate === progressIdx)\n if (!row) return null\n\n if (this.value < row.boundary5to4) return 5\n if (this.value < row.boundary4to3) return 4\n if (this.value < row.boundary3to2) return 3\n if (this.value < row.boundary2to1) return 2\n return 1\n }\n\n private drawHeader(svg: any, chartWidth: number) {\n const headerY = 32\n\n // 편차율(value) 표시\n if (this.value !== null) {\n svg\n .append('text')\n .attr('class', 'value-label')\n .attr('x', 10)\n .attr('y', headerY)\n .attr('font-size', '11px')\n .text(`편차율: ${(this.value * 100).toFixed(2)}%`)\n }\n\n // 공정률 표시\n svg\n .append('text')\n .attr('class', 'progress-label')\n .attr('x', chartWidth / 2)\n .attr('y', headerY)\n .attr('text-anchor', 'middle')\n .attr('font-size', '11px')\n .text(`공정률: ${this.progressRate.toFixed(0)}%`)\n\n // Score 표시\n const currentScore = this.getCurrentScore()\n if (currentScore !== null) {\n const normalized = currentScore / 5\n svg\n .append('text')\n .attr('class', 'value-label')\n .attr('x', chartWidth - 10)\n .attr('y', headerY)\n .attr('text-anchor', 'end')\n .attr('font-size', '11px')\n .text(`성과수준: ${normalized.toFixed(1)} (${currentScore}점)`)\n }\n }\n\n private draw2DChart(g: any, width: number, height: number) {\n const rows = this.grades!.rows\n\n // --- X축 범위 계산 (편차율) ---\n // 모든 공정률에서의 최소/최대 경계값\n const allBoundaries = rows.flatMap(r => [r.boundary5to4, r.boundary2to1])\n let xMin = Math.min(...allBoundaries)\n let xMax = Math.max(...allBoundaries)\n\n // 현재 value 포함\n if (this.value !== null) {\n xMin = Math.min(xMin, this.value)\n xMax = Math.max(xMax, this.value)\n }\n\n // 약간의 여백\n const xPadding = (xMax - xMin) * 0.08\n xMin -= xPadding\n xMax += xPadding\n\n const xScale = d3.scaleLinear().domain([xMin, xMax]).range([0, width])\n\n // --- Y축 (성과수준 0~1) ---\n const yScale = d3.scaleLinear().domain([0, 1.05]).range([height, 0])\n\n // --- 반투명 밴드: 모든 공정률에서의 경계 변동 범위 ---\n this.drawBands(g, rows, xScale, yScale, width)\n\n // --- 현재 공정률 기준 계단 함수 ---\n this.drawStepFunction(g, xScale, yScale, xMin, xMax)\n\n // --- 현재 위치 포인터 ---\n this.drawCurrentValuePointer(g, xScale, yScale)\n\n // --- 축 그리기 ---\n // Y축\n const yAxis = d3.axisLeft(yScale).tickValues([0, 0.2, 0.4, 0.6, 0.8, 1.0])\n g.append('g').call(yAxis)\n\n g.append('text')\n .attr('class', 'axis-label')\n .attr('transform', 'rotate(-90)')\n .attr('x', -height / 2)\n .attr('y', -50)\n .attr('text-anchor', 'middle')\n .attr('font-weight', 'bold')\n .text('성과수준')\n\n // X축\n const xAxis = d3\n .axisBottom(xScale)\n .ticks(8)\n .tickFormat((d: any) => `${(d * 100).toFixed(1)}%`)\n g.append('g').attr('transform', `translate(0,${height})`).call(xAxis)\n\n g.append('text')\n .attr('class', 'axis-label')\n .attr('x', width / 2)\n .attr('y', height + 42)\n .attr('text-anchor', 'middle')\n .text('편차율')\n\n // --- 점수 라벨 (우측) ---\n SCORE_LEVELS.forEach(level => {\n g.append('text')\n .attr('class', 'score-label')\n .attr('x', width + 5)\n .attr('y', yScale(level.normalized) + 4)\n .attr('fill', level.color)\n .text(level.label)\n })\n }\n\n /**\n * 반투명 밴드: 공정률 0~100% 전체에서 각 경계가 이동하는 범위\n */\n private drawBands(g: any, rows: Grade2DRow[], xScale: any, yScale: any, width: number) {\n // 각 점수 경계별로 min/max 범위 계산\n const b5to4_min = Math.min(...rows.map(r => r.boundary5to4))\n const b5to4_max = Math.max(...rows.map(r => r.boundary5to4))\n const b3to2_min = Math.min(...rows.map(r => r.boundary3to2))\n const b3to2_max = Math.max(...rows.map(r => r.boundary3to2))\n const b2to1_min = Math.min(...rows.map(r => r.boundary2to1))\n const b2to1_max = Math.max(...rows.map(r => r.boundary2to1))\n\n // 5점 영역 (맨 왼쪽)\n g.append('rect')\n .attr('x', 0)\n .attr('y', yScale(1.0))\n .attr('width', xScale(b5to4_max) - xScale(xScale.domain()[0]))\n .attr('height', yScale(0.8) - yScale(1.0))\n .attr('fill', SCORE_LEVELS[0].color)\n .attr('opacity', 0.06)\n\n // 4점 영역\n g.append('rect')\n .attr('x', xScale(b5to4_min))\n .attr('y', yScale(0.8))\n .attr('width', xScale(0) - xScale(b5to4_min))\n .attr('height', yScale(0.6) - yScale(0.8))\n .attr('fill', SCORE_LEVELS[1].color)\n .attr('opacity', 0.06)\n\n // 3점 영역\n g.append('rect')\n .attr('x', xScale(0))\n .attr('y', yScale(0.6))\n .attr('width', xScale(b3to2_max) - xScale(0))\n .attr('height', yScale(0.4) - yScale(0.6))\n .attr('fill', SCORE_LEVELS[2].color)\n .attr('opacity', 0.06)\n\n // 2점 영역\n g.append('rect')\n .attr('x', xScale(b3to2_min))\n .attr('y', yScale(0.4))\n .attr('width', xScale(b2to1_max) - xScale(b3to2_min))\n .attr('height', yScale(0.2) - yScale(0.4))\n .attr('fill', SCORE_LEVELS[3].color)\n .attr('opacity', 0.06)\n\n // 1점 영역 (맨 오른쪽)\n g.append('rect')\n .attr('x', xScale(b2to1_min))\n .attr('y', yScale(0.2))\n .attr('width', width - xScale(b2to1_min))\n .attr('height', yScale(0) - yScale(0.2))\n .attr('fill', SCORE_LEVELS[4].color)\n .attr('opacity', 0.06)\n\n // 경계 변동 범위를 수직 반투명 밴드로 표시\n const boundaryRanges = [\n { min: b5to4_min, max: b5to4_max, color: '#666' },\n { min: b3to2_min, max: b3to2_max, color: '#666' },\n { min: b2to1_min, max: b2to1_max, color: '#666' }\n ]\n\n boundaryRanges.forEach(br => {\n if (Math.abs(br.max - br.min) > 0.0001) {\n g.append('rect')\n .attr('x', xScale(br.min))\n .attr('y', 0)\n .attr('width', xScale(br.max) - xScale(br.min))\n .attr('height', yScale(0))\n .attr('fill', br.color)\n .attr('opacity', 0.05)\n }\n })\n }\n\n /**\n * 현재 공정률 기준 계단 함수 그리기\n */\n private drawStepFunction(g: any, xScale: any, yScale: any, xMin: number, xMax: number) {\n const progressIdx = Math.min(99, Math.max(0, Math.floor(this.progressRate)))\n const row = this.grades?.rows.find(r => r.progressRate === progressIdx)\n if (!row) return\n\n const boundaries = [\n { x: xMin, score: 1.0 }, // 5점 시작 (왼쪽 끝)\n { x: row.boundary5to4, score: 1.0 }, // 5점→4점 전환점\n { x: row.boundary5to4, score: 0.8 }, // 4점 시작\n { x: row.boundary4to3, score: 0.8 }, // 4점→3점 전환점\n { x: row.boundary4to3, score: 0.6 }, // 3점 시작\n { x: row.boundary3to2, score: 0.6 }, // 3점→2점 전환점\n { x: row.boundary3to2, score: 0.4 }, // 2점 시작\n { x: row.boundary2to1, score: 0.4 }, // 2점→1점 전환점\n { x: row.boundary2to1, score: 0.2 }, // 1점 시작\n { x: xMax, score: 0.2 } // 1점 끝 (오른쪽 끝)\n ]\n\n // 계단 함수 영역 채우기 (반투명)\n const areaData = [...boundaries]\n const areaBottom = [...boundaries].reverse().map(b => ({ x: b.x, score: 0 }))\n\n const area = d3\n .area<{ x: number; score: number }>()\n .x(d => xScale(d.x))\n .y0(yScale(0))\n .y1(d => yScale(d.score))\n\n g.append('path')\n .datum(boundaries)\n .attr('d', area)\n .attr('fill', '#1565c0')\n .attr('opacity', 0.1)\n\n // 계단 함수 라인\n const line = d3\n .line<{ x: number; score: number }>()\n .x(d => xScale(d.x))\n .y(d => yScale(d.score))\n\n g.append('path')\n .datum(boundaries)\n .attr('d', line)\n .attr('fill', 'none')\n .attr('stroke', '#1565c0')\n .attr('stroke-width', 2.5)\n\n // 경계 전환점에 수직 점선\n const verticalBoundaries = [row.boundary5to4, row.boundary4to3, row.boundary3to2, row.boundary2to1]\n const verticalScorePairs = [\n [1.0, 0.8],\n [0.8, 0.6],\n [0.6, 0.4],\n [0.4, 0.2]\n ]\n\n verticalBoundaries.forEach((bx, i) => {\n // 수직 점선 (X축까지)\n g.append('line')\n .attr('x1', xScale(bx))\n .attr('x2', xScale(bx))\n .attr('y1', yScale(verticalScorePairs[i][0]))\n .attr('y2', yScale(0))\n .attr('stroke', '#999')\n .attr('stroke-width', 0.8)\n .attr('stroke-dasharray', '3,3')\n\n // 경계값 라벨 (X축 아래)\n g.append('text')\n .attr('class', 'axis-label')\n .attr('x', xScale(bx))\n .attr('y', yScale(0) + 12)\n .attr('text-anchor', 'middle')\n .attr('font-size', '9px')\n .attr('fill', '#1565c0')\n .text(`${(bx * 100).toFixed(1)}%`)\n })\n }\n\n /**\n * 현재 프로젝트 위치 표시\n */\n private drawCurrentValuePointer(g: any, xScale: any, yScale: any) {\n if (this.value === null) return\n\n const currentScore = this.getCurrentScore()\n if (currentScore === null) return\n\n const normalizedScore = currentScore / 5\n const cx = xScale(this.value)\n const cy = yScale(normalizedScore)\n\n // 수평 가이드라인 (Y축까지)\n g.append('line')\n .attr('x1', 0)\n .attr('x2', cx)\n .attr('y1', cy)\n .attr('y2', cy)\n .attr('stroke', '#e53935')\n .attr('stroke-width', 1)\n .attr('stroke-dasharray', '4,3')\n .attr('opacity', 0.6)\n\n // 수직 가이드라인 (X축까지)\n g.append('line')\n .attr('x1', cx)\n .attr('x2', cx)\n .attr('y1', cy)\n .attr('y2', yScale(0))\n .attr('stroke', '#e53935')\n .attr('stroke-width', 1)\n .attr('stroke-dasharray', '4,3')\n .attr('opacity', 0.6)\n\n // 포인터 원\n g.append('circle')\n .attr('cx', cx)\n .attr('cy', cy)\n .attr('r', 7)\n .attr('fill', '#e53935')\n .attr('stroke', '#fff')\n .attr('stroke-width', 2.5)\n\n // 포인터 위에 값 라벨\n g.append('text')\n .attr('x', cx)\n .attr('y', cy - 14)\n .attr('text-anchor', 'middle')\n .attr('font-size', '11px')\n .attr('font-weight', '700')\n .attr('fill', '#e53935')\n .text(`${(this.value * 100).toFixed(2)}% → ${normalizedScore.toFixed(1)}`)\n }\n\n private drawEmptyState(svg: any) {\n svg\n .append('text')\n .attr('x', this.chartWidth / 2)\n .attr('y', this.chartHeight / 2)\n .attr('text-anchor', 'middle')\n .attr('fill', '#999')\n .attr('font-size', '14px')\n .text('No 2D grade data available')\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './kpi-grade-2d-editor.js';
|
|
2
|
+
import { TemplateResult } from 'lit';
|
|
3
|
+
import { KpiListPage } from '@things-factory/kpi/dist-client/pages/kpi/kpi-list-page.js';
|
|
4
|
+
import { KpiGrade2dEditor } from './kpi-grade-2d-editor.js';
|
|
5
|
+
export declare class DsspKpiListPage extends KpiListPage {
|
|
6
|
+
static get scopedElements(): {
|
|
7
|
+
'kpi-grade-2d-editor': typeof KpiGrade2dEditor;
|
|
8
|
+
'kpi-importer': typeof import("@things-factory/kpi/dist-client/pages/kpi/kpi-importer.js").KpiImporter;
|
|
9
|
+
'kpi-grade-editor': typeof import("@things-factory/kpi/dist-client/pages/kpi/kpi-grade-editor.js").KpiGradeEditor;
|
|
10
|
+
'kpi-viz-editor': typeof import("@things-factory/kpi/dist-client/pages/kpi/kpi-viz-editor.js").KpiVizEditor;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* CUSTOM scoreType 셀 렌더러.
|
|
14
|
+
* 2D 룩업 구조인 경우 행 수와 함께 표시.
|
|
15
|
+
*/
|
|
16
|
+
protected renderCustomGradesCell(kpi: any): TemplateResult;
|
|
17
|
+
/**
|
|
18
|
+
* CUSTOM scoreType 편집.
|
|
19
|
+
* 2D 룩업이면 kpi-grade-2d-editor 팝업을 연다.
|
|
20
|
+
*/
|
|
21
|
+
protected _editCustomGrades(kpi: any): Promise<void>;
|
|
22
|
+
}
|