@dssp/dkpi 1.0.0-y.0 → 1.0.1
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/KPI-STATISTICS-SERVICE.md +233 -0
- package/_index.html +4 -9
- package/assets/helps/index.md +1 -1
- package/assets/images/project-image.png +0 -0
- package/assets/manifest.json +2 -2
- package/config/config.development.js +2 -1
- package/config/config.production.js +2 -1
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +15 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +50 -0
- package/dist-client/components/kpi-2d-lookup-chart.js +263 -0
- package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-boxplot-chart.d.ts +31 -0
- package/dist-client/components/kpi-boxplot-chart.js +306 -0
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-lookup-chart.d.ts +58 -0
- package/dist-client/components/kpi-lookup-chart.js +464 -0
- package/dist-client/components/kpi-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/components/kpi-mini-trend-chart.js +180 -0
- package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/components/kpi-radar-chart.d.ts +17 -0
- package/dist-client/components/kpi-radar-chart.js +259 -0
- package/dist-client/components/kpi-radar-chart.js.map +1 -0
- package/dist-client/components/kpi-single-boxplot-chart.d.ts +14 -2
- package/dist-client/components/kpi-single-boxplot-chart.js +237 -137
- package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -1
- package/dist-client/components/kpi-step-lookup-chart.d.ts +33 -0
- package/dist-client/components/kpi-step-lookup-chart.js +181 -0
- package/dist-client/components/kpi-step-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-trend-chart.d.ts +25 -0
- package/dist-client/components/kpi-trend-chart.js +241 -0
- package/dist-client/components/kpi-trend-chart.js.map +1 -0
- package/dist-client/entries/auth/checkin.d.ts +38 -0
- package/dist-client/entries/auth/checkin.js +551 -0
- package/dist-client/entries/auth/checkin.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +35 -0
- package/dist-client/google-map/common-google-map.js +349 -0
- package/dist-client/google-map/common-google-map.js.map +1 -0
- package/dist-client/google-map/google-map-loader.d.ts +6 -0
- package/dist-client/google-map/google-map-loader.js +23 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/pages/component/project-update-header.d.ts +1 -0
- package/dist-client/pages/component/project-update-header.js +127 -0
- package/dist-client/pages/component/project-update-header.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/dssp-kpi-overview.d.ts +47 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +393 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.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-admin/kpi-system-guide.d.ts +18 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js +696 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +259 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +22 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +346 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +26 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +433 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +46 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +945 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +34 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +238 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +37 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +689 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +57 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +866 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +63 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1097 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- 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 -13
- 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 +20 -11
- 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 +22 -33
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +56 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +609 -67
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +15 -3
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +180 -65
- 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 +13 -4
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +213 -91
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +51 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +693 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
- package/dist-client/pages/sv-project-complete.d.ts +12 -3
- package/dist-client/pages/sv-project-complete.js +175 -29
- package/dist-client/pages/sv-project-complete.js.map +1 -1
- package/dist-client/pages/sv-project-completed-list.d.ts +3 -0
- package/dist-client/pages/sv-project-completed-list.js +81 -22
- package/dist-client/pages/sv-project-completed-list.js.map +1 -1
- package/dist-client/pages/sv-project-detail.d.ts +60 -0
- package/dist-client/pages/sv-project-detail.js +1092 -85
- package/dist-client/pages/sv-project-detail.js.map +1 -1
- package/dist-client/pages/sv-project-list.d.ts +20 -2
- package/dist-client/pages/sv-project-list.js +180 -30
- package/dist-client/pages/sv-project-list.js.map +1 -1
- package/dist-client/pages/sv-project-update.d.ts +91 -0
- package/dist-client/pages/sv-project-update.js +1150 -0
- package/dist-client/pages/sv-project-update.js.map +1 -0
- package/dist-client/pages/sv-user-management.d.ts +1 -0
- package/dist-client/pages/sv-user-management.js +5 -0
- package/dist-client/pages/sv-user-management.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +29 -2
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +45 -5
- package/dist-client/shared/complete-api.js +177 -28
- package/dist-client/shared/complete-api.js.map +1 -1
- package/dist-client/shared/func.d.ts +1 -1
- package/dist-client/shared/func.js.map +1 -1
- package/dist-client/shared/geo-group-mapping.d.ts +25 -0
- package/dist-client/shared/geo-group-mapping.js +189 -0
- package/dist-client/shared/geo-group-mapping.js.map +1 -0
- package/dist-client/shared/integration-fetch.d.ts +35 -0
- package/dist-client/shared/integration-fetch.js +53 -0
- package/dist-client/shared/integration-fetch.js.map +1 -0
- package/dist-client/shared/kpi-project-sync.d.ts +16 -0
- package/dist-client/shared/kpi-project-sync.js +129 -0
- package/dist-client/shared/kpi-project-sync.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +11 -3
- package/dist-client/viewparts/menu-tools.js +126 -75
- 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.d.ts +4 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js +423 -77
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -1
- package/dist-server/scripts/recalculate-by-project-name.d.ts +2 -0
- package/dist-server/scripts/recalculate-by-project-name.js +72 -0
- package/dist-server/scripts/recalculate-by-project-name.js.map +1 -0
- package/dist-server/service/index.d.ts +1 -3
- package/dist-server/service/index.js +3 -4
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +192 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +993 -38
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +9 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +33 -8
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -1
- package/dist-server/service/kpi-stat/index.d.ts +4 -0
- package/dist-server/service/kpi-stat/index.js +8 -0
- package/dist-server/service/kpi-stat/index.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +13 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js +751 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +32 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js +180 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -1
- package/dist-server/service/kpi-value/kpi-value-query.js +49 -6
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/kpi-module-service-tests.md +1286 -0
- package/kpi-module-test-report.md +676 -0
- package/kpi-module-unit-test-detailed-report.md +925 -0
- package/kpi-module-unit-tests-detailed.md +1452 -0
- package/openapi/unstable.yaml +2 -2
- package/package.json +58 -54
- package/recalculate-batch.sh +64 -0
- package/recalculate-projects-range.sh +98 -0
- package/schema.graphql +1159 -55
- package/things-factory.config.js +6 -1
- package/translations/en.json +5 -1
- package/translations/ko.json +5 -1
- package/views/auth-page.html +4 -5
- package/views/public/home.html +5 -6
|
@@ -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,C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CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;iBAC1B,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC;iBACpB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;iBAC5B,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;YAE5B,UAAU;YACV,WAAW;iBACR,MAAM,CAAC,MAAM,CAAC;iBACd,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;iBACb,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;iBACZ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;iBACzB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;iBACpB,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC;iBACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;;AAlPM,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;GAWlB,AAXY,CAWZ;AApB0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;6CAAiB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;mDAA0B;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAG1B;AARU,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CA6P3B","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport * as d3 from 'd3'\n\n@customElement('sv-kpi-radar-chart')\nexport class SvKpiRadarChart 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 @property({ type: Object }) seriesColors: Record<string, string> = {\n 기준평균: '#E3F2FD',\n 프로젝트성과: '#2196F3'\n }\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\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 // 레전드를 위한 공간 확보 (org가 2개 이상일 때만 — 단일 시리즈면 범례 불필요)\n const legendWidth = orgData.length > 1 ? 120 : 0\n const chartWidth = w - legendWidth\n const chartHeight = h\n const r = Math.min(chartWidth, chartHeight) / 2 - 40\n const angleSlice = (2 * Math.PI) / (this.categories.length || 1)\n\n // 스케일 - 0-100 고정 범위 사용 (박스플롯과 동일한 범위)\n const dataMaxValue = d3.max(this.data, d => d[this.valueKey]) || 1\n const maxValue = Math.max(100, dataMaxValue) // 최소 100까지 표시\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(${chartWidth / 2},${chartHeight / 2})`)\n\n // 그리드/축\n for (let i = 1; i <= 5; i++) {\n const gridRadius = (r / 5) * i\n const gridValue = (maxValue / 5) * i\n\n g.append('circle').attr('r', gridRadius).attr('fill', 'none').attr('stroke', '#ccc')\n\n // 그리드 값 라벨 (30도 시계방향 = Y1에서 30도 회전)\n // 차트가 위쪽에서 시작하므로 -90도 + 30도 = -60도\n const labelAngle = (-60 * Math.PI) / 180\n g.append('text')\n .attr('x', gridRadius * Math.cos(labelAngle))\n .attr('y', gridRadius * Math.sin(labelAngle))\n .attr('text-anchor', 'middle')\n .attr('alignment-baseline', 'middle')\n .attr('font-size', 10)\n .attr('fill', '#999')\n .attr('background', '#fff')\n .text(gridValue.toFixed(0))\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 .attr('fill', '#333')\n .text(cat)\n })\n\n // 그룹별 폴리곤 - 기준평균을 먼저 그리고 프로젝트성과를 위에 그리기\n const sortedOrgData = orgData.sort((a, b) => {\n if (a.org === '기준평균') return -1\n if (b.org === '기준평균') return 1\n return 0\n })\n\n sortedOrgData.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\n // 색상 및 스타일 결정\n const baseColor = this.seriesColors[gd.org] || '#ccc'\n const fillColor =\n gd.org === '기준평균'\n ? 'rgba(76,175,80,0.4)' // 진한 녹색 배경\n : 'rgba(33,150,243,0.4)' // 진한 파란색 배경\n const strokeColor =\n gd.org === '기준평균'\n ? '#4CAF50' // 진한 녹색 선\n : '#2196F3' // 진한 파란색 선\n const strokeWidth = gd.org === '프로젝트성과' ? 1.5 : 1.5\n\n g.append('path')\n .datum(closedValues)\n .attr('d', line as any)\n .attr('fill', fillColor)\n .attr('stroke', strokeColor)\n .attr('stroke-width', strokeWidth)\n .attr('stroke-dasharray', 'none') // 모두 직선으로 변경\n })\n\n // 툴팁\n const tooltip = svg.append('g').attr('class', 'radar-tooltip').attr('visibility', 'hidden')\n tooltip.append('rect').attr('rx', 4).attr('ry', 4).attr('fill', 'rgba(33,33,33,0.9)')\n tooltip.append('text').attr('fill', '#fff').attr('font-size', '10px')\n\n const showTip = (evt: MouseEvent, lines: string[]) => {\n const tipText = tooltip.select('text')\n tipText.selectAll('tspan').remove()\n lines.forEach((line, i) => {\n tipText.append('tspan').attr('x', 8).attr('dy', i === 0 ? 14 : 13).text(line)\n })\n const tipW = Math.max(...lines.map(l => l.length)) * 8 + 24\n const tipH = lines.length * 13 + 10\n const [mx, my] = d3.pointer(evt, svg.node())\n tooltip.select('rect').attr('x', mx + 10).attr('y', my - tipH - 5).attr('width', tipW).attr('height', tipH)\n tipText.attr('transform', `translate(${mx + 10},${my - tipH - 5})`)\n tooltip.attr('visibility', 'visible').raise()\n }\n const hideTip = () => tooltip.attr('visibility', 'hidden')\n\n // 데이터 포인트 표시\n sortedOrgData.forEach(gd => {\n gd.values.forEach((d, i) => {\n const angle = i * angleSlice - Math.PI / 2\n const pointRadius = radius(d.value)\n const px = pointRadius * Math.cos(angle)\n const py = pointRadius * Math.sin(angle)\n\n g.append('circle')\n .attr('cx', px)\n .attr('cy', py)\n .attr('r', 3)\n .attr('fill', gd.org === '기준평균' ? '#4CAF50' : '#2196F3')\n .attr('stroke', '#fff')\n .attr('stroke-width', 1)\n .style('cursor', 'pointer')\n .on('mouseenter', (evt: MouseEvent) => showTip(evt, [\n `${d.category} — ${gd.org}`,\n `값: ${Number(d.value).toFixed(1)}`\n ]))\n .on('mouseleave', hideTip)\n })\n })\n\n // 레전드 추가 (org가 2개 이상일 때만 — 단일 시리즈에서는 자동 미표시)\n if (orgData.length > 1) {\n const legend = svg\n .append('g')\n .attr('class', 'legend')\n .attr('transform', `translate(${chartWidth + 20}, ${chartHeight / 2 - 30})`)\n\n const legendData = [\n { label: '기준평균값', color: '#4CAF50', strokeStyle: 'none' },\n { label: '프로젝트 성과', color: '#2196F3', strokeStyle: 'none' }\n ]\n\n const legendItems = legend\n .selectAll('.legend-item')\n .data(legendData)\n .enter()\n .append('g')\n .attr('class', 'legend-item')\n .attr('transform', (d, i) => `translate(0, ${i * 25})`)\n\n // 레전드 아이콘 (작은 사각형)\n legendItems\n .append('rect')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', 12)\n .attr('height', 12)\n .attr('fill', d => d.color)\n .attr('opacity', 0.6)\n .attr('stroke', d => d.color)\n .attr('stroke-width', 1.5)\n\n // 레전드 텍스트\n legendItems\n .append('text')\n .attr('x', 18)\n .attr('y', 9)\n .attr('font-size', '12px')\n .attr('fill', '#333')\n .attr('alignment-baseline', 'middle')\n .text(d => d.label)\n }\n }\n}\n"]}
|
|
@@ -10,9 +10,21 @@ export declare class KpiSingleBoxplotChart extends LitElement {
|
|
|
10
10
|
valueKey: string;
|
|
11
11
|
color: string;
|
|
12
12
|
vertical: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* y축 스케일 모드:
|
|
15
|
+
* - fitToData=true(기본): 각 구성값의 min/max(수염 양끝)로 전체 높이를 채움(자동맞춤).
|
|
16
|
+
* 범위 밖 현재값은 clamp 되어 끝에 표시(도메인을 늘리지 않음). → 고객 선호 기본 동작.
|
|
17
|
+
* - fitToData=false: domainMin~domainMax(기본 0~100) 고정 스케일.
|
|
18
|
+
*/
|
|
19
|
+
fitToData: boolean;
|
|
20
|
+
domainMin: number;
|
|
21
|
+
domainMax: number;
|
|
22
|
+
/** 현재 모드에 맞는 [min, max] 도메인 계산 */
|
|
23
|
+
private computeDomain;
|
|
13
24
|
static styles: import("lit").CSSResult;
|
|
14
|
-
|
|
15
|
-
private
|
|
25
|
+
/** 현재 host 크기 (ResizeObserver 가 채움). viewBox 를 이 값으로 동적 설정 → 여백 없이 풀 채움. */
|
|
26
|
+
private vbW;
|
|
27
|
+
private vbH;
|
|
16
28
|
private resizeObserver?;
|
|
17
29
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
30
|
connectedCallback(): void;
|
|
@@ -15,29 +15,50 @@ let KpiSingleBoxplotChart = class KpiSingleBoxplotChart extends LitElement {
|
|
|
15
15
|
this.valueKey = 'value';
|
|
16
16
|
this.color = '#2196f3';
|
|
17
17
|
this.vertical = true; // true: 세로형, false: 가로형
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* y축 스케일 모드:
|
|
20
|
+
* - fitToData=true(기본): 각 구성값의 min/max(수염 양끝)로 전체 높이를 채움(자동맞춤).
|
|
21
|
+
* 범위 밖 현재값은 clamp 되어 끝에 표시(도메인을 늘리지 않음). → 고객 선호 기본 동작.
|
|
22
|
+
* - fitToData=false: domainMin~domainMax(기본 0~100) 고정 스케일.
|
|
23
|
+
*/
|
|
24
|
+
this.fitToData = true;
|
|
25
|
+
this.domainMin = 0;
|
|
26
|
+
this.domainMax = 100;
|
|
27
|
+
/** 현재 host 크기 (ResizeObserver 가 채움). viewBox 를 이 값으로 동적 설정 → 여백 없이 풀 채움. */
|
|
28
|
+
this.vbW = 200;
|
|
29
|
+
this.vbH = 200;
|
|
30
|
+
}
|
|
31
|
+
/** 현재 모드에 맞는 [min, max] 도메인 계산 */
|
|
32
|
+
computeDomain() {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
if (this.fitToData) {
|
|
35
|
+
const lo = Number((_a = this.data) === null || _a === void 0 ? void 0 : _a[this.minKey]);
|
|
36
|
+
const hi = Number((_b = this.data) === null || _b === void 0 ? void 0 : _b[this.maxKey]);
|
|
37
|
+
if (isFinite(lo) && isFinite(hi) && hi > lo)
|
|
38
|
+
return [lo, hi];
|
|
39
|
+
}
|
|
40
|
+
return [this.domainMin, this.domainMax];
|
|
20
41
|
}
|
|
21
42
|
render() {
|
|
43
|
+
// 초기 viewBox 는 200x200. ResizeObserver 가 컨테이너 크기로 갱신.
|
|
22
44
|
return html `
|
|
23
|
-
<svg
|
|
24
|
-
id="single-boxplot"
|
|
25
|
-
width=${this.chartWidth}
|
|
26
|
-
height=${this.chartHeight}
|
|
27
|
-
viewBox="0 0 ${this.chartWidth} ${this.chartHeight}"
|
|
28
|
-
preserveAspectRatio="xMidYMid meet"
|
|
29
|
-
></svg>
|
|
45
|
+
<svg id="single-boxplot" viewBox="0 0 200 200" preserveAspectRatio="xMidYMid meet"></svg>
|
|
30
46
|
`;
|
|
31
47
|
}
|
|
32
48
|
connectedCallback() {
|
|
33
49
|
super.connectedCallback();
|
|
50
|
+
// host 크기 변경 시 viewBox 를 컨테이너 비율로 맞춰 D3 만 다시 그리기 (Lit requestUpdate X).
|
|
34
51
|
this.resizeObserver = new ResizeObserver(entries => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
const entry = entries[0];
|
|
53
|
+
if (!entry)
|
|
54
|
+
return;
|
|
55
|
+
const w = Math.max(1, entry.contentRect.width);
|
|
56
|
+
const h = Math.max(1, entry.contentRect.height);
|
|
57
|
+
if (w === this.vbW && h === this.vbH)
|
|
58
|
+
return;
|
|
59
|
+
this.vbW = w;
|
|
60
|
+
this.vbH = h;
|
|
61
|
+
this.drawSingleBoxplot();
|
|
41
62
|
});
|
|
42
63
|
this.resizeObserver.observe(this);
|
|
43
64
|
}
|
|
@@ -51,13 +72,17 @@ let KpiSingleBoxplotChart = class KpiSingleBoxplotChart extends LitElement {
|
|
|
51
72
|
}
|
|
52
73
|
drawSingleBoxplot() {
|
|
53
74
|
const svg = d3.select(this.renderRoot.querySelector('#single-boxplot'));
|
|
75
|
+
if (svg.empty())
|
|
76
|
+
return;
|
|
54
77
|
svg.selectAll('*').remove();
|
|
55
78
|
// 데이터 검증
|
|
56
79
|
if (!this.data || Object.keys(this.data).length === 0) {
|
|
57
80
|
return;
|
|
58
81
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
82
|
+
// viewBox 를 host 실제 크기로 — preserveAspectRatio 와 무관하게 풀 채움.
|
|
83
|
+
const w = this.vbW;
|
|
84
|
+
const h = this.vbH;
|
|
85
|
+
svg.attr('viewBox', `0 0 ${w} ${h}`);
|
|
61
86
|
const margin = 20;
|
|
62
87
|
const plotW = w - margin * 2;
|
|
63
88
|
const plotH = h - margin * 2;
|
|
@@ -79,182 +104,239 @@ let KpiSingleBoxplotChart = class KpiSingleBoxplotChart extends LitElement {
|
|
|
79
104
|
if (this.data[this.valueKey] != null) {
|
|
80
105
|
values.push(this.data[this.valueKey]);
|
|
81
106
|
}
|
|
82
|
-
const g = svg
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
107
|
+
const g = svg.append('g').attr('transform', `translate(${margin}, ${margin})`);
|
|
108
|
+
// 툴팁
|
|
109
|
+
const tooltip = svg.append('g').attr('class', 'sb-tooltip').attr('visibility', 'hidden');
|
|
110
|
+
tooltip.append('rect').attr('rx', 4).attr('ry', 4).attr('fill', 'rgba(33,33,33,0.9)');
|
|
111
|
+
tooltip.append('text').attr('fill', '#fff').attr('font-size', '10px');
|
|
112
|
+
const showTip = (evt, lines) => {
|
|
113
|
+
const tipText = tooltip.select('text');
|
|
114
|
+
tipText.selectAll('tspan').remove();
|
|
115
|
+
lines.forEach((line, i) => {
|
|
116
|
+
tipText.append('tspan').attr('x', 8).attr('dy', i === 0 ? 14 : 13).text(line);
|
|
117
|
+
});
|
|
118
|
+
const tipW = Math.max(...lines.map(l => l.length)) * 8 + 24;
|
|
119
|
+
const tipH = lines.length * 13 + 10;
|
|
120
|
+
const [mx, my] = d3.pointer(evt, svg.node());
|
|
121
|
+
const tx = Math.min(mx + 10, w - tipW - 5);
|
|
122
|
+
const ty = Math.max(my - tipH - 5, 5);
|
|
123
|
+
tooltip.select('rect').attr('x', tx).attr('y', ty).attr('width', tipW).attr('height', tipH);
|
|
124
|
+
tipText.attr('transform', `translate(${tx},${ty})`);
|
|
125
|
+
tooltip.attr('visibility', 'visible').raise();
|
|
126
|
+
};
|
|
127
|
+
const hideTip = () => tooltip.attr('visibility', 'hidden');
|
|
87
128
|
if (this.vertical) {
|
|
88
|
-
|
|
89
|
-
this.drawVerticalBoxplot(g, plotW, plotH, values);
|
|
129
|
+
this.drawVerticalBoxplot(g, plotW, plotH, showTip, hideTip);
|
|
90
130
|
}
|
|
91
131
|
else {
|
|
92
|
-
|
|
93
|
-
this.drawHorizontalBoxplot(g, plotW, plotH, values);
|
|
132
|
+
this.drawHorizontalBoxplot(g, plotW, plotH, showTip, hideTip);
|
|
94
133
|
}
|
|
95
134
|
}
|
|
96
|
-
drawVerticalBoxplot(g, plotW, plotH,
|
|
97
|
-
|
|
135
|
+
drawVerticalBoxplot(g, plotW, plotH, showTip, hideTip) {
|
|
136
|
+
// 스케일 모드(computeDomain): 기본은 데이터 min/max 자동맞춤, 옵션으로 0~100 고정.
|
|
137
|
+
// clamp 로 도메인 밖 현재값은 끝에 고정(도메인 확장 안 함).
|
|
98
138
|
const y = d3
|
|
99
139
|
.scaleLinear()
|
|
100
|
-
.domain(
|
|
101
|
-
.
|
|
102
|
-
.
|
|
103
|
-
const boxWidth = Math.min(plotW * 0.6,
|
|
104
|
-
const
|
|
105
|
-
//
|
|
106
|
-
const
|
|
107
|
-
const lowerFence = this.data[this.q1Key] - 1.5 * iqr;
|
|
108
|
-
const upperFence = this.data[this.q3Key] + 1.5 * iqr;
|
|
109
|
-
const actualMin = Math.max(this.data[this.minKey], lowerFence);
|
|
110
|
-
const actualMax = Math.min(this.data[this.maxKey], upperFence);
|
|
111
|
-
// 박스
|
|
140
|
+
.domain(this.computeDomain())
|
|
141
|
+
.range([plotH, 0])
|
|
142
|
+
.clamp(true);
|
|
143
|
+
const boxWidth = Math.min(plotW * 0.6, 80);
|
|
144
|
+
const centerX = plotW / 2;
|
|
145
|
+
// 박스 (Q1 ~ Q3)
|
|
146
|
+
const boxHeight = y(this.data[this.q1Key]) - y(this.data[this.q3Key]);
|
|
112
147
|
g.append('rect')
|
|
113
|
-
.attr('x',
|
|
114
|
-
.attr('y', y(
|
|
148
|
+
.attr('x', centerX - boxWidth / 2)
|
|
149
|
+
.attr('y', y(this.data[this.q3Key]))
|
|
115
150
|
.attr('width', boxWidth)
|
|
116
|
-
.attr('height',
|
|
117
|
-
.attr('fill',
|
|
118
|
-
.attr('opacity', 0.
|
|
119
|
-
.attr('stroke', '#
|
|
120
|
-
.attr('stroke-width', 1)
|
|
121
|
-
|
|
151
|
+
.attr('height', boxHeight)
|
|
152
|
+
.attr('fill', '#B3D4FC')
|
|
153
|
+
.attr('opacity', 0.8)
|
|
154
|
+
.attr('stroke', '#7BB3F0')
|
|
155
|
+
.attr('stroke-width', 1)
|
|
156
|
+
.style('cursor', 'pointer')
|
|
157
|
+
.on('mouseenter', (evt) => showTip(evt, [
|
|
158
|
+
`최대: ${Number(this.data[this.maxKey]).toFixed(1)}`,
|
|
159
|
+
`Q3: ${Number(this.data[this.q3Key]).toFixed(1)}`,
|
|
160
|
+
`중앙값: ${Number(this.data[this.medianKey]).toFixed(1)}`,
|
|
161
|
+
`Q1: ${Number(this.data[this.q1Key]).toFixed(1)}`,
|
|
162
|
+
`최소: ${Number(this.data[this.minKey]).toFixed(1)}`,
|
|
163
|
+
`평균: ${Number(this.data[this.meanKey]).toFixed(1)}`
|
|
164
|
+
]))
|
|
165
|
+
.on('mouseleave', () => hideTip());
|
|
166
|
+
// 중앙선 (Median)
|
|
122
167
|
g.append('line')
|
|
123
|
-
.attr('x1',
|
|
124
|
-
.attr('x2',
|
|
168
|
+
.attr('x1', centerX - boxWidth / 2)
|
|
169
|
+
.attr('x2', centerX + boxWidth / 2)
|
|
125
170
|
.attr('y1', y(this.data[this.medianKey]))
|
|
126
171
|
.attr('y2', y(this.data[this.medianKey]))
|
|
127
|
-
.attr('stroke', '#
|
|
128
|
-
.attr('stroke-width',
|
|
129
|
-
// 수염
|
|
130
|
-
|
|
172
|
+
.attr('stroke', '#7BB3F0')
|
|
173
|
+
.attr('stroke-width', 1.5);
|
|
174
|
+
// 위쪽 수염 (Q3 ~ Max)
|
|
175
|
+
g.append('line')
|
|
176
|
+
.attr('x1', centerX)
|
|
177
|
+
.attr('x2', centerX)
|
|
178
|
+
.attr('y1', y(this.data[this.q3Key]))
|
|
179
|
+
.attr('y2', y(this.data[this.maxKey]))
|
|
180
|
+
.attr('stroke', '#7BB3F0')
|
|
181
|
+
.attr('stroke-width', 1);
|
|
182
|
+
// 아래쪽 수염 (Min ~ Q1)
|
|
131
183
|
g.append('line')
|
|
132
184
|
.attr('x1', centerX)
|
|
133
185
|
.attr('x2', centerX)
|
|
134
|
-
.attr('y1', y(
|
|
135
|
-
.attr('y2', y(
|
|
136
|
-
.attr('stroke', '#
|
|
186
|
+
.attr('y1', y(this.data[this.minKey]))
|
|
187
|
+
.attr('y2', y(this.data[this.q1Key]))
|
|
188
|
+
.attr('stroke', '#7BB3F0')
|
|
137
189
|
.attr('stroke-width', 1);
|
|
138
|
-
//
|
|
139
|
-
const capWidth = boxWidth
|
|
190
|
+
// Max 캡
|
|
191
|
+
const capWidth = boxWidth * 0.6;
|
|
140
192
|
g.append('line')
|
|
141
193
|
.attr('x1', centerX - capWidth / 2)
|
|
142
194
|
.attr('x2', centerX + capWidth / 2)
|
|
143
|
-
.attr('y1', y(
|
|
144
|
-
.attr('y2', y(
|
|
145
|
-
.attr('stroke', '#
|
|
195
|
+
.attr('y1', y(this.data[this.maxKey]))
|
|
196
|
+
.attr('y2', y(this.data[this.maxKey]))
|
|
197
|
+
.attr('stroke', '#7BB3F0')
|
|
146
198
|
.attr('stroke-width', 1);
|
|
199
|
+
// Min 캡
|
|
147
200
|
g.append('line')
|
|
148
201
|
.attr('x1', centerX - capWidth / 2)
|
|
149
202
|
.attr('x2', centerX + capWidth / 2)
|
|
150
|
-
.attr('y1', y(
|
|
151
|
-
.attr('y2', y(
|
|
152
|
-
.attr('stroke', '#
|
|
203
|
+
.attr('y1', y(this.data[this.minKey]))
|
|
204
|
+
.attr('y2', y(this.data[this.minKey]))
|
|
205
|
+
.attr('stroke', '#7BB3F0')
|
|
153
206
|
.attr('stroke-width', 1);
|
|
154
|
-
//
|
|
155
|
-
if (this.data[this.
|
|
156
|
-
g.append('circle')
|
|
157
|
-
.attr('cx', centerX)
|
|
158
|
-
.attr('cy', y(this.data[this.minKey]))
|
|
159
|
-
.attr('r', 4.5)
|
|
160
|
-
.attr('fill', '#ff4444');
|
|
161
|
-
}
|
|
162
|
-
if (this.data[this.maxKey] > upperFence) {
|
|
207
|
+
// 평균값 (초록색)
|
|
208
|
+
if (this.data[this.meanKey] != null) {
|
|
163
209
|
g.append('circle')
|
|
164
210
|
.attr('cx', centerX)
|
|
165
|
-
.attr('cy', y(this.data[this.
|
|
166
|
-
.attr('r',
|
|
167
|
-
.attr('fill', '#
|
|
211
|
+
.attr('cy', y(this.data[this.meanKey]))
|
|
212
|
+
.attr('r', 3)
|
|
213
|
+
.attr('fill', '#4CAF50')
|
|
214
|
+
.attr('stroke', '#fff')
|
|
215
|
+
.attr('stroke-width', 1)
|
|
216
|
+
.style('cursor', 'pointer')
|
|
217
|
+
.on('mouseenter', (evt) => showTip(evt, [`평균: ${Number(this.data[this.meanKey]).toFixed(1)}`]))
|
|
218
|
+
.on('mouseleave', () => hideTip());
|
|
168
219
|
}
|
|
169
|
-
// 현재값 (
|
|
220
|
+
// 현재값 (오렌지색)
|
|
170
221
|
if (this.data[this.valueKey] != null) {
|
|
222
|
+
const currentValue = this.data[this.valueKey];
|
|
223
|
+
const isOutlier = currentValue < this.data[this.minKey] || currentValue > this.data[this.maxKey];
|
|
171
224
|
g.append('circle')
|
|
172
225
|
.attr('cx', centerX)
|
|
173
|
-
.attr('cy', y(
|
|
174
|
-
.attr('r',
|
|
175
|
-
.attr('fill', '#
|
|
226
|
+
.attr('cy', y(currentValue))
|
|
227
|
+
.attr('r', 5)
|
|
228
|
+
.attr('fill', '#e53935')
|
|
229
|
+
.attr('stroke', '#fff')
|
|
230
|
+
.attr('stroke-width', 1)
|
|
231
|
+
.style('cursor', 'pointer')
|
|
232
|
+
.on('mouseenter', (evt) => showTip(evt, [
|
|
233
|
+
`현재 프로젝트: ${Number(currentValue).toFixed(1)}`,
|
|
234
|
+
isOutlier ? '⚠ 이상치' : '정상 범위'
|
|
235
|
+
]))
|
|
236
|
+
.on('mouseleave', () => hideTip());
|
|
176
237
|
}
|
|
177
238
|
}
|
|
178
|
-
drawHorizontalBoxplot(g, plotW, plotH,
|
|
179
|
-
|
|
239
|
+
drawHorizontalBoxplot(g, plotW, plotH, showTip, hideTip) {
|
|
240
|
+
// 스케일 모드(computeDomain): 기본은 데이터 min/max 자동맞춤, 옵션으로 0~100 고정.
|
|
180
241
|
const x = d3
|
|
181
242
|
.scaleLinear()
|
|
182
|
-
.domain(
|
|
183
|
-
.
|
|
184
|
-
.
|
|
185
|
-
const boxHeight = Math.min(plotH * 0.6,
|
|
186
|
-
const
|
|
187
|
-
//
|
|
188
|
-
const
|
|
189
|
-
const lowerFence = this.data[this.q1Key] - 1.5 * iqr;
|
|
190
|
-
const upperFence = this.data[this.q3Key] + 1.5 * iqr;
|
|
191
|
-
const actualMin = Math.max(this.data[this.minKey], lowerFence);
|
|
192
|
-
const actualMax = Math.min(this.data[this.maxKey], upperFence);
|
|
193
|
-
// 박스 (가로)
|
|
243
|
+
.domain(this.computeDomain())
|
|
244
|
+
.range([0, plotW])
|
|
245
|
+
.clamp(true);
|
|
246
|
+
const boxHeight = Math.min(plotH * 0.6, 80);
|
|
247
|
+
const centerY = plotH / 2;
|
|
248
|
+
// 박스 (Q1 ~ Q3)
|
|
249
|
+
const boxWidth = x(this.data[this.q3Key]) - x(this.data[this.q1Key]);
|
|
194
250
|
g.append('rect')
|
|
195
|
-
.attr('x', x(
|
|
196
|
-
.attr('y',
|
|
197
|
-
.attr('width',
|
|
251
|
+
.attr('x', x(this.data[this.q1Key]))
|
|
252
|
+
.attr('y', centerY - boxHeight / 2)
|
|
253
|
+
.attr('width', boxWidth)
|
|
198
254
|
.attr('height', boxHeight)
|
|
199
|
-
.attr('fill',
|
|
200
|
-
.attr('opacity', 0.
|
|
201
|
-
.attr('stroke', '#
|
|
202
|
-
.attr('stroke-width', 1)
|
|
203
|
-
|
|
255
|
+
.attr('fill', '#B3D4FC')
|
|
256
|
+
.attr('opacity', 0.8)
|
|
257
|
+
.attr('stroke', '#7BB3F0')
|
|
258
|
+
.attr('stroke-width', 1)
|
|
259
|
+
.style('cursor', 'pointer')
|
|
260
|
+
.on('mouseenter', (evt) => showTip(evt, [
|
|
261
|
+
`최대: ${Number(this.data[this.maxKey]).toFixed(1)}`,
|
|
262
|
+
`Q3: ${Number(this.data[this.q3Key]).toFixed(1)}`,
|
|
263
|
+
`중앙값: ${Number(this.data[this.medianKey]).toFixed(1)}`,
|
|
264
|
+
`Q1: ${Number(this.data[this.q1Key]).toFixed(1)}`,
|
|
265
|
+
`최소: ${Number(this.data[this.minKey]).toFixed(1)}`,
|
|
266
|
+
`평균: ${Number(this.data[this.meanKey]).toFixed(1)}`
|
|
267
|
+
]))
|
|
268
|
+
.on('mouseleave', () => hideTip());
|
|
269
|
+
// 중앙선 (Median)
|
|
204
270
|
g.append('line')
|
|
205
271
|
.attr('x1', x(this.data[this.medianKey]))
|
|
206
272
|
.attr('x2', x(this.data[this.medianKey]))
|
|
207
|
-
.attr('y1',
|
|
208
|
-
.attr('y2',
|
|
209
|
-
.attr('stroke', '#
|
|
210
|
-
.attr('stroke-width',
|
|
211
|
-
// 수염 (
|
|
212
|
-
|
|
273
|
+
.attr('y1', centerY - boxHeight / 2)
|
|
274
|
+
.attr('y2', centerY + boxHeight / 2)
|
|
275
|
+
.attr('stroke', '#7BB3F0')
|
|
276
|
+
.attr('stroke-width', 1.5);
|
|
277
|
+
// 왼쪽 수염 (Min ~ Q1)
|
|
278
|
+
g.append('line')
|
|
279
|
+
.attr('x1', x(this.data[this.minKey]))
|
|
280
|
+
.attr('x2', x(this.data[this.q1Key]))
|
|
281
|
+
.attr('y1', centerY)
|
|
282
|
+
.attr('y2', centerY)
|
|
283
|
+
.attr('stroke', '#7BB3F0')
|
|
284
|
+
.attr('stroke-width', 1);
|
|
285
|
+
// 오른쪽 수염 (Q3 ~ Max)
|
|
213
286
|
g.append('line')
|
|
214
|
-
.attr('x1', x(
|
|
215
|
-
.attr('x2', x(
|
|
287
|
+
.attr('x1', x(this.data[this.q3Key]))
|
|
288
|
+
.attr('x2', x(this.data[this.maxKey]))
|
|
216
289
|
.attr('y1', centerY)
|
|
217
290
|
.attr('y2', centerY)
|
|
218
|
-
.attr('stroke', '#
|
|
291
|
+
.attr('stroke', '#7BB3F0')
|
|
219
292
|
.attr('stroke-width', 1);
|
|
220
|
-
//
|
|
221
|
-
const capHeight = boxHeight
|
|
293
|
+
// Min 캡
|
|
294
|
+
const capHeight = boxHeight * 0.6;
|
|
222
295
|
g.append('line')
|
|
223
|
-
.attr('x1', x(
|
|
224
|
-
.attr('x2', x(
|
|
296
|
+
.attr('x1', x(this.data[this.minKey]))
|
|
297
|
+
.attr('x2', x(this.data[this.minKey]))
|
|
225
298
|
.attr('y1', centerY - capHeight / 2)
|
|
226
299
|
.attr('y2', centerY + capHeight / 2)
|
|
227
|
-
.attr('stroke', '#
|
|
300
|
+
.attr('stroke', '#7BB3F0')
|
|
228
301
|
.attr('stroke-width', 1);
|
|
302
|
+
// Max 캡
|
|
229
303
|
g.append('line')
|
|
230
|
-
.attr('x1', x(
|
|
231
|
-
.attr('x2', x(
|
|
304
|
+
.attr('x1', x(this.data[this.maxKey]))
|
|
305
|
+
.attr('x2', x(this.data[this.maxKey]))
|
|
232
306
|
.attr('y1', centerY - capHeight / 2)
|
|
233
307
|
.attr('y2', centerY + capHeight / 2)
|
|
234
|
-
.attr('stroke', '#
|
|
308
|
+
.attr('stroke', '#7BB3F0')
|
|
235
309
|
.attr('stroke-width', 1);
|
|
236
|
-
//
|
|
237
|
-
if (this.data[this.
|
|
310
|
+
// 평균값 (초록색)
|
|
311
|
+
if (this.data[this.meanKey] != null) {
|
|
238
312
|
g.append('circle')
|
|
239
|
-
.attr('cx', x(this.data[this.
|
|
313
|
+
.attr('cx', x(this.data[this.meanKey]))
|
|
240
314
|
.attr('cy', centerY)
|
|
241
|
-
.attr('r',
|
|
242
|
-
.attr('fill', '#
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
.
|
|
248
|
-
.attr('r', 4.5)
|
|
249
|
-
.attr('fill', '#ff4444');
|
|
315
|
+
.attr('r', 3)
|
|
316
|
+
.attr('fill', '#4CAF50')
|
|
317
|
+
.attr('stroke', '#fff')
|
|
318
|
+
.attr('stroke-width', 1)
|
|
319
|
+
.style('cursor', 'pointer')
|
|
320
|
+
.on('mouseenter', (evt) => showTip(evt, [`평균: ${Number(this.data[this.meanKey]).toFixed(1)}`]))
|
|
321
|
+
.on('mouseleave', () => hideTip());
|
|
250
322
|
}
|
|
251
|
-
// 현재값 (
|
|
323
|
+
// 현재값 (오렌지색)
|
|
252
324
|
if (this.data[this.valueKey] != null) {
|
|
325
|
+
const currentValue = this.data[this.valueKey];
|
|
326
|
+
const isOutlier = currentValue < this.data[this.minKey] || currentValue > this.data[this.maxKey];
|
|
253
327
|
g.append('circle')
|
|
254
|
-
.attr('cx', x(
|
|
328
|
+
.attr('cx', x(currentValue))
|
|
255
329
|
.attr('cy', centerY)
|
|
256
|
-
.attr('r',
|
|
257
|
-
.attr('fill', '#
|
|
330
|
+
.attr('r', 5)
|
|
331
|
+
.attr('fill', '#e53935')
|
|
332
|
+
.attr('stroke', '#fff')
|
|
333
|
+
.attr('stroke-width', 1)
|
|
334
|
+
.style('cursor', 'pointer')
|
|
335
|
+
.on('mouseenter', (evt) => showTip(evt, [
|
|
336
|
+
`현재 프로젝트: ${Number(currentValue).toFixed(1)}`,
|
|
337
|
+
isOutlier ? '⚠ 이상치' : '정상 범위'
|
|
338
|
+
]))
|
|
339
|
+
.on('mouseleave', () => hideTip());
|
|
258
340
|
}
|
|
259
341
|
}
|
|
260
342
|
};
|
|
@@ -263,11 +345,17 @@ KpiSingleBoxplotChart.styles = css `
|
|
|
263
345
|
display: block;
|
|
264
346
|
width: 100%;
|
|
265
347
|
height: 100%;
|
|
348
|
+
/* flex/grid item 의 intrinsic min-content 가 부모를 밀어올리는 것 방지 */
|
|
349
|
+
min-width: 0;
|
|
350
|
+
min-height: 0;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
/* 절대 늘어나지 않도록 contain — layout/size 격리 */
|
|
353
|
+
contain: strict;
|
|
266
354
|
}
|
|
267
355
|
svg {
|
|
356
|
+
display: block;
|
|
268
357
|
width: 100%;
|
|
269
358
|
height: 100%;
|
|
270
|
-
display: block;
|
|
271
359
|
}
|
|
272
360
|
`;
|
|
273
361
|
__decorate([
|
|
@@ -310,6 +398,18 @@ __decorate([
|
|
|
310
398
|
property({ type: Boolean }),
|
|
311
399
|
__metadata("design:type", Boolean)
|
|
312
400
|
], KpiSingleBoxplotChart.prototype, "vertical", void 0);
|
|
401
|
+
__decorate([
|
|
402
|
+
property({ type: Boolean }),
|
|
403
|
+
__metadata("design:type", Boolean)
|
|
404
|
+
], KpiSingleBoxplotChart.prototype, "fitToData", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
property({ type: Number }),
|
|
407
|
+
__metadata("design:type", Number)
|
|
408
|
+
], KpiSingleBoxplotChart.prototype, "domainMin", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
property({ type: Number }),
|
|
411
|
+
__metadata("design:type", Number)
|
|
412
|
+
], KpiSingleBoxplotChart.prototype, "domainMax", void 0);
|
|
313
413
|
KpiSingleBoxplotChart = __decorate([
|
|
314
414
|
customElement('kpi-single-boxplot-chart')
|
|
315
415
|
], KpiSingleBoxplotChart);
|