stz-chart-maker 2.3.5 → 2.3.6
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/README.md +17 -0
- package/dist/index.d.ts +169 -16
- package/dist/index.js +3056 -2987
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,6 +115,23 @@ const chartConfig = ChartWrapper
|
|
|
115
115
|
downloadChartAsImage('sales-chart');
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
```tsx
|
|
119
|
+
import {
|
|
120
|
+
hideChartTooltip,
|
|
121
|
+
isChartDatasetVisible,
|
|
122
|
+
setChartDatasetVisibility,
|
|
123
|
+
showChartTooltip,
|
|
124
|
+
toggleChartDatasetVisibility,
|
|
125
|
+
} from 'stz-chart-maker';
|
|
126
|
+
|
|
127
|
+
setChartDatasetVisibility('sales-chart', 1, false);
|
|
128
|
+
const visible = toggleChartDatasetVisibility('sales-chart', 0);
|
|
129
|
+
console.log(isChartDatasetVisible('sales-chart', 0), visible);
|
|
130
|
+
|
|
131
|
+
showChartTooltip('sales-chart', [{ datasetIndex: 0, index: 2 }]);
|
|
132
|
+
hideChartTooltip('sales-chart');
|
|
133
|
+
```
|
|
134
|
+
|
|
118
135
|
### 변경기록
|
|
119
136
|
[CHANGELOG.md](./CHANGELOG.md) 파일을 참조하세요.
|
|
120
137
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3193,29 +3193,182 @@ interface ChartImageExportOptions {
|
|
|
3193
3193
|
scale?: number;
|
|
3194
3194
|
}
|
|
3195
3195
|
type ChartTarget = string | Chart$1;
|
|
3196
|
+
/**
|
|
3197
|
+
* 차트 ID 또는 Chart 인스턴스로 실제 Chart.js 인스턴스를 조회합니다.
|
|
3198
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3199
|
+
* @returns Chart.js 인스턴스
|
|
3200
|
+
* @since 2.3.5
|
|
3201
|
+
* @category util
|
|
3202
|
+
* @example
|
|
3203
|
+
* ```ts
|
|
3204
|
+
* const chart = getChartInstance('sales-chart');
|
|
3205
|
+
* chart.update();
|
|
3206
|
+
* ```
|
|
3207
|
+
*/
|
|
3196
3208
|
declare function getChartInstance(chart: Chart$1): Chart$1;
|
|
3197
3209
|
declare function getChartInstance(chartId: string): Chart$1;
|
|
3210
|
+
/**
|
|
3211
|
+
* 차트의 zoom 상태를 초기화합니다.
|
|
3212
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3213
|
+
* @since 2.3.5
|
|
3214
|
+
* @category util
|
|
3215
|
+
* @example
|
|
3216
|
+
* ```ts
|
|
3217
|
+
* resetChartZoom('sales-chart');
|
|
3218
|
+
* ```
|
|
3219
|
+
*/
|
|
3198
3220
|
declare function resetChartZoom(chart: Chart$1): void;
|
|
3199
3221
|
declare function resetChartZoom(chartId: string): void;
|
|
3222
|
+
/**
|
|
3223
|
+
* 차트를 수동으로 다시 렌더링합니다.
|
|
3224
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3225
|
+
* @param mode Chart.js update mode
|
|
3226
|
+
* @since 2.3.5
|
|
3227
|
+
* @category util
|
|
3228
|
+
* @example
|
|
3229
|
+
* ```ts
|
|
3230
|
+
* updateChart('sales-chart', 'none');
|
|
3231
|
+
* ```
|
|
3232
|
+
*/
|
|
3200
3233
|
declare function updateChart(chart: Chart$1, mode?: Parameters<Chart$1['update']>[0]): void;
|
|
3201
3234
|
declare function updateChart(chartId: string, mode?: Parameters<Chart$1['update']>[0]): void;
|
|
3235
|
+
/**
|
|
3236
|
+
* 차트 크기를 다시 계산합니다.
|
|
3237
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3238
|
+
* @since 2.3.5
|
|
3239
|
+
* @category util
|
|
3240
|
+
* @example
|
|
3241
|
+
* ```ts
|
|
3242
|
+
* resizeChart('sales-chart');
|
|
3243
|
+
* ```
|
|
3244
|
+
*/
|
|
3202
3245
|
declare function resizeChart(chart: Chart$1): void;
|
|
3203
3246
|
declare function resizeChart(chartId: string): void;
|
|
3247
|
+
/**
|
|
3248
|
+
* 차트의 active element를 강제로 설정합니다.
|
|
3249
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3250
|
+
* @param activeElements 활성화할 요소 목록
|
|
3251
|
+
* @since 2.3.5
|
|
3252
|
+
* @category util
|
|
3253
|
+
* @example
|
|
3254
|
+
* ```ts
|
|
3255
|
+
* setChartActiveElements('sales-chart', [{ datasetIndex: 0, index: 2 }]);
|
|
3256
|
+
* ```
|
|
3257
|
+
*/
|
|
3204
3258
|
declare function setChartActiveElements(chart: Chart$1, activeElements: ActiveElement[]): void;
|
|
3205
3259
|
declare function setChartActiveElements(chartId: string, activeElements: ActiveElement[]): void;
|
|
3260
|
+
/**
|
|
3261
|
+
* 차트의 active element를 모두 해제합니다.
|
|
3262
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3263
|
+
* @since 2.3.5
|
|
3264
|
+
* @category util
|
|
3265
|
+
* @example
|
|
3266
|
+
* ```ts
|
|
3267
|
+
* clearChartActiveElements('sales-chart');
|
|
3268
|
+
* ```
|
|
3269
|
+
*/
|
|
3270
|
+
declare function clearChartActiveElements(chart: Chart$1): void;
|
|
3271
|
+
declare function clearChartActiveElements(chartId: string): void;
|
|
3272
|
+
/**
|
|
3273
|
+
* 특정 dataset의 표시 여부를 강제로 설정합니다.
|
|
3274
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3275
|
+
* @param datasetIndex dataset index
|
|
3276
|
+
* @param visible 표시 여부
|
|
3277
|
+
* @since 2.3.5
|
|
3278
|
+
* @category util
|
|
3279
|
+
* @example
|
|
3280
|
+
* ```ts
|
|
3281
|
+
* setChartDatasetVisibility('sales-chart', 1, false);
|
|
3282
|
+
* ```
|
|
3283
|
+
*/
|
|
3284
|
+
declare function setChartDatasetVisibility(chart: Chart$1, datasetIndex: number, visible: boolean): void;
|
|
3285
|
+
declare function setChartDatasetVisibility(chartId: string, datasetIndex: number, visible: boolean): void;
|
|
3286
|
+
/**
|
|
3287
|
+
* 특정 dataset의 표시 여부를 토글합니다.
|
|
3288
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3289
|
+
* @param datasetIndex dataset index
|
|
3290
|
+
* @returns 토글 후 표시 여부
|
|
3291
|
+
* @since 2.3.5
|
|
3292
|
+
* @category util
|
|
3293
|
+
* @example
|
|
3294
|
+
* ```ts
|
|
3295
|
+
* const visible = toggleChartDatasetVisibility('sales-chart', 1);
|
|
3296
|
+
* ```
|
|
3297
|
+
*/
|
|
3298
|
+
declare function toggleChartDatasetVisibility(chart: Chart$1, datasetIndex: number): boolean;
|
|
3299
|
+
declare function toggleChartDatasetVisibility(chartId: string, datasetIndex: number): boolean;
|
|
3300
|
+
/**
|
|
3301
|
+
* 특정 dataset의 현재 표시 여부를 반환합니다.
|
|
3302
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3303
|
+
* @param datasetIndex dataset index
|
|
3304
|
+
* @returns 표시 여부
|
|
3305
|
+
* @since 2.3.5
|
|
3306
|
+
* @category util
|
|
3307
|
+
* @example
|
|
3308
|
+
* ```ts
|
|
3309
|
+
* const visible = isChartDatasetVisible('sales-chart', 1);
|
|
3310
|
+
* ```
|
|
3311
|
+
*/
|
|
3312
|
+
declare function isChartDatasetVisible(chart: Chart$1, datasetIndex: number): boolean;
|
|
3313
|
+
declare function isChartDatasetVisible(chartId: string, datasetIndex: number): boolean;
|
|
3314
|
+
/**
|
|
3315
|
+
* 차트 tooltip과 active element를 함께 표시합니다.
|
|
3316
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3317
|
+
* @param activeElements 활성화할 요소 목록
|
|
3318
|
+
* @param position tooltip 위치. 생략 시 활성 요소 위치를 사용합니다.
|
|
3319
|
+
* @since 2.3.5
|
|
3320
|
+
* @category util
|
|
3321
|
+
* @example
|
|
3322
|
+
* ```ts
|
|
3323
|
+
* showChartTooltip('sales-chart', [{ datasetIndex: 0, index: 2 }]);
|
|
3324
|
+
* ```
|
|
3325
|
+
*/
|
|
3326
|
+
declare function showChartTooltip(chart: Chart$1, activeElements: ActiveElement[], position?: {
|
|
3327
|
+
x: number;
|
|
3328
|
+
y: number;
|
|
3329
|
+
}): void;
|
|
3330
|
+
declare function showChartTooltip(chartId: string, activeElements: ActiveElement[], position?: {
|
|
3331
|
+
x: number;
|
|
3332
|
+
y: number;
|
|
3333
|
+
}): void;
|
|
3334
|
+
/**
|
|
3335
|
+
* 차트 tooltip을 숨기고 active element를 해제합니다.
|
|
3336
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3337
|
+
* @since 2.3.5
|
|
3338
|
+
* @category util
|
|
3339
|
+
* @example
|
|
3340
|
+
* ```ts
|
|
3341
|
+
* hideChartTooltip('sales-chart');
|
|
3342
|
+
* ```
|
|
3343
|
+
*/
|
|
3344
|
+
declare function hideChartTooltip(chart: Chart$1): void;
|
|
3345
|
+
declare function hideChartTooltip(chartId: string): void;
|
|
3346
|
+
/**
|
|
3347
|
+
* 특정 dataset의 메타 정보를 반환합니다.
|
|
3348
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3349
|
+
* @param datasetIndex dataset index
|
|
3350
|
+
* @returns dataset meta
|
|
3351
|
+
* @since 2.3.5
|
|
3352
|
+
* @category util
|
|
3353
|
+
* @example
|
|
3354
|
+
* ```ts
|
|
3355
|
+
* const meta = getChartDatasetMeta('sales-chart', 0);
|
|
3356
|
+
* console.log(meta.data);
|
|
3357
|
+
* ```
|
|
3358
|
+
*/
|
|
3206
3359
|
declare function getChartDatasetMeta(chart: Chart$1, datasetIndex: number): ReturnType<Chart$1['getDatasetMeta']>;
|
|
3207
3360
|
declare function getChartDatasetMeta(chartId: string, datasetIndex: number): ReturnType<Chart$1['getDatasetMeta']>;
|
|
3208
3361
|
/**
|
|
3209
|
-
*
|
|
3210
|
-
* @param
|
|
3362
|
+
* 차트를 이미지로 다운로드합니다.
|
|
3363
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3211
3364
|
* @param options 이미지 내보내기 옵션
|
|
3212
3365
|
* @since 1.5.0
|
|
3213
3366
|
* @category util
|
|
3214
3367
|
*/
|
|
3215
|
-
declare function downloadChartAsImage(
|
|
3216
|
-
declare function downloadChartAsImage(
|
|
3368
|
+
declare function downloadChartAsImage(target: Chart$1, options?: ChartImageExportOptions): void;
|
|
3369
|
+
declare function downloadChartAsImage(target: string, options?: ChartImageExportOptions): void;
|
|
3217
3370
|
/**
|
|
3218
|
-
*
|
|
3371
|
+
* Chart 인스턴스를 이미지로 다운로드합니다.
|
|
3219
3372
|
* @param chart Chart 인스턴스
|
|
3220
3373
|
* @param options 이미지 내보내기 옵션
|
|
3221
3374
|
* @since 1.5.0
|
|
@@ -3223,17 +3376,17 @@ declare function downloadChartAsImage(chartId: string, options?: ChartImageExpor
|
|
|
3223
3376
|
*/
|
|
3224
3377
|
declare function downloadChartAsImageByInstance(chart: Chart$1, options?: ChartImageExportOptions): void;
|
|
3225
3378
|
/**
|
|
3226
|
-
*
|
|
3227
|
-
* @param
|
|
3379
|
+
* 차트를 Base64 문자열로 반환합니다.
|
|
3380
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3228
3381
|
* @param options 이미지 내보내기 옵션
|
|
3229
3382
|
* @returns Base64 인코딩된 이미지 데이터 URL
|
|
3230
3383
|
* @since 1.5.0
|
|
3231
3384
|
* @category util
|
|
3232
3385
|
*/
|
|
3233
|
-
declare function getChartAsBase64(
|
|
3234
|
-
declare function getChartAsBase64(
|
|
3386
|
+
declare function getChartAsBase64(target: Chart$1, options?: Omit<ChartImageExportOptions, 'filename'>): string;
|
|
3387
|
+
declare function getChartAsBase64(target: string, options?: Omit<ChartImageExportOptions, 'filename'>): string;
|
|
3235
3388
|
/**
|
|
3236
|
-
*
|
|
3389
|
+
* Chart 인스턴스를 Base64 문자열로 반환합니다.
|
|
3237
3390
|
* @param chart Chart 인스턴스
|
|
3238
3391
|
* @param options 이미지 내보내기 옵션
|
|
3239
3392
|
* @returns Base64 인코딩된 이미지 데이터 URL
|
|
@@ -3242,17 +3395,17 @@ declare function getChartAsBase64(chartId: string, options?: Omit<ChartImageExpo
|
|
|
3242
3395
|
*/
|
|
3243
3396
|
declare function getChartAsBase64ByInstance(chart: Chart$1, options?: Omit<ChartImageExportOptions, 'filename'>): string;
|
|
3244
3397
|
/**
|
|
3245
|
-
*
|
|
3246
|
-
* @param
|
|
3398
|
+
* 차트를 Blob 객체로 반환합니다.
|
|
3399
|
+
* @param target 차트 ID 또는 Chart 인스턴스
|
|
3247
3400
|
* @param options 이미지 내보내기 옵션
|
|
3248
3401
|
* @returns Promise<Blob> 이미지 Blob
|
|
3249
3402
|
* @since 1.5.0
|
|
3250
3403
|
* @category util
|
|
3251
3404
|
*/
|
|
3252
|
-
declare function getChartAsBlob(
|
|
3253
|
-
declare function getChartAsBlob(
|
|
3405
|
+
declare function getChartAsBlob(target: Chart$1, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
|
|
3406
|
+
declare function getChartAsBlob(target: string, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
|
|
3254
3407
|
/**
|
|
3255
|
-
*
|
|
3408
|
+
* Chart 인스턴스를 Blob 객체로 반환합니다.
|
|
3256
3409
|
* @param chart Chart 인스턴스
|
|
3257
3410
|
* @param options 이미지 내보내기 옵션
|
|
3258
3411
|
* @returns Promise<Blob> 이미지 Blob
|
|
@@ -3294,5 +3447,5 @@ declare const T$: {
|
|
|
3294
3447
|
};
|
|
3295
3448
|
};
|
|
3296
3449
|
|
|
3297
|
-
export { ArcChart, ArcChart as ArcChartWrapper, BarChart, BarChart as BarChartWrapper, BubbleChart, BubbleChart as BubbleChartWrapper, CartesianChart, CartesianChart as CartesianChartWrapper, Chart, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, Chart as ChartWrapper, CreateZoomRangeSlider, DefaultArcRadius, DefaultDataLabelsOptions, DefaultHiddenLegendTopOptions, DefaultHiddenSparkScales, DefaultResponsiveChartOptions, DefaultSparkPluginOptions, DefaultTimeScaleOptions, DefaultTopLegendOptions, DefaultZoomOptions, DoughnutChart, DoughnutChart as DoughnutChartWrapper, LineChart, LineChart as LineChartWrapper, PieChart, PieChart as PieChartWrapper, T$, TreemapChart, TreemapChart as TreemapChartWrapper, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, createAssignedTasksPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultCartesianScales, createDefaultDoughnutOptions, createDefaultLineOptions, createDefaultPieOptions, createDefaultTreemapOptions, createStatusPlugin, createTodayLinePlugin, createWeekendPlugin, customDatasetPlugins, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultDoughnutTooltipCallback, defaultLineScales, defaultLineTooltipCallback, defaultPieTooltipCallback, defaultTreemapTooltipCallback, doughnutCenterTextPlugin, downloadChartAsImage, downloadChartAsImageByInstance, getChartAsBase64, getChartAsBase64ByInstance, getChartAsBlob, getChartAsBlobByInstance, getChartDatasetMeta, getChartInstance, loadingPlugin, makeCenterHtml, noDataPlugin, resetChartZoom, resizeChart, segmentImagePlugin, setChartActiveElements, setChartConfig, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, updateChart, zoomRangeSlider, zoomResetPlugin };
|
|
3450
|
+
export { ArcChart, ArcChart as ArcChartWrapper, BarChart, BarChart as BarChartWrapper, BubbleChart, BubbleChart as BubbleChartWrapper, CartesianChart, CartesianChart as CartesianChartWrapper, Chart, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, Chart as ChartWrapper, CreateZoomRangeSlider, DefaultArcRadius, DefaultDataLabelsOptions, DefaultHiddenLegendTopOptions, DefaultHiddenSparkScales, DefaultResponsiveChartOptions, DefaultSparkPluginOptions, DefaultTimeScaleOptions, DefaultTopLegendOptions, DefaultZoomOptions, DoughnutChart, DoughnutChart as DoughnutChartWrapper, LineChart, LineChart as LineChartWrapper, PieChart, PieChart as PieChartWrapper, T$, TreemapChart, TreemapChart as TreemapChartWrapper, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, clearChartActiveElements, createAssignedTasksPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultCartesianScales, createDefaultDoughnutOptions, createDefaultLineOptions, createDefaultPieOptions, createDefaultTreemapOptions, createStatusPlugin, createTodayLinePlugin, createWeekendPlugin, customDatasetPlugins, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultDoughnutTooltipCallback, defaultLineScales, defaultLineTooltipCallback, defaultPieTooltipCallback, defaultTreemapTooltipCallback, doughnutCenterTextPlugin, downloadChartAsImage, downloadChartAsImageByInstance, getChartAsBase64, getChartAsBase64ByInstance, getChartAsBlob, getChartAsBlobByInstance, getChartDatasetMeta, getChartInstance, hideChartTooltip, isChartDatasetVisible, loadingPlugin, makeCenterHtml, noDataPlugin, resetChartZoom, resizeChart, segmentImagePlugin, setChartActiveElements, setChartConfig, setChartDatasetVisibility, showChartTooltip, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, toggleChartDatasetVisibility, updateChart, zoomRangeSlider, zoomResetPlugin };
|
|
3298
3451
|
export type { Align, AllChartTypes, ArcChartBuilder, ArcChartType, ArcDataset, AxisColors, BarChartBuilder, BubbleChartBuilder, CartesianChartBuilder, CartesianChartType, CartesianDataset, ChartBuilder, ChartImageExportOptions, ChartTarget, ChartWithFocus, Color, CommonAxes, CommonAxesSacels, CommonCartesian, CommonCartesianAxes, CommonCartesianLegendConfig, CommonCartesianTicks, CommonCartesianTitleConfig, CommonTicks, Constructor, CustomArcChartOptions, CustomBarChartOptions, CustomBubbleChartOptions, CustomCartesianDataset, CustomChartDatasets, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomTreemapChartOptions, CustomTreemapDataset, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HierarchicalChartType, HtmlLegendOptions, LineChartBuilder, Mode, OriginalColors, Override, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SegmentImageConfig, SettingOptions, StzConfig, TimeScaleConfig, TimeScaleType, TimeUnit, TreemapChartBuilder, UidImageMapping, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
|