@opsnow-mcp/opsnow-mcp-common-ui-server 1.0.22 → 1.0.23
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.
|
@@ -514,6 +514,61 @@ export const PieChartExamples = [
|
|
|
514
514
|
chartCustomCategory={chartCustomCategory}
|
|
515
515
|
/>`
|
|
516
516
|
},
|
|
517
|
+
{
|
|
518
|
+
title: '파이 차트 - 다운로드',
|
|
519
|
+
description: 'ref를 사용하여 파이 차트를 다양한 형식으로 다운로드하는 예제입니다. 다운로드 시에는 chartRef가 아닌 React ref를 사용해야 합니다. downloadFile(fileName, fileType, fileOption?)을 호출합니다.',
|
|
520
|
+
code_props_usage: `
|
|
521
|
+
const chartId = 'pie-chart-download-${generateUniqueGeneralId()}'
|
|
522
|
+
const chartRef = useRef(null)
|
|
523
|
+
const [chartProps] = useState({
|
|
524
|
+
series: {
|
|
525
|
+
categoryField: 'service',
|
|
526
|
+
valueField: 'cost',
|
|
527
|
+
tooltip: {
|
|
528
|
+
type: 'CI',
|
|
529
|
+
body: {
|
|
530
|
+
name: '{category}',
|
|
531
|
+
value: '\${value.formatNumber("0,0.00")}',
|
|
532
|
+
useMarker: true
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
legend: {}
|
|
537
|
+
})
|
|
538
|
+
const [chartData] = useState([
|
|
539
|
+
{ service: 'EC2', cost: 15600 },
|
|
540
|
+
{ service: 'RDS', cost: 8200 },
|
|
541
|
+
{ service: 'S3', cost: 4300 },
|
|
542
|
+
{ service: 'Lambda', cost: 2100 },
|
|
543
|
+
{ service: 'CloudFront', cost: 1800 }
|
|
544
|
+
])
|
|
545
|
+
const [chartCategory] = useState(['EC2', 'RDS', 'S3', 'Lambda', 'CloudFront'])
|
|
546
|
+
|
|
547
|
+
// 다운로드 핸들러
|
|
548
|
+
const handleDownload = () => {
|
|
549
|
+
chartRef.current.downloadFile('파일명', 'xlsx')
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// 커스텀 데이터 소스로 다운로드
|
|
553
|
+
const handleCustomDownload = () => {
|
|
554
|
+
chartRef.current.downloadFile('파일명', 'xlsx', {
|
|
555
|
+
dataSource: [
|
|
556
|
+
{ Category: 'Custom Row 1', Value: 100 },
|
|
557
|
+
{ Category: 'Custom Row 2', Value: 200 }
|
|
558
|
+
]
|
|
559
|
+
})
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// 지원 형식: xlsx, csv, png, jpg, pdf, json, html, canvas, pdfdata, print
|
|
563
|
+
`,
|
|
564
|
+
code: `<OpsnowCommonPieChart
|
|
565
|
+
ref={chartRef}
|
|
566
|
+
chartId={chartId}
|
|
567
|
+
chartProps={chartProps}
|
|
568
|
+
chartCategory={chartCategory}
|
|
569
|
+
chartData={chartData}
|
|
570
|
+
/>`
|
|
571
|
+
},
|
|
517
572
|
];
|
|
518
573
|
export const BarChartExamples = [
|
|
519
574
|
{
|
|
@@ -1275,6 +1330,97 @@ export const BarChartExamples = [
|
|
|
1275
1330
|
chartCategory={chartCategory}
|
|
1276
1331
|
/>`
|
|
1277
1332
|
},
|
|
1333
|
+
{
|
|
1334
|
+
title: '바 차트 - 다운로드 (기본)',
|
|
1335
|
+
description: 'ref를 사용하여 바 차트를 다양한 형식으로 다운로드하는 예제입니다. 다운로드 시에는 chartRef가 아닌 React ref를 사용해야 합니다. downloadFile(fileName, fileType, fileOption?)을 호출합니다.',
|
|
1336
|
+
code_props_usage: `
|
|
1337
|
+
const chartId = 'bar-chart-download-${generateUniqueGeneralId()}'
|
|
1338
|
+
const chartRef = useRef(null)
|
|
1339
|
+
const [chartProps] = useState({
|
|
1340
|
+
xAxis: { type: 'category', valueField: 'month' },
|
|
1341
|
+
yAxis: { type: 'value' },
|
|
1342
|
+
series: {
|
|
1343
|
+
valueXField: 'month',
|
|
1344
|
+
columns: { width: 'p60' },
|
|
1345
|
+
tooltip: {
|
|
1346
|
+
type: 'CG',
|
|
1347
|
+
body: {
|
|
1348
|
+
name: '{name}',
|
|
1349
|
+
value: '\${valueY.formatNumber("0,0.00")}',
|
|
1350
|
+
useMarker: true
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
},
|
|
1354
|
+
legend: {}
|
|
1355
|
+
})
|
|
1356
|
+
const [chartData] = useState([
|
|
1357
|
+
{ month: 'Jan', AWS: 12500, Azure: 8300 },
|
|
1358
|
+
{ month: 'Feb', AWS: 13100, Azure: 8700 }
|
|
1359
|
+
])
|
|
1360
|
+
const [chartCategory] = useState(['AWS', 'Azure'])
|
|
1361
|
+
|
|
1362
|
+
// 다운로드 핸들러
|
|
1363
|
+
const handleDownload = () => {
|
|
1364
|
+
chartRef.current.downloadFile('파일명', 'xlsx')
|
|
1365
|
+
}
|
|
1366
|
+
`,
|
|
1367
|
+
code: `<OpsnowCommonBarChart
|
|
1368
|
+
ref={chartRef}
|
|
1369
|
+
chartId={chartId}
|
|
1370
|
+
chartProps={chartProps}
|
|
1371
|
+
chartCategory={chartCategory}
|
|
1372
|
+
chartData={chartData}
|
|
1373
|
+
/>`
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
title: '바 차트 - 다운로드 (커스텀 데이터 소스)',
|
|
1377
|
+
description: '커스텀 데이터 소스를 지정하여 차트 데이터를 다운로드하는 예제입니다. downloadFile의 세 번째 인자로 dataSource를 전달하면 차트 데이터 대신 지정한 데이터로 다운로드됩니다.',
|
|
1378
|
+
code_props_usage: `
|
|
1379
|
+
const chartId = 'bar-chart-custom-download-${generateUniqueGeneralId()}'
|
|
1380
|
+
const chartRef = useRef(null)
|
|
1381
|
+
const [chartProps] = useState({
|
|
1382
|
+
xAxis: { type: 'category', valueField: 'month' },
|
|
1383
|
+
yAxis: { type: 'value' },
|
|
1384
|
+
series: {
|
|
1385
|
+
valueXField: 'month',
|
|
1386
|
+
columns: { width: 'p60' },
|
|
1387
|
+
tooltip: {
|
|
1388
|
+
type: 'CG',
|
|
1389
|
+
body: {
|
|
1390
|
+
name: '{name}',
|
|
1391
|
+
value: '\${valueY.formatNumber("0,0.00")}',
|
|
1392
|
+
useMarker: true
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
legend: {}
|
|
1397
|
+
})
|
|
1398
|
+
const [chartData] = useState([
|
|
1399
|
+
{ month: 'Jan', AWS: 12500, Azure: 8300 },
|
|
1400
|
+
{ month: 'Feb', AWS: 13100, Azure: 8700 }
|
|
1401
|
+
])
|
|
1402
|
+
const [chartCategory] = useState(['AWS', 'Azure'])
|
|
1403
|
+
|
|
1404
|
+
// 커스텀 데이터 소스로 다운로드
|
|
1405
|
+
const handleCustomDownload = () => {
|
|
1406
|
+
chartRef.current.downloadFile('파일명', 'xlsx', {
|
|
1407
|
+
dataSource: [
|
|
1408
|
+
{ Category: 'Custom Row 1', Value: 100 },
|
|
1409
|
+
{ Category: 'Custom Row 2', Value: 200 }
|
|
1410
|
+
]
|
|
1411
|
+
})
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
// 지원 형식: xlsx, csv, png, jpg, pdf, json, html, canvas, pdfdata, print
|
|
1415
|
+
`,
|
|
1416
|
+
code: `<OpsnowCommonBarChart
|
|
1417
|
+
ref={chartRef}
|
|
1418
|
+
chartId={chartId}
|
|
1419
|
+
chartProps={chartProps}
|
|
1420
|
+
chartCategory={chartCategory}
|
|
1421
|
+
chartData={chartData}
|
|
1422
|
+
/>`
|
|
1423
|
+
},
|
|
1278
1424
|
];
|
|
1279
1425
|
export const LineChartExamples = [
|
|
1280
1426
|
{
|
|
@@ -2239,6 +2385,59 @@ export const LineChartExamples = [
|
|
|
2239
2385
|
chartCategoryLocaleMapping={chartCategoryLocaleMapping}
|
|
2240
2386
|
/>`
|
|
2241
2387
|
},
|
|
2388
|
+
{
|
|
2389
|
+
title: '라인 차트 - 다운로드',
|
|
2390
|
+
description: 'ref를 사용하여 라인 차트를 다양한 형식으로 다운로드하는 예제입니다. 다운로드 시에는 chartRef가 아닌 React ref를 사용해야 합니다. downloadFile(fileName, fileType, fileOption?)을 호출합니다.',
|
|
2391
|
+
code_props_usage: `
|
|
2392
|
+
const chartId = 'line-chart-download-${generateUniqueGeneralId()}'
|
|
2393
|
+
const chartRef = useRef(null)
|
|
2394
|
+
const [chartProps] = useState({
|
|
2395
|
+
xAxis: { type: 'category', valueField: 'month' },
|
|
2396
|
+
yAxis: { type: 'value' },
|
|
2397
|
+
series: {
|
|
2398
|
+
valueXField: 'month',
|
|
2399
|
+
tooltip: {
|
|
2400
|
+
type: 'CG',
|
|
2401
|
+
body: {
|
|
2402
|
+
name: '{name}',
|
|
2403
|
+
value: '\${valueY.formatNumber("0,0.00")}',
|
|
2404
|
+
useMarker: true
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
},
|
|
2408
|
+
legend: {}
|
|
2409
|
+
})
|
|
2410
|
+
const [chartData] = useState([
|
|
2411
|
+
{ month: 'Jan', AWS: 12500, Azure: 8300 },
|
|
2412
|
+
{ month: 'Feb', AWS: 13100, Azure: 8700 }
|
|
2413
|
+
])
|
|
2414
|
+
const [chartCategory] = useState(['AWS', 'Azure'])
|
|
2415
|
+
|
|
2416
|
+
// 다운로드 핸들러
|
|
2417
|
+
const handleDownload = () => {
|
|
2418
|
+
chartRef.current.downloadFile('파일명', 'xlsx')
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
// 커스텀 데이터 소스로 다운로드
|
|
2422
|
+
const handleCustomDownload = () => {
|
|
2423
|
+
chartRef.current.downloadFile('파일명', 'xlsx', {
|
|
2424
|
+
dataSource: [
|
|
2425
|
+
{ Category: 'Custom Row 1', Value: 100 },
|
|
2426
|
+
{ Category: 'Custom Row 2', Value: 200 }
|
|
2427
|
+
]
|
|
2428
|
+
})
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
// 지원 형식: xlsx, csv, png, jpg, pdf, json, html, canvas, pdfdata, print
|
|
2432
|
+
`,
|
|
2433
|
+
code: `<OpsnowCommonLineChart
|
|
2434
|
+
ref={chartRef}
|
|
2435
|
+
chartId={chartId}
|
|
2436
|
+
chartProps={chartProps}
|
|
2437
|
+
chartCategory={chartCategory}
|
|
2438
|
+
chartData={chartData}
|
|
2439
|
+
/>`
|
|
2440
|
+
},
|
|
2242
2441
|
];
|
|
2243
2442
|
export const StackChartExamples = [
|
|
2244
2443
|
{
|
|
@@ -3618,6 +3817,60 @@ export const StackChartExamples = [
|
|
|
3618
3817
|
chartCustomCategory={chartCustomCategory}
|
|
3619
3818
|
/>`
|
|
3620
3819
|
},
|
|
3820
|
+
{
|
|
3821
|
+
title: '스택 차트 - 다운로드',
|
|
3822
|
+
description: 'ref를 사용하여 스택 차트를 다양한 형식으로 다운로드하는 예제입니다. 다운로드 시에는 chartRef가 아닌 React ref를 사용해야 합니다. downloadFile(fileName, fileType, fileOption?)을 호출합니다.',
|
|
3823
|
+
code_props_usage: `
|
|
3824
|
+
const chartId = 'stack-chart-download-${generateUniqueGeneralId()}'
|
|
3825
|
+
const chartRef = useRef(null)
|
|
3826
|
+
const [chartProps] = useState({
|
|
3827
|
+
xAxis: { type: 'category', valueField: 'month' },
|
|
3828
|
+
yAxis: { type: 'value' },
|
|
3829
|
+
series: {
|
|
3830
|
+
valueXField: 'month',
|
|
3831
|
+
columns: { width: 'p60' },
|
|
3832
|
+
tooltip: {
|
|
3833
|
+
type: 'CG',
|
|
3834
|
+
body: {
|
|
3835
|
+
name: '{name}',
|
|
3836
|
+
value: '\${valueY.formatNumber("0,0.00")}',
|
|
3837
|
+
useMarker: true
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
},
|
|
3841
|
+
legend: {}
|
|
3842
|
+
})
|
|
3843
|
+
const [chartData] = useState([
|
|
3844
|
+
{ month: 'Jan', AWS: 12500, Azure: 8300 },
|
|
3845
|
+
{ month: 'Feb', AWS: 13100, Azure: 8700 }
|
|
3846
|
+
])
|
|
3847
|
+
const [chartCategory] = useState(['AWS', 'Azure'])
|
|
3848
|
+
|
|
3849
|
+
// 다운로드 핸들러
|
|
3850
|
+
const handleDownload = () => {
|
|
3851
|
+
chartRef.current.downloadFile('파일명', 'xlsx')
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
// 커스텀 데이터 소스로 다운로드
|
|
3855
|
+
const handleCustomDownload = () => {
|
|
3856
|
+
chartRef.current.downloadFile('파일명', 'xlsx', {
|
|
3857
|
+
dataSource: [
|
|
3858
|
+
{ Category: 'Custom Row 1', Value: 100 },
|
|
3859
|
+
{ Category: 'Custom Row 2', Value: 200 }
|
|
3860
|
+
]
|
|
3861
|
+
})
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
// 지원 형식: xlsx, csv, png, jpg, pdf, json, html, canvas, pdfdata, print
|
|
3865
|
+
`,
|
|
3866
|
+
code: `<OpsnowCommonStackChart
|
|
3867
|
+
ref={chartRef}
|
|
3868
|
+
chartId={chartId}
|
|
3869
|
+
chartProps={chartProps}
|
|
3870
|
+
chartCategory={chartCategory}
|
|
3871
|
+
chartData={chartData}
|
|
3872
|
+
/>`
|
|
3873
|
+
},
|
|
3621
3874
|
];
|
|
3622
3875
|
export const XyMultiChartExamples = [
|
|
3623
3876
|
{
|
|
@@ -49,6 +49,16 @@ export const SelectExamples = [
|
|
|
49
49
|
title: 'filled, size=medium, disabled',
|
|
50
50
|
code: `<OpsnowCommonSelect items={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]} size="medium" variant="filled" disabled value={value} onChange={e => setValue(e.target.value)} />`,
|
|
51
51
|
description: 'filled variant, medium 사이즈, 비활성화 셀렉트 예제입니다.'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: 'outlined, size=small, label + placeholder (단일 선택)',
|
|
55
|
+
code: `<OpsnowCommonSelect items={[{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }]} size="small" variant="outlined" label="옵션 선택" placeholder="옵션을 선택하세요" value={value} onChange={e => setValue(e.target.value)} />`,
|
|
56
|
+
description: 'outlined variant, small 사이즈, label과 placeholder를 함께 사용하는 단일 선택 셀렉트 예제입니다.'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'outlined, size=small, label + placeholder, multiple (다중 선택)',
|
|
60
|
+
code: `<OpsnowCommonSelect items={[{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }]} size="small" variant="outlined" multiple label="항목" placeholder="항목을 선택하세요" value={value} onChange={e => setValue(e.target.value)} />`,
|
|
61
|
+
description: 'outlined variant, small 사이즈, label과 placeholder를 함께 사용하는 다중 선택 셀렉트 예제입니다.'
|
|
52
62
|
}
|
|
53
63
|
];
|
|
54
64
|
// Autocomplete(오토컴플리트) 컴포넌트 예제 데이터
|