260707_01_ENH: Chart 추가

This commit is contained in:
2026-07-07 14:59:36 +09:00
parent d09d899e06
commit 9af9286724
16 changed files with 941 additions and 23 deletions

139
README.md
View File

@@ -1,6 +1,6 @@
# KRI UI Registry
사내 shadcn UI Registry 소스 프로젝트입니다. `dist/r`의 정적 JSON을 IIS 또는 Nginx에 배포합니다.
KRI 공통 shadcn UI Registry 프로젝트입니다. `npm run build`로 생성되는 `dist/r` 정적 JSON 파일을 IIS 또는 Nginx에 배포해서 사용합니다.
## 빌드 및 검증
@@ -11,13 +11,13 @@ npm run verify
npm run preview
```
배포된 Registry 주소:
배포 Registry 주소:
```text
https://ui-registry.kric.com/r/registry.json
```
로컬 프리뷰 주소 (`npm run preview` 실행 시):
로컬 preview 주소 (`npm run preview` 실행 후):
```text
http://localhost:4100/r/registry.json
@@ -26,6 +26,7 @@ http://localhost:4100/r/registry.json
## Registry 항목
```text
kri-chart
kri-select
kri-date-range-picker
kri-date-picker
@@ -40,9 +41,11 @@ kri-layout
kri-dialog
```
전체 설치 예시:
개별 설치 예시:
```powershell
npx shadcn@latest add https://ui-registry.kric.com/r/kri-chart.json
npx shadcn@latest add https://ui-registry.kric.com/r/kri-select.json
npx shadcn@latest add https://ui-registry.kric.com/r/kri-password.json
npx shadcn@latest add https://ui-registry.kric.com/r/kri-date-range-picker.json
npx shadcn@latest add https://ui-registry.kric.com/r/kri-date-picker.json
@@ -56,9 +59,133 @@ npx shadcn@latest add https://ui-registry.kric.com/r/kri-layout.json
npx shadcn@latest add https://ui-registry.kric.com/r/kri-dialog.json
```
## KRI Chart
`kri-chart`는 `echarts`, `echarts-for-react` 기반 공통 차트 컴포넌트입니다. 내부적으로 `BaseEChart`를 사용하며, 모든 wrapper는 멀티 시리즈를 지원합니다.
제공 컴포넌트:
```ts
BaseEChart
KriLineChart
KriBarChart
KriStackedBarChart
KriPieChart
KriRadarChart
KriScatterChart
```
### Line
```tsx
import { KriLineChart } from '@/components/chart'
<KriLineChart
categories={['1월', '2월', '3월']}
series={[
{ name: '매출', data: [120, 180, 160] },
{ name: '영업이익', data: [30, 42, 38] },
]}
smooth
/>
```
### Bar / Horizontal Bar
```tsx
import { KriBarChart } from '@/components/chart'
<KriBarChart
categories={['A', 'B', 'C']}
series={[
{ name: '2025', data: [10, 20, 30] },
{ name: '2026', data: [15, 18, 35] },
]}
isHorizontal
/>
```
### Stacked Bar
```tsx
import { KriStackedBarChart } from '@/components/chart'
<KriStackedBarChart
categories={['A', 'B', 'C']}
series={[
{ name: '직접', data: [10, 20, 30] },
{ name: '간접', data: [5, 12, 18] },
]}
/>
```
### Pie
```tsx
import { KriPieChart } from '@/components/chart'
<KriPieChart
series={[
{
name: '접속 경로',
data: [
{ name: '검색', value: 45 },
{ name: '광고', value: 25 },
{ name: '직접', value: 30 },
],
},
]}
/>
```
### Radar
```tsx
import { KriRadarChart } from '@/components/chart'
<KriRadarChart
indicators={[
{ name: '품질', max: 100 },
{ name: '속도', max: 100 },
{ name: '안정성', max: 100 },
]}
series={[
{ name: '서비스 A', data: [90, 80, 85] },
{ name: '서비스 B', data: [70, 95, 78] },
]}
/>
```
### Scatter
```tsx
import { KriScatterChart } from '@/components/chart'
<KriScatterChart
series={[
{
name: '분포',
data: [
[10, 20],
[15, 35],
[25, 30],
],
},
]}
/>
```
공통 props:
- `height`: 차트 wrapper 높이, 기본값 `CHART_HEIGHTS.DEFAULT`
- `className`, `contentClassName`, `chartClassName`: wrapper className
- `notMerge`, `lazyUpdate`, `onEvents`: `echarts-for-react` 전달 옵션
- `option`: wrapper가 생성한 ECharts option을 덮어쓰는 override 옵션
- `normalizeValues`, `decimalPlaces`: 숫자 데이터 반올림 정규화 옵션
## KriDialog Footer 규칙
기본값은 `닫기` 버튼이 있는 Footer입니다.
기본값은 닫기 버튼이 있는 Footer입니다.
```tsx
<KriDialog open={open} onOpenChange={setOpen} title="사용자 등록">
@@ -115,5 +242,5 @@ npx shadcn@latest add https://ui-registry.kric.com/r/kri-dialog.json
- 편집 값은 HTML 문자열입니다.
- 이미지 업로드 함수는 URL 문자열 또는 `{ url }`을 반환할 수 있습니다.
- `toolbar={false}`로 툴바 전체를 감출 수 있습니다.
- `toolbar={false}`로 toolbar 전체를 숨길 수 있습니다.
- SMS/LMS 기본 제한은 각각 90/2,000바이트입니다.