stz-chart-maker 1.5.0 → 1.5.2
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/dist/index.d.ts +114 -17
- package/dist/index.js +2256 -2112
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ type Override<T, U> = Omit<T, keyof U> & U;
|
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
interface DatasetExtensions {
|
|
46
|
+
label?: string;
|
|
46
47
|
_aux?: any;
|
|
47
48
|
_uid?: string;
|
|
48
49
|
_group?: string | number;
|
|
@@ -253,6 +254,13 @@ type PartialDataLabels = Partial<DataLabels>;
|
|
|
253
254
|
* ═════════════════════════════════════════════════════════════
|
|
254
255
|
*/
|
|
255
256
|
|
|
257
|
+
interface SegmentImageConfig {
|
|
258
|
+
images: string[];
|
|
259
|
+
width?: number;
|
|
260
|
+
height?: number;
|
|
261
|
+
backgroundColor?: string;
|
|
262
|
+
borderRadius?: number;
|
|
263
|
+
}
|
|
256
264
|
interface SettingOptions {
|
|
257
265
|
img: string;
|
|
258
266
|
iconSize: {
|
|
@@ -548,9 +556,10 @@ type Types_PieChartBuilder = PieChartBuilder;
|
|
|
548
556
|
type Types_Position = Position;
|
|
549
557
|
type Types_RadarChartBuilder = RadarChartBuilder;
|
|
550
558
|
type Types_RadialChartType = RadialChartType;
|
|
559
|
+
type Types_SegmentImageConfig = SegmentImageConfig;
|
|
551
560
|
type Types_SettingOptions = SettingOptions;
|
|
552
561
|
declare namespace Types {
|
|
553
|
-
export type { Types_Align as Align, Types_ArcChartBuilder as ArcChartBuilder, Types_ArcChartType as ArcChartType, Types_ArcDataset as ArcDataset, Types_BarChartBuilder as BarChartBuilder, Types_BubbleChartBuilder as BubbleChartBuilder, Types_CartesianChartBuilder as CartesianChartBuilder, Types_CartesianChartType as CartesianChartType, Types_CartesianDataset as CartesianDataset, Types_ChartBuilder as ChartBuilder, Types_Color as Color, Types_CommonAxes as CommonAxes, Types_CommonAxesSacels as CommonAxesSacels, Types_CommonCartesian as CommonCartesian, Types_CommonCartesianAxes as CommonCartesianAxes, Types_CommonCartesianLegendConfig as CommonCartesianLegendConfig, Types_CommonCartesianTicks as CommonCartesianTicks, Types_CommonCartesianTitleConfig as CommonCartesianTitleConfig, Types_CommonTicks as CommonTicks, Types_Constructor as Constructor, Types_CustomArcChartOptions as CustomArcChartOptions, Types_CustomBarChartOptions as CustomBarChartOptions, Types_CustomBubbleChartOptions as CustomBubbleChartOptions, Types_CustomCartesianDataset as CustomCartesianDataset, Types_CustomChartDatasets as CustomChartDatasets, Types_CustomChartOptions as CustomChartOptions, Types_CustomDoughnutChartOptions as CustomDoughnutChartOptions, Types_CustomLineChartOptions as CustomLineChartOptions, Types_CustomOptionPlugins as CustomOptionPlugins, Types_CustomPieChartOptions as CustomPieChartOptions, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HtmlLegendOptions as HtmlLegendOptions, Types_LineChartBuilder as LineChartBuilder, Types_Mode as Mode, Types_Override as Override, Types_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_SettingOptions as SettingOptions };
|
|
562
|
+
export type { Types_Align as Align, Types_ArcChartBuilder as ArcChartBuilder, Types_ArcChartType as ArcChartType, Types_ArcDataset as ArcDataset, Types_BarChartBuilder as BarChartBuilder, Types_BubbleChartBuilder as BubbleChartBuilder, Types_CartesianChartBuilder as CartesianChartBuilder, Types_CartesianChartType as CartesianChartType, Types_CartesianDataset as CartesianDataset, Types_ChartBuilder as ChartBuilder, Types_Color as Color, Types_CommonAxes as CommonAxes, Types_CommonAxesSacels as CommonAxesSacels, Types_CommonCartesian as CommonCartesian, Types_CommonCartesianAxes as CommonCartesianAxes, Types_CommonCartesianLegendConfig as CommonCartesianLegendConfig, Types_CommonCartesianTicks as CommonCartesianTicks, Types_CommonCartesianTitleConfig as CommonCartesianTitleConfig, Types_CommonTicks as CommonTicks, Types_Constructor as Constructor, Types_CustomArcChartOptions as CustomArcChartOptions, Types_CustomBarChartOptions as CustomBarChartOptions, Types_CustomBubbleChartOptions as CustomBubbleChartOptions, Types_CustomCartesianDataset as CustomCartesianDataset, Types_CustomChartDatasets as CustomChartDatasets, Types_CustomChartOptions as CustomChartOptions, Types_CustomDoughnutChartOptions as CustomDoughnutChartOptions, Types_CustomLineChartOptions as CustomLineChartOptions, Types_CustomOptionPlugins as CustomOptionPlugins, Types_CustomPieChartOptions as CustomPieChartOptions, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HtmlLegendOptions as HtmlLegendOptions, Types_LineChartBuilder as LineChartBuilder, Types_Mode as Mode, Types_Override as Override, Types_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_SegmentImageConfig as SegmentImageConfig, Types_SettingOptions as SettingOptions };
|
|
554
563
|
}
|
|
555
564
|
|
|
556
565
|
interface ChartConfig {
|
|
@@ -1658,6 +1667,28 @@ declare abstract class ArcChartWrapper<TType extends ArcChartType> extends Chart
|
|
|
1658
1667
|
* @beta
|
|
1659
1668
|
*/
|
|
1660
1669
|
setAllBorderColor(borderColor: string | string[]): this;
|
|
1670
|
+
/**
|
|
1671
|
+
* @description 각 세그먼트에 이미지를 설정합니다.
|
|
1672
|
+
* @param images - 이미지 URL 배열 (URL, Base64, SVG, Emoji 등)
|
|
1673
|
+
* @param config - 이미지 설정 옵션
|
|
1674
|
+
* @returns {this}
|
|
1675
|
+
* @since 1.6.0
|
|
1676
|
+
* @category Dataset
|
|
1677
|
+
* @beta
|
|
1678
|
+
* @example
|
|
1679
|
+
* // URL 방식
|
|
1680
|
+
* chart.setSegmentImages([
|
|
1681
|
+
* 'https://example.com/icon1.png',
|
|
1682
|
+
* 'https://example.com/icon2.png'
|
|
1683
|
+
* ]);
|
|
1684
|
+
*
|
|
1685
|
+
* // 크기 조절
|
|
1686
|
+
* chart.setSegmentImages(
|
|
1687
|
+
* ['image1.png', 'image2.png'],
|
|
1688
|
+
* { width: 40, height: 40, backgroundColor: 'transparent' }
|
|
1689
|
+
* );
|
|
1690
|
+
*/
|
|
1691
|
+
setSegmentImages(images: string[], config?: Partial<Omit<SegmentImageConfig, 'images'>>): this;
|
|
1661
1692
|
}
|
|
1662
1693
|
|
|
1663
1694
|
declare class DoughnutChartWrapper extends ArcChartWrapper<'doughnut'> implements DoughnutChartBuilder {
|
|
@@ -1972,18 +2003,6 @@ declare const zoomResetPlugin: {
|
|
|
1972
2003
|
afterDraw(chart: any, args: any, options: any): void;
|
|
1973
2004
|
afterEvent(chart: any, args: any): void;
|
|
1974
2005
|
};
|
|
1975
|
-
declare function doughnutCenterTextPlugin(config: {
|
|
1976
|
-
text: string | string[];
|
|
1977
|
-
color?: string;
|
|
1978
|
-
fontStyle?: string;
|
|
1979
|
-
fontSize?: string;
|
|
1980
|
-
}): {
|
|
1981
|
-
id: string;
|
|
1982
|
-
afterInit(chart: Chart): void;
|
|
1983
|
-
afterUpdate(chart: Chart): void;
|
|
1984
|
-
updatePosition(chart: Chart): void;
|
|
1985
|
-
destroy(chart: Chart): void;
|
|
1986
|
-
};
|
|
1987
2006
|
declare const loadingPlugin: {
|
|
1988
2007
|
id: string;
|
|
1989
2008
|
beforeInit(chart: any, args: any, options: any): void;
|
|
@@ -2144,6 +2163,23 @@ declare const zoomRangeSlider: {
|
|
|
2144
2163
|
};
|
|
2145
2164
|
declare const CreateZoomRangeSlider: (colors?: ZoomRangeSliderColors) => ZoomRangeSliderPlugin;
|
|
2146
2165
|
|
|
2166
|
+
declare function doughnutCenterTextPlugin(config: {
|
|
2167
|
+
text: string | string[];
|
|
2168
|
+
color?: string;
|
|
2169
|
+
fontStyle?: string;
|
|
2170
|
+
fontSize?: string;
|
|
2171
|
+
}): {
|
|
2172
|
+
id: string;
|
|
2173
|
+
afterInit(chart: Chart): void;
|
|
2174
|
+
afterUpdate(chart: Chart): void;
|
|
2175
|
+
updatePosition(chart: Chart): void;
|
|
2176
|
+
destroy(chart: Chart): void;
|
|
2177
|
+
};
|
|
2178
|
+
declare function segmentImagePlugin(config: SegmentImageConfig): {
|
|
2179
|
+
id: string;
|
|
2180
|
+
afterDatasetDraw(chart: Chart<"doughnut" | "pie">, args: any): void;
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2147
2183
|
declare const defaultBarTooltipCallback: (context: TooltipItem<"bar">) => string;
|
|
2148
2184
|
declare const defaultBarScales: CommonAxesSacels;
|
|
2149
2185
|
declare const createDefaultBarOptions: (userOptions?: CustomBarChartOptions, defaultScales?: CommonAxesSacels) => CustomBarChartOptions;
|
|
@@ -2178,6 +2214,7 @@ declare const LocalDefaults_doughnutCenterTextPlugin: typeof doughnutCenterTextP
|
|
|
2178
2214
|
declare const LocalDefaults_loadingPlugin: typeof loadingPlugin;
|
|
2179
2215
|
declare const LocalDefaults_makeCenterHtml: typeof makeCenterHtml;
|
|
2180
2216
|
declare const LocalDefaults_noDataPlugin: typeof noDataPlugin;
|
|
2217
|
+
declare const LocalDefaults_segmentImagePlugin: typeof segmentImagePlugin;
|
|
2181
2218
|
declare const LocalDefaults_sparkBarOptions: typeof sparkBarOptions;
|
|
2182
2219
|
declare const LocalDefaults_sparkBubbleOptions: typeof sparkBubbleOptions;
|
|
2183
2220
|
declare const LocalDefaults_sparkLineOptions: typeof sparkLineOptions;
|
|
@@ -2204,6 +2241,7 @@ declare namespace LocalDefaults {
|
|
|
2204
2241
|
LocalDefaults_loadingPlugin as loadingPlugin,
|
|
2205
2242
|
LocalDefaults_makeCenterHtml as makeCenterHtml,
|
|
2206
2243
|
LocalDefaults_noDataPlugin as noDataPlugin,
|
|
2244
|
+
LocalDefaults_segmentImagePlugin as segmentImagePlugin,
|
|
2207
2245
|
LocalDefaults_sparkBarOptions as sparkBarOptions,
|
|
2208
2246
|
LocalDefaults_sparkBubbleOptions as sparkBubbleOptions,
|
|
2209
2247
|
LocalDefaults_sparkLineOptions as sparkLineOptions,
|
|
@@ -2240,8 +2278,7 @@ declare enum ChartTypes {
|
|
|
2240
2278
|
PIE = "pie",
|
|
2241
2279
|
RADAR = "radar",
|
|
2242
2280
|
BUBBLE = "bubble",
|
|
2243
|
-
SCATTER = "scatter"
|
|
2244
|
-
TREE = "tree"
|
|
2281
|
+
SCATTER = "scatter"
|
|
2245
2282
|
}
|
|
2246
2283
|
|
|
2247
2284
|
interface StzConfig {
|
|
@@ -2281,6 +2318,66 @@ interface StzConfig {
|
|
|
2281
2318
|
*/
|
|
2282
2319
|
declare function setChartConfig(config: StzConfig): void;
|
|
2283
2320
|
|
|
2321
|
+
interface ChartImageExportOptions {
|
|
2322
|
+
format?: 'png' | 'jpeg' | 'webp';
|
|
2323
|
+
quality?: number;
|
|
2324
|
+
backgroundColor?: string;
|
|
2325
|
+
filename?: string;
|
|
2326
|
+
scale?: number;
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* @description 차트를 이미지로 다운로드합니다.
|
|
2330
|
+
* @param chartId 차트 ID
|
|
2331
|
+
* @param options 이미지 내보내기 옵션
|
|
2332
|
+
* @since 1.5.0
|
|
2333
|
+
* @category util
|
|
2334
|
+
*/
|
|
2335
|
+
declare function downloadChartAsImage(chartId: string, options?: ChartImageExportOptions): void;
|
|
2336
|
+
/**
|
|
2337
|
+
* @description Chart 인스턴스를 이미지로 다운로드합니다.
|
|
2338
|
+
* @param chart Chart 인스턴스
|
|
2339
|
+
* @param options 이미지 내보내기 옵션
|
|
2340
|
+
* @since 1.5.0
|
|
2341
|
+
* @category util
|
|
2342
|
+
*/
|
|
2343
|
+
declare function downloadChartAsImageByInstance(chart: Chart, options?: ChartImageExportOptions): void;
|
|
2344
|
+
/**
|
|
2345
|
+
* @description 차트를 Base64 문자열로 반환합니다.
|
|
2346
|
+
* @param chartId 차트 ID
|
|
2347
|
+
* @param options 이미지 내보내기 옵션
|
|
2348
|
+
* @returns Base64 인코딩된 이미지 데이터 URL
|
|
2349
|
+
* @since 1.5.0
|
|
2350
|
+
* @category util
|
|
2351
|
+
*/
|
|
2352
|
+
declare function getChartAsBase64(chartId: string, options?: Omit<ChartImageExportOptions, 'filename'>): string;
|
|
2353
|
+
/**
|
|
2354
|
+
* @description Chart 인스턴스를 Base64 문자열로 반환합니다.
|
|
2355
|
+
* @param chart Chart 인스턴스
|
|
2356
|
+
* @param options 이미지 내보내기 옵션
|
|
2357
|
+
* @returns Base64 인코딩된 이미지 데이터 URL
|
|
2358
|
+
* @since 1.5.0
|
|
2359
|
+
* @category util
|
|
2360
|
+
*/
|
|
2361
|
+
declare function getChartAsBase64ByInstance(chart: Chart, options?: Omit<ChartImageExportOptions, 'filename'>): string;
|
|
2362
|
+
/**
|
|
2363
|
+
* @description 차트를 Blob 객체로 반환합니다.
|
|
2364
|
+
* @param chartId 차트 ID
|
|
2365
|
+
* @param options 이미지 내보내기 옵션
|
|
2366
|
+
* @returns Promise<Blob> 이미지 Blob
|
|
2367
|
+
* @since 1.5.0
|
|
2368
|
+
* @category util
|
|
2369
|
+
*/
|
|
2370
|
+
declare function getChartAsBlob(chartId: string, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
|
|
2371
|
+
/**
|
|
2372
|
+
* @description Chart 인스턴스를 Blob 객체로 반환합니다.
|
|
2373
|
+
* @param chart Chart 인스턴스
|
|
2374
|
+
* @param options 이미지 내보내기 옵션
|
|
2375
|
+
* @returns Promise<Blob> 이미지 Blob
|
|
2376
|
+
* @since 1.5.0
|
|
2377
|
+
* @category util
|
|
2378
|
+
*/
|
|
2379
|
+
declare function getChartAsBlobByInstance(chart: Chart, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
|
|
2380
|
+
|
|
2284
2381
|
declare const ChartToolBox: {
|
|
2285
2382
|
setErrorLog(enabled?: boolean): void;
|
|
2286
2383
|
setErrorShield(enabled?: boolean): void;
|
|
@@ -2304,5 +2401,5 @@ declare const T$: {
|
|
|
2304
2401
|
};
|
|
2305
2402
|
};
|
|
2306
2403
|
|
|
2307
|
-
export { ArcChartWrapper, BarChartWrapper, BubbleChartWrapper, CartesianChartWrapper, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, ChartWrapper, CreateZoomRangeSlider, DoughnutChartWrapper, LineChartWrapper, PieChartWrapper, T$, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultLineOptions, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultLineScales, defaultLineTooltipCallback, doughnutCenterTextPlugin, loadingPlugin, makeCenterHtml, noDataPlugin, setChartConfig, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, zoomRangeSlider, zoomResetPlugin };
|
|
2308
|
-
export type { Align, AllChartTypes, ArcChartBuilder, ArcChartType, ArcDataset, AxisColors, BarChartBuilder, BubbleChartBuilder, CartesianChartBuilder, CartesianChartType, CartesianDataset, ChartBuilder, ChartWithFocus, Color, CommonAxes, CommonAxesSacels, CommonCartesian, CommonCartesianAxes, CommonCartesianLegendConfig, CommonCartesianTicks, CommonCartesianTitleConfig, CommonTicks, Constructor, CustomArcChartOptions, CustomBarChartOptions, CustomBubbleChartOptions, CustomCartesianDataset, CustomChartDatasets, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HtmlLegendOptions, LineChartBuilder, Mode, OriginalColors, Override, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SettingOptions, StzConfig, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
|
|
2404
|
+
export { ArcChartWrapper, BarChartWrapper, BubbleChartWrapper, CartesianChartWrapper, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, ChartWrapper, CreateZoomRangeSlider, DoughnutChartWrapper, LineChartWrapper, PieChartWrapper, T$, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultLineOptions, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultLineScales, defaultLineTooltipCallback, doughnutCenterTextPlugin, downloadChartAsImage, downloadChartAsImageByInstance, getChartAsBase64, getChartAsBase64ByInstance, getChartAsBlob, getChartAsBlobByInstance, loadingPlugin, makeCenterHtml, noDataPlugin, segmentImagePlugin, setChartConfig, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, zoomRangeSlider, zoomResetPlugin };
|
|
2405
|
+
export type { Align, AllChartTypes, ArcChartBuilder, ArcChartType, ArcDataset, AxisColors, BarChartBuilder, BubbleChartBuilder, CartesianChartBuilder, CartesianChartType, CartesianDataset, ChartBuilder, ChartImageExportOptions, ChartWithFocus, Color, CommonAxes, CommonAxesSacels, CommonCartesian, CommonCartesianAxes, CommonCartesianLegendConfig, CommonCartesianTicks, CommonCartesianTitleConfig, CommonTicks, Constructor, CustomArcChartOptions, CustomBarChartOptions, CustomBubbleChartOptions, CustomCartesianDataset, CustomChartDatasets, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HtmlLegendOptions, LineChartBuilder, Mode, OriginalColors, Override, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SegmentImageConfig, SettingOptions, StzConfig, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
|