stz-chart-maker 2.3.4 → 2.3.5

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 CHANGED
@@ -66,6 +66,7 @@ setChartConfig({
66
66
  silentMode: false,
67
67
  defaultColor: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8', '#F7DC6F'],
68
68
  zoom: true,
69
+ loading: true,
69
70
  legend: {
70
71
  position: 'top'
71
72
  },
@@ -94,9 +95,26 @@ module.exports = {
94
95
  | `silentMode` | `boolean` | `true` | 에러 발생 시 예외를 던지지 않고 처리 |
95
96
  | `defaultColor` | `string[]` | 내부 기본 팔레트 | 차트 전역 기본 색상 배열 |
96
97
  | `zoom` | `boolean \| object` | `false` | `line`, `bar`, `bubble` 차트에 전역 zoom 기본값 적용 |
98
+ | `loading` | `boolean` | `false` | Cartesian 차트에 전역 loading 기본값 적용 |
97
99
  | `legend` | `object` | 차트 기본값 사용 | 차트 전역 legend 기본 옵션 적용 |
98
100
  | `tooltip` | `object` | 차트 기본값 사용 | 차트 전역 tooltip 기본 옵션 적용 |
99
101
 
102
+ ## Export / Empty State
103
+
104
+ ```tsx
105
+ import { ChartWrapper, downloadChartAsImage, setChartConfig } from 'stz-chart-maker';
106
+
107
+ setChartConfig({ loading: true });
108
+
109
+ const chartConfig = ChartWrapper
110
+ .create('bar', [], [{ data: [] }], {
111
+ _noDataText: '데이터 없음',
112
+ })
113
+ .build('sales-chart');
114
+
115
+ downloadChartAsImage('sales-chart');
116
+ ```
117
+
100
118
  ### 변경기록
101
119
  [CHANGELOG.md](./CHANGELOG.md) 파일을 참조하세요.
102
120
 
package/dist/index.d.ts CHANGED
@@ -448,6 +448,7 @@ type CustomChartOptions<TType extends ChartType = ChartType> = Override<ChartOpt
448
448
  _mounted?: (chart: Chart$1<TType>) => void;
449
449
  _chartId?: string;
450
450
  _loading?: boolean;
451
+ _noDataText?: string;
451
452
  };
452
453
  type CustomArcChartOptions<TType extends ArcChartType = ArcChartType> = CustomChartOptions<TType> & {
453
454
  scales?: never;
@@ -1071,6 +1072,7 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
1071
1072
  _hideTooltip(chart: any): void;
1072
1073
  afterDestroy(chart: any): void;
1073
1074
  })[];
1075
+ protected resolveMustHavePlugins(options?: CustomChartOptions<TType>): any[];
1074
1076
  protected isLine(): boolean;
1075
1077
  protected isScatter(): boolean;
1076
1078
  protected isBar(): boolean;
@@ -2034,6 +2036,7 @@ declare abstract class ArcChart<TType extends ArcChartType> extends Chart<TType>
2034
2036
  afterDraw(chart: any, args: any, options: any): void;
2035
2037
  afterDestroy(chart: any): void;
2036
2038
  }[];
2039
+ protected resolveMustHavePlugins(options?: CustomArcChartOptions<TType>): any[];
2037
2040
  protected normalize(): void;
2038
2041
  protected configAop(config: any): any;
2039
2042
  /**
@@ -2478,6 +2481,7 @@ declare class TreemapChart extends Chart<'treemap', CustomTreemapChartOptions> i
2478
2481
  afterDraw(chart: any, args: any, options: any): void;
2479
2482
  afterDestroy(chart: any): void;
2480
2483
  }[];
2484
+ protected resolveMustHavePlugins(options?: CustomTreemapChartOptions): any[];
2481
2485
  protected configAop(config: any): any;
2482
2486
  /**
2483
2487
  * @Description 차트 설정 객체를 생성합니다.
@@ -3136,6 +3140,7 @@ interface StzConfig {
3136
3140
  silentMode?: boolean;
3137
3141
  defaultColor?: string[];
3138
3142
  zoom?: boolean | DeepPartialZoomType;
3143
+ loading?: boolean;
3139
3144
  legend?: DeepPartial<LegendOptions<any>>;
3140
3145
  tooltip?: DeepPartial<TooltipOptions<any>>;
3141
3146
  /** @deprecated no-op. Built-in chart types are bootstrapped at package load time. */
@@ -3156,6 +3161,7 @@ interface StzConfig {
3156
3161
  * silentMode: false,
3157
3162
  * defaultColor: ['#111111', '#22c55e', '#3b82f6'],
3158
3163
  * zoom: true,
3164
+ * loading: true,
3159
3165
  * legend: {
3160
3166
  * position: 'top'
3161
3167
  * },
@@ -3186,6 +3192,19 @@ interface ChartImageExportOptions {
3186
3192
  filename?: string;
3187
3193
  scale?: number;
3188
3194
  }
3195
+ type ChartTarget = string | Chart$1;
3196
+ declare function getChartInstance(chart: Chart$1): Chart$1;
3197
+ declare function getChartInstance(chartId: string): Chart$1;
3198
+ declare function resetChartZoom(chart: Chart$1): void;
3199
+ declare function resetChartZoom(chartId: string): void;
3200
+ declare function updateChart(chart: Chart$1, mode?: Parameters<Chart$1['update']>[0]): void;
3201
+ declare function updateChart(chartId: string, mode?: Parameters<Chart$1['update']>[0]): void;
3202
+ declare function resizeChart(chart: Chart$1): void;
3203
+ declare function resizeChart(chartId: string): void;
3204
+ declare function setChartActiveElements(chart: Chart$1, activeElements: ActiveElement[]): void;
3205
+ declare function setChartActiveElements(chartId: string, activeElements: ActiveElement[]): void;
3206
+ declare function getChartDatasetMeta(chart: Chart$1, datasetIndex: number): ReturnType<Chart$1['getDatasetMeta']>;
3207
+ declare function getChartDatasetMeta(chartId: string, datasetIndex: number): ReturnType<Chart$1['getDatasetMeta']>;
3189
3208
  /**
3190
3209
  * @description 차트를 이미지로 다운로드합니다.
3191
3210
  * @param chartId 차트 ID
@@ -3193,6 +3212,7 @@ interface ChartImageExportOptions {
3193
3212
  * @since 1.5.0
3194
3213
  * @category util
3195
3214
  */
3215
+ declare function downloadChartAsImage(chart: Chart$1, options?: ChartImageExportOptions): void;
3196
3216
  declare function downloadChartAsImage(chartId: string, options?: ChartImageExportOptions): void;
3197
3217
  /**
3198
3218
  * @description Chart 인스턴스를 이미지로 다운로드합니다.
@@ -3210,6 +3230,7 @@ declare function downloadChartAsImageByInstance(chart: Chart$1, options?: ChartI
3210
3230
  * @since 1.5.0
3211
3231
  * @category util
3212
3232
  */
3233
+ declare function getChartAsBase64(chart: Chart$1, options?: Omit<ChartImageExportOptions, 'filename'>): string;
3213
3234
  declare function getChartAsBase64(chartId: string, options?: Omit<ChartImageExportOptions, 'filename'>): string;
3214
3235
  /**
3215
3236
  * @description Chart 인스턴스를 Base64 문자열로 반환합니다.
@@ -3228,6 +3249,7 @@ declare function getChartAsBase64ByInstance(chart: Chart$1, options?: Omit<Chart
3228
3249
  * @since 1.5.0
3229
3250
  * @category util
3230
3251
  */
3252
+ declare function getChartAsBlob(chart: Chart$1, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
3231
3253
  declare function getChartAsBlob(chartId: string, options?: Omit<ChartImageExportOptions, 'filename'>): Promise<Blob>;
3232
3254
  /**
3233
3255
  * @description Chart 인스턴스를 Blob 객체로 반환합니다.
@@ -3272,5 +3294,5 @@ declare const T$: {
3272
3294
  };
3273
3295
  };
3274
3296
 
3275
- 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, loadingPlugin, makeCenterHtml, noDataPlugin, segmentImagePlugin, setChartConfig, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, zoomRangeSlider, zoomResetPlugin };
3276
- 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, 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 };
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 };
3298
+ 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 };