stz-chart-maker 2.3.3 → 2.3.4
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 +11 -1
- package/dist/index.d.ts +52 -5
- package/dist/index.js +3416 -3401
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,14 @@ import { setChartConfig } from 'stz-chart-maker';
|
|
|
64
64
|
setChartConfig({
|
|
65
65
|
errorLogging: true,
|
|
66
66
|
silentMode: false,
|
|
67
|
-
defaultColor: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8', '#F7DC6F']
|
|
67
|
+
defaultColor: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8', '#F7DC6F'],
|
|
68
|
+
zoom: true,
|
|
69
|
+
legend: {
|
|
70
|
+
position: 'top'
|
|
71
|
+
},
|
|
72
|
+
tooltip: {
|
|
73
|
+
enabled: true
|
|
74
|
+
}
|
|
68
75
|
});
|
|
69
76
|
```
|
|
70
77
|
|
|
@@ -86,6 +93,9 @@ module.exports = {
|
|
|
86
93
|
| `errorLogging` | `boolean` | `true` | 에러 로그 출력 여부 |
|
|
87
94
|
| `silentMode` | `boolean` | `true` | 에러 발생 시 예외를 던지지 않고 처리 |
|
|
88
95
|
| `defaultColor` | `string[]` | 내부 기본 팔레트 | 차트 전역 기본 색상 배열 |
|
|
96
|
+
| `zoom` | `boolean \| object` | `false` | `line`, `bar`, `bubble` 차트에 전역 zoom 기본값 적용 |
|
|
97
|
+
| `legend` | `object` | 차트 기본값 사용 | 차트 전역 legend 기본 옵션 적용 |
|
|
98
|
+
| `tooltip` | `object` | 차트 기본값 사용 | 차트 전역 tooltip 기본 옵션 적용 |
|
|
89
99
|
|
|
90
100
|
### 변경기록
|
|
91
101
|
[CHANGELOG.md](./CHANGELOG.md) 파일을 참조하세요.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartTypeRegistry, ChartType, ChartDataset, GridLineOptions, FontSpec, Tick, PluginOptionsByType, Chart as Chart$1, ChartOptions, ChartEvent, ActiveElement, LegendOptions, Plugin as Plugin$1, TooltipItem } from 'chart.js';
|
|
1
|
+
import { ChartTypeRegistry, ChartType, ChartDataset, GridLineOptions, FontSpec, Tick, PluginOptionsByType, Chart as Chart$1, ChartOptions, ChartEvent, ActiveElement, LegendOptions, TooltipOptions, Plugin as Plugin$1, TooltipItem } from 'chart.js';
|
|
2
2
|
import { TreemapControllerDatasetOptions } from 'chartjs-chart-treemap';
|
|
3
3
|
import { ZoomPluginOptions } from 'chartjs-plugin-zoom/types/options';
|
|
4
4
|
|
|
@@ -494,6 +494,7 @@ interface ChartBuilder<TType extends ChartType> {
|
|
|
494
494
|
}) => void): this;
|
|
495
495
|
setTitle(titleOptions: CommonCartesianTitleConfig): this;
|
|
496
496
|
setLegend(legendOptions: DeepPartial<LegendOptions<any>>): this;
|
|
497
|
+
setTooltip(tooltipOptions: DeepPartial<TooltipOptions<any>>): this;
|
|
497
498
|
mergeOptions(options: DeepPartial<CustomChartOptions<TType>>): this;
|
|
498
499
|
getChartData(uid: string): CustomChartDatasets<TType>;
|
|
499
500
|
setChartData(uid: string, data: CustomChartDatasets<TType>): void;
|
|
@@ -515,6 +516,7 @@ interface CartesianChartBuilder<TType extends CartesianChartType> extends ChartB
|
|
|
515
516
|
color?: string;
|
|
516
517
|
lineWidth?: number;
|
|
517
518
|
}): this;
|
|
519
|
+
setZoom(enabled: boolean, zoomOption?: DeepPartialZoomType): this;
|
|
518
520
|
addZoom(defaultZoom?: boolean, zoomOption?: object): this;
|
|
519
521
|
addDataLabels(defultDataLabels?: boolean, dataLabelsOptions?: PartialDataLabels): this;
|
|
520
522
|
setYAxisForDataset(datasetIndex: number, axisId?: string): this;
|
|
@@ -731,6 +733,7 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
|
|
|
731
733
|
static has(type: ChartType): boolean;
|
|
732
734
|
protected cloneValue<T>(value: T): T;
|
|
733
735
|
protected clonePlugins<TPlugins>(plugins: TPlugins): TPlugins;
|
|
736
|
+
protected applyGlobalPluginConfig(): void;
|
|
734
737
|
protected requireDatasets(): CustomChartDatasets<TType>[];
|
|
735
738
|
protected resolveDatasetIndex(uidOrIndex: string | number): number;
|
|
736
739
|
protected getDatasetByTarget(uidOrIndex: string | number): CustomChartDatasets<TType>;
|
|
@@ -826,6 +829,20 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
|
|
|
826
829
|
* });
|
|
827
830
|
*/
|
|
828
831
|
setLegend(legendOptions: DeepPartial<LegendOptions<TType>>): this;
|
|
832
|
+
/**
|
|
833
|
+
* @description 차트의 툴팁을 설정합니다.
|
|
834
|
+
* 전역 `setChartConfig({ tooltip: ... })` 설정이 있으면 이를 기본값으로 사용하고, 이 메서드 호출값으로 병합합니다.
|
|
835
|
+
* @param {DeepPartial<TooltipOptions<TType>>} tooltipOptions
|
|
836
|
+
* @returns {this}
|
|
837
|
+
* @Since 2.4.0
|
|
838
|
+
* @category options
|
|
839
|
+
* @example
|
|
840
|
+
* chart.setTooltip({
|
|
841
|
+
* enabled: true,
|
|
842
|
+
* backgroundColor: 'rgba(8, 26, 61, 0.95)'
|
|
843
|
+
* });
|
|
844
|
+
*/
|
|
845
|
+
setTooltip(tooltipOptions: DeepPartial<TooltipOptions<TType>>): this;
|
|
829
846
|
/**
|
|
830
847
|
* @description 기존 옵션에 부분 옵션을 병합합니다.
|
|
831
848
|
* @param {DeepPartial<TOptions>} options
|
|
@@ -1057,6 +1074,9 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
|
|
|
1057
1074
|
protected isLine(): boolean;
|
|
1058
1075
|
protected isScatter(): boolean;
|
|
1059
1076
|
protected isBar(): boolean;
|
|
1077
|
+
protected applyGlobalZoomConfig(): void;
|
|
1078
|
+
protected ensureZoomResetPlugin(): void;
|
|
1079
|
+
protected removeZoomResetPlugin(): void;
|
|
1060
1080
|
protected normalize(): void;
|
|
1061
1081
|
protected configAop(config: any): any;
|
|
1062
1082
|
/**
|
|
@@ -1187,14 +1207,31 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
|
|
|
1187
1207
|
lineWidth?: number;
|
|
1188
1208
|
}): this;
|
|
1189
1209
|
/**
|
|
1190
|
-
* @description 줌 기능을
|
|
1191
|
-
*
|
|
1192
|
-
* @param
|
|
1210
|
+
* @description 줌 기능을 설정합니다. `false`를 전달하면 현재 차트의 줌 설정을 제거합니다.
|
|
1211
|
+
* 전역 `setChartConfig({ zoom: true })` 설정이 있더라도 이 메서드로 차트별 비활성화가 가능합니다.
|
|
1212
|
+
* @param {boolean} enabled
|
|
1213
|
+
* @param {CustomZoomType<TType>} zoomOption
|
|
1214
|
+
* @returns {this}
|
|
1215
|
+
* @since 2.4.0
|
|
1216
|
+
* @category Plugins
|
|
1217
|
+
*/
|
|
1218
|
+
setZoom(enabled: boolean, zoomOption?: DeepPartialZoomType): this;
|
|
1219
|
+
/**
|
|
1220
|
+
* @deprecated `setZoom(enabled, zoomOption)`을 사용하세요.
|
|
1221
|
+
* @description 레거시 줌 설정 메서드입니다. 내부적으로 `setZoom(true, ...)`를 호출합니다.
|
|
1222
|
+
* @param defaultZoom - `true`이면 기본 줌 옵션을 적용합니다.
|
|
1223
|
+
* @param zoomOption - 사용자 정의 줌 옵션입니다.
|
|
1193
1224
|
* @returns {this}
|
|
1194
1225
|
* @since 1.0.0
|
|
1195
1226
|
* @category Plugins
|
|
1196
1227
|
* @defaultValue defaultZoom = false
|
|
1228
|
+
* @example
|
|
1229
|
+
* // 기존 방식
|
|
1230
|
+
* chart.addZoom(true);
|
|
1197
1231
|
*
|
|
1232
|
+
* @example
|
|
1233
|
+
* // 권장 방식
|
|
1234
|
+
* chart.setZoom(true);
|
|
1198
1235
|
*/
|
|
1199
1236
|
addZoom(defaultZoom?: boolean, zoomOption?: object): this;
|
|
1200
1237
|
/**
|
|
@@ -3098,6 +3135,9 @@ interface StzConfig {
|
|
|
3098
3135
|
errorLogging?: boolean;
|
|
3099
3136
|
silentMode?: boolean;
|
|
3100
3137
|
defaultColor?: string[];
|
|
3138
|
+
zoom?: boolean | DeepPartialZoomType;
|
|
3139
|
+
legend?: DeepPartial<LegendOptions<any>>;
|
|
3140
|
+
tooltip?: DeepPartial<TooltipOptions<any>>;
|
|
3101
3141
|
/** @deprecated no-op. Built-in chart types are bootstrapped at package load time. */
|
|
3102
3142
|
autoRegister?: boolean;
|
|
3103
3143
|
/** @deprecated no-op. Built-in chart types are bootstrapped at package load time. */
|
|
@@ -3114,7 +3154,14 @@ interface StzConfig {
|
|
|
3114
3154
|
* setChartConfig({
|
|
3115
3155
|
* errorLogging: true,
|
|
3116
3156
|
* silentMode: false,
|
|
3117
|
-
* defaultColor: ['#111111', '#22c55e', '#3b82f6']
|
|
3157
|
+
* defaultColor: ['#111111', '#22c55e', '#3b82f6'],
|
|
3158
|
+
* zoom: true,
|
|
3159
|
+
* legend: {
|
|
3160
|
+
* position: 'top'
|
|
3161
|
+
* },
|
|
3162
|
+
* tooltip: {
|
|
3163
|
+
* enabled: true
|
|
3164
|
+
* }
|
|
3118
3165
|
* });
|
|
3119
3166
|
* ```
|
|
3120
3167
|
*
|