stz-chart-maker 2.3.1 → 2.3.3

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
@@ -87,6 +87,9 @@ module.exports = {
87
87
  | `silentMode` | `boolean` | `true` | 에러 발생 시 예외를 던지지 않고 처리 |
88
88
  | `defaultColor` | `string[]` | 내부 기본 팔레트 | 차트 전역 기본 색상 배열 |
89
89
 
90
+ ### 변경기록
91
+ [CHANGELOG.md](./CHANGELOG.md) 파일을 참조하세요.
92
+
90
93
  ### 주의사항
91
94
 
92
95
  `setChartConfig()`는 첫 번째 `ChartWrapper.create(...)` 호출 전에 실행해야 합니다.
package/dist/index.d.ts CHANGED
@@ -192,6 +192,38 @@ interface CommonCartesianAxes extends Omit<CommonAxes, 'ticks'>, Partial<CommonC
192
192
  type: 'category' | 'linear' | 'logarithmic' | 'time' | 'timeseries' | 'realtime';
193
193
  ticks?: CommonCartesianTicks;
194
194
  }
195
+ type TimeScaleType = 'time' | 'timeseries' | 'realtime';
196
+ type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
197
+ interface TimeScaleConfig {
198
+ type?: TimeScaleType;
199
+ unit?: TimeUnit;
200
+ displayFormats?: Record<string, string>;
201
+ tooltipFormat?: string;
202
+ parser?: string | ((value: unknown) => unknown);
203
+ min?: string | number | Date;
204
+ max?: string | number | Date;
205
+ suggestedMin?: string | number | Date;
206
+ suggestedMax?: string | number | Date;
207
+ stepSize?: number;
208
+ bounds?: 'data' | 'ticks';
209
+ offsetAfterAutoskip?: boolean;
210
+ isoWeekday?: boolean | number;
211
+ round?: TimeUnit | false;
212
+ minUnit?: TimeUnit;
213
+ adapters?: {
214
+ date?: Record<string, unknown>;
215
+ };
216
+ ticks?: CommonCartesianTicks & {
217
+ source?: 'auto' | 'data' | 'labels';
218
+ };
219
+ grid?: GridLineOptions;
220
+ border?: Record<string, unknown>;
221
+ parsing?: {
222
+ xAxisKey?: string | false;
223
+ yAxisKey?: string | false;
224
+ };
225
+ [key: string]: unknown;
226
+ }
195
227
  type DeepPartialCartesianAxes = DeepPartial<CommonCartesianAxes>;
196
228
  interface CommonAxesSacels {
197
229
  [key: string]: DeepPartialCartesianAxes;
@@ -448,7 +480,7 @@ type Constructor<TType extends ChartType, TInstance> = new (type: TType, labels:
448
480
  * ═════════════════════════════════════════════════════════════
449
481
  */
450
482
 
451
- interface ChartBuilder<TType extends string> {
483
+ interface ChartBuilder<TType extends ChartType> {
452
484
  setPlugin(plugins: any): this;
453
485
  removePlugin(pluginId: string): this;
454
486
  clone(): this;
@@ -462,11 +494,21 @@ interface ChartBuilder<TType extends string> {
462
494
  }) => void): this;
463
495
  setTitle(titleOptions: CommonCartesianTitleConfig): this;
464
496
  setLegend(legendOptions: DeepPartial<LegendOptions<any>>): this;
465
- getChartData(uid: string): object;
466
- setChartData(uid: string, data: CustomChartDatasets<any>): void;
497
+ mergeOptions(options: DeepPartial<CustomChartOptions<TType>>): this;
498
+ getChartData(uid: string): CustomChartDatasets<TType>;
499
+ setChartData(uid: string, data: CustomChartDatasets<TType>): void;
500
+ setDatasetStyle(uidOrIndex: string | number, style: DeepPartial<CustomChartDatasets<TType>>): this;
501
+ setAllDatasetStyle(style: DeepPartial<CustomChartDatasets<TType>>): this;
502
+ removeDataset(uidOrIndex: string | number): this;
503
+ removeData(datasetUidOrIndex: string | number, dataUidOrIndex?: string | number): this;
504
+ clearData(datasetUidOrIndex?: string | number): this;
505
+ setDatasetVisible(uidOrIndex: string | number, visible: boolean, syncGroup?: boolean): this;
506
+ toggleDataset(uidOrIndex: string | number, syncGroup?: boolean): this;
507
+ setDatasetGroup(uidOrIndex: string | number, group: string | number): this;
467
508
  }
468
509
  interface CartesianChartBuilder<TType extends CartesianChartType> extends ChartBuilder<TType> {
469
510
  setScales(scales: CommonAxesSacels): this;
511
+ setTimeScale(axis?: string, timeScaleConfig?: TimeScaleConfig): this;
470
512
  setAxisTitle(axis: 'x' | 'y', titleConfig: CommonCartesianTitleConfig): this;
471
513
  setGridOptions(axis: 'x' | 'y', gridOptions: {
472
514
  display?: boolean;
@@ -609,7 +651,7 @@ type Types_BubbleChartBuilder = BubbleChartBuilder;
609
651
  type Types_CartesianChartBuilder<TType extends CartesianChartType> = CartesianChartBuilder<TType>;
610
652
  type Types_CartesianChartType = CartesianChartType;
611
653
  type Types_CartesianDataset<TType extends CartesianChartType = CartesianChartType> = CartesianDataset<TType>;
612
- type Types_ChartBuilder<TType extends string> = ChartBuilder<TType>;
654
+ type Types_ChartBuilder<TType extends ChartType> = ChartBuilder<TType>;
613
655
  type Types_Color = Color;
614
656
  type Types_CommonAxes = CommonAxes;
615
657
  type Types_CommonAxesSacels = CommonAxesSacels;
@@ -647,10 +689,13 @@ type Types_RadarChartBuilder = RadarChartBuilder;
647
689
  type Types_RadialChartType = RadialChartType;
648
690
  type Types_SegmentImageConfig = SegmentImageConfig;
649
691
  type Types_SettingOptions = SettingOptions;
692
+ type Types_TimeScaleConfig = TimeScaleConfig;
693
+ type Types_TimeScaleType = TimeScaleType;
694
+ type Types_TimeUnit = TimeUnit;
650
695
  type Types_TreemapChartBuilder = TreemapChartBuilder;
651
696
  type Types_UidImageMapping = UidImageMapping;
652
697
  declare namespace Types {
653
- 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_CustomTreemapChartOptions as CustomTreemapChartOptions, Types_CustomTreemapDataset as CustomTreemapDataset, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HierarchicalChartType as HierarchicalChartType, 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, Types_TreemapChartBuilder as TreemapChartBuilder, Types_UidImageMapping as UidImageMapping };
698
+ 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_CustomTreemapChartOptions as CustomTreemapChartOptions, Types_CustomTreemapDataset as CustomTreemapDataset, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HierarchicalChartType as HierarchicalChartType, 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, Types_TimeScaleConfig as TimeScaleConfig, Types_TimeScaleType as TimeScaleType, Types_TimeUnit as TimeUnit, Types_TreemapChartBuilder as TreemapChartBuilder, Types_UidImageMapping as UidImageMapping };
654
699
  }
655
700
 
656
701
  interface ChartConfig {
@@ -686,6 +731,12 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
686
731
  static has(type: ChartType): boolean;
687
732
  protected cloneValue<T>(value: T): T;
688
733
  protected clonePlugins<TPlugins>(plugins: TPlugins): TPlugins;
734
+ protected requireDatasets(): CustomChartDatasets<TType>[];
735
+ protected resolveDatasetIndex(uidOrIndex: string | number): number;
736
+ protected getDatasetByTarget(uidOrIndex: string | number): CustomChartDatasets<TType>;
737
+ protected getGroupedDatasetIndexes(index: number): number[];
738
+ protected setDatasetVisibilityState(dataset: CustomChartDatasets<TType>, visible: boolean): void;
739
+ protected getDatasetVisibilityState(dataset: CustomChartDatasets<TType>): boolean;
689
740
  clone(): this;
690
741
  copy(): this;
691
742
  protected mergePlugins<TPlugin>(plugins: TPlugin[] | undefined, required: TPlugin[]): TPlugin[];
@@ -775,6 +826,14 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
775
826
  * });
776
827
  */
777
828
  setLegend(legendOptions: DeepPartial<LegendOptions<TType>>): this;
829
+ /**
830
+ * @description 기존 옵션에 부분 옵션을 병합합니다.
831
+ * @param {DeepPartial<TOptions>} options
832
+ * @returns {this}
833
+ * @since 2.4.0
834
+ * @category options
835
+ */
836
+ mergeOptions(options: DeepPartial<TOptions>): this;
778
837
  /**
779
838
  * @description 특정 데이터셋을 식별자(UID 또는 라벨)로 조회합니다.
780
839
  * @param {string} uid
@@ -798,6 +857,76 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
798
857
  * @beta
799
858
  */
800
859
  setChartData(uid: string, newDataset: CustomChartDatasets<TType>): void;
860
+ /**
861
+ * @description 특정 데이터셋에 부분 스타일을 병합합니다.
862
+ * @param {string | number} uidOrIndex
863
+ * @param {DeepPartial<CustomChartDatasets<TType>>} style
864
+ * @returns {this}
865
+ * @since 2.4.0
866
+ * @category dataset
867
+ */
868
+ setDatasetStyle(uidOrIndex: string | number, style: DeepPartial<CustomChartDatasets<TType>>): this;
869
+ /**
870
+ * @description 모든 데이터셋에 동일한 부분 스타일을 병합합니다.
871
+ * @param {DeepPartial<CustomChartDatasets<TType>>} style
872
+ * @returns {this}
873
+ * @since 2.4.0
874
+ * @category dataset
875
+ */
876
+ setAllDatasetStyle(style: DeepPartial<CustomChartDatasets<TType>>): this;
877
+ /**
878
+ * @description 데이터셋을 UID, 라벨 또는 인덱스로 제거합니다.
879
+ * @param {string | number} uidOrIndex
880
+ * @returns {this}
881
+ * @since 2.4.0
882
+ * @category dataset
883
+ */
884
+ removeDataset(uidOrIndex: string | number): this;
885
+ /**
886
+ * @description 특정 데이터셋의 데이터 포인트를 제거합니다. 데이터 식별자를 생략하면 마지막 포인트를 제거합니다.
887
+ * @param {string | number} datasetUidOrIndex
888
+ * @param {string | number} dataUidOrIndex
889
+ * @returns {this}
890
+ * @since 2.4.0
891
+ * @category dataset
892
+ */
893
+ removeData(datasetUidOrIndex: string | number, dataUidOrIndex?: string | number): this;
894
+ /**
895
+ * @description 데이터셋 데이터를 비웁니다. 식별자를 생략하면 모든 데이터셋을 비웁니다.
896
+ * @param {string | number} datasetUidOrIndex
897
+ * @returns {this}
898
+ * @since 2.4.0
899
+ * @category dataset
900
+ */
901
+ clearData(datasetUidOrIndex?: string | number): this;
902
+ /**
903
+ * @description 데이터셋의 표시 상태를 설정합니다. 그룹이 있으면 같은 그룹에 함께 반영할 수 있습니다.
904
+ * @param {string | number} uidOrIndex
905
+ * @param {boolean} visible
906
+ * @param {boolean} syncGroup
907
+ * @returns {this}
908
+ * @since 2.4.0
909
+ * @category dataset
910
+ */
911
+ setDatasetVisible(uidOrIndex: string | number, visible: boolean, syncGroup?: boolean): this;
912
+ /**
913
+ * @description 데이터셋의 표시 상태를 토글합니다.
914
+ * @param {string | number} uidOrIndex
915
+ * @param {boolean} syncGroup
916
+ * @returns {this}
917
+ * @since 2.4.0
918
+ * @category dataset
919
+ */
920
+ toggleDataset(uidOrIndex: string | number, syncGroup?: boolean): this;
921
+ /**
922
+ * @description 데이터셋 그룹을 지정합니다. 같은 그룹은 토글 시 함께 제어할 수 있습니다.
923
+ * @param {string | number} uidOrIndex
924
+ * @param {string | number} group
925
+ * @returns {this}
926
+ * @since 2.4.0
927
+ * @category dataset
928
+ */
929
+ setDatasetGroup(uidOrIndex: string | number, group: string | number): this;
801
930
  /**
802
931
  * @description 실시간 스트리밍 옵션을 설정합니다.
803
932
  * 이 메서드를 사용하기 전에, 사용자는 'chartjs-plugin-streaming'을 설치하고 Chart.js에 직접 등록해야 합니다.
@@ -914,6 +1043,7 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
914
1043
  } | {
915
1044
  id: string;
916
1045
  _tooltips: WeakMap<WeakKey, any>;
1046
+ _resolveLegendDatasetIndex(legendItem: any): number | undefined;
917
1047
  afterInit(chart: any, args: any, options: any): void;
918
1048
  beforeUpdate(chart: any, args: any, options: any): void;
919
1049
  _handleGroupVisibility(chart: any, datasets: any[]): void;
@@ -965,6 +1095,71 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
965
1095
  * @category Scales
966
1096
  */
967
1097
  setScales(scales: CommonAxesSacels): this;
1098
+ /**
1099
+ * @description 카테시안 차트에 시간 축을 설정합니다.
1100
+ * 축 타입은 기본적으로 `time`이 적용되며, `timeseries`, `realtime`도 설정할 수 있습니다.
1101
+ *
1102
+ * 별도 옵션을 주지 않으면 {@link DefaultTimeScaleOptions}의 기본값이 적용됩니다.
1103
+ * 기본값:
1104
+ * - `unit: 'hour'`
1105
+ * - `tooltipFormat: 'yyyy-MM-dd HH:mm'`
1106
+ * - `displayFormats.hour: 'HH:mm'`
1107
+ *
1108
+ * `parsing` 옵션을 함께 전달하면 내부적으로 `setParsingKey()`를 호출해
1109
+ * `{ x, y }` 형태 데이터 파싱 설정까지 한 번에 적용합니다.
1110
+ *
1111
+ * 주의:
1112
+ * - `type: 'time'` 또는 `type: 'timeseries'`를 사용할 때는 소비 프로젝트에 date adapter가 필요합니다.
1113
+ * - `type: 'realtime'`를 사용할 때는 `chartjs-plugin-streaming` 등록이 필요합니다.
1114
+ *
1115
+ * @param {string} axis - 시간 축을 적용할 축 ID. 기본값은 `'x'`입니다.
1116
+ * @param {TimeScaleConfig} timeScaleConfig - 시간 축 상세 설정입니다. 비워두면 기본 시간 축 설정이 적용됩니다.
1117
+ * @returns {this}
1118
+ * @since 2.3.2
1119
+ * @category Scales
1120
+ * @example
1121
+ * // 기본 시간 축 적용
1122
+ * const chart = ChartWrapper.create('line', [], [
1123
+ * {
1124
+ * label: 'Current',
1125
+ * data: [{ x: '2026-06-04 09:00', y: 10 }, { x: '2026-06-04 10:00', y: 18 }]
1126
+ * }
1127
+ * ])
1128
+ * .setTimeScale('x', {
1129
+ * parsing: { xAxisKey: 'x', yAxisKey: 'y' }
1130
+ * })
1131
+ * .build('basic-time-line');
1132
+ *
1133
+ * @example
1134
+ * // hour 단위 시간 축과 포맷 지정
1135
+ * const chart = ChartWrapper.create('line', [], datasets)
1136
+ * .setTimeScale('x', {
1137
+ * unit: 'hour',
1138
+ * displayFormats: {
1139
+ * hour: 'HH:mm'
1140
+ * },
1141
+ * tooltipFormat: 'yyyy-MM-dd HH:mm',
1142
+ * ticks: {
1143
+ * maxRotation: 0
1144
+ * },
1145
+ * parsing: {
1146
+ * xAxisKey: 'x',
1147
+ * yAxisKey: 'y'
1148
+ * }
1149
+ * })
1150
+ * .build('hour-time-line');
1151
+ *
1152
+ * @example
1153
+ * // timeseries 축 사용
1154
+ * const chart = ChartWrapper.create('scatter', [], datasets)
1155
+ * .setTimeScale('x', {
1156
+ * type: 'timeseries',
1157
+ * unit: 'day',
1158
+ * bounds: 'data'
1159
+ * })
1160
+ * .build('timeseries-scatter');
1161
+ */
1162
+ setTimeScale(axis?: string, timeScaleConfig?: TimeScaleConfig): this;
968
1163
  /**
969
1164
  * @description 카테시안 차트의 축 제목을 설정합니다. x, y 뿐만 아니라 y1, x1 등 커스텀 축도 지원합니다.
970
1165
  * @param {string} axis - 축의 ID (예: 'x', 'y', 'y1', 'x1')
@@ -1248,10 +1443,11 @@ declare abstract class CartesianChart<TType extends CartesianChartType> extends
1248
1443
  addData(datasetIndexOrData?: number | any | any[], data?: any | any[]): this;
1249
1444
  /**
1250
1445
  * @private
1251
- * @description x축이 time series인지 확인합니다.
1446
+ * @description 특정 축이 시간 축인지 확인합니다.
1447
+ * @param axis
1252
1448
  * @returns {boolean}
1253
1449
  */
1254
- private isTimeSeries;
1450
+ private isTemporalScale;
1255
1451
  }
1256
1452
 
1257
1453
  declare class BarChart extends CartesianChart<'bar'> implements BarChartBuilder {
@@ -2545,6 +2741,7 @@ declare const chartMountPlugin: {
2545
2741
  declare const customDatasetPlugins: {
2546
2742
  id: string;
2547
2743
  _tooltips: WeakMap<WeakKey, any>;
2744
+ _resolveLegendDatasetIndex(legendItem: any): number | undefined;
2548
2745
  afterInit(chart: any, args: any, options: any): void;
2549
2746
  beforeUpdate(chart: any, args: any, options: any): void;
2550
2747
  _handleGroupVisibility(chart: any, datasets: any[]): void;
@@ -2598,6 +2795,110 @@ declare function segmentImagePlugin(config: SegmentImageConfig): {
2598
2795
  afterDatasetDraw(chart: Chart$1<"doughnut" | "pie">, args: any): void;
2599
2796
  };
2600
2797
 
2798
+ type CartesianScaleType = CommonCartesianAxes['type'];
2799
+ interface CartesianScaleFactoryOptions {
2800
+ xType?: CartesianScaleType;
2801
+ yType?: CartesianScaleType;
2802
+ xTickAlign?: CommonCartesianTicks['align'];
2803
+ yTickAlign?: CommonCartesianTicks['align'];
2804
+ }
2805
+ declare const DefaultResponsiveChartOptions: {
2806
+ readonly responsive: true;
2807
+ readonly maintainAspectRatio: false;
2808
+ };
2809
+ declare const DefaultSparkPluginOptions: {
2810
+ readonly legend: {
2811
+ readonly display: false;
2812
+ };
2813
+ readonly tooltip: {
2814
+ readonly enabled: false;
2815
+ };
2816
+ readonly title: {
2817
+ readonly display: false;
2818
+ };
2819
+ };
2820
+ declare const DefaultHiddenSparkScales: CommonAxesSacels;
2821
+ declare const DefaultTopLegendOptions: {
2822
+ readonly display: true;
2823
+ readonly position: "top";
2824
+ };
2825
+ declare const DefaultHiddenLegendTopOptions: {
2826
+ readonly display: false;
2827
+ readonly position: "top";
2828
+ };
2829
+ declare const DefaultArcRadius: "90%";
2830
+ declare const createDefaultCartesianScales: ({ xType, yType, xTickAlign, yTickAlign, }?: CartesianScaleFactoryOptions) => CommonAxesSacels;
2831
+
2832
+ /**
2833
+ * ═════════════════════════════════════════════════════════════
2834
+ * 📄 FILE : Cartesian.ts
2835
+ * 📁 PACKAGE : chartjs-toolbox-
2836
+ * 👤 AUTHOR : stz
2837
+ * 🕒 CREATED : 25. 7. 24.
2838
+ * ═════════════════════════════════════════════════════════════
2839
+ * ═════════════════════════════════════════════════════════════
2840
+ * 📝 DESCRIPTION
2841
+ * -
2842
+ * ═════════════════════════════════════════════════════════════
2843
+ * ═════════════════════════════════════════════════════════════
2844
+ * 🔄 CHANGE LOG
2845
+ * - DATE : 2025/07/24 | Author : stz | 최초 생성
2846
+ * ═════════════════════════════════════════════════════════════
2847
+ */
2848
+ declare const DefaultZoomOptions: {
2849
+ zoom: {
2850
+ drag: {
2851
+ enabled: boolean;
2852
+ borderColor: string;
2853
+ borderWidth: number;
2854
+ backgroundColor: string;
2855
+ };
2856
+ mode: string;
2857
+ overScaleMode: null;
2858
+ };
2859
+ pan: {
2860
+ enabled: boolean;
2861
+ };
2862
+ };
2863
+ declare const DefaultDataLabelsOptions: {
2864
+ formatter: (value: any, context: any) => any;
2865
+ display: (context: any) => boolean;
2866
+ color: (context: any) => string;
2867
+ font: {
2868
+ size: number;
2869
+ weight: string;
2870
+ };
2871
+ anchor: string;
2872
+ align: string;
2873
+ };
2874
+ /**
2875
+ * @description `setTimeScale()` 호출 시 별도 값이 전달되지 않았을 때 적용되는 시간 축 기본 옵션입니다.
2876
+ * `unit`, `tooltipFormat`, `displayFormats.hour`의 기본값을 제공합니다.
2877
+ * @since 2.4.0
2878
+ * @category Scales
2879
+ * @example
2880
+ * // setTimeScale('x')만 호출하면 아래 기본값이 적용됩니다.
2881
+ * ChartWrapper.create('line', [], datasets)
2882
+ * .setTimeScale('x')
2883
+ * .build('time-scale-default');
2884
+ *
2885
+ * // 내부 기본값
2886
+ * // {
2887
+ * // unit: 'hour',
2888
+ * // tooltipFormat: 'yyyy-MM-dd HH:mm',
2889
+ * // displayFormats: {
2890
+ * // hour: 'HH:mm'
2891
+ * // }
2892
+ * // }
2893
+ */
2894
+ declare const DefaultTimeScaleOptions: {
2895
+ unit: string;
2896
+ tooltipFormat: string;
2897
+ displayFormats: {
2898
+ hour: string;
2899
+ };
2900
+ };
2901
+
2601
2902
  declare const defaultBarTooltipCallback: (context: TooltipItem<"bar">) => string;
2602
2903
  declare const defaultBarScales: CommonAxesSacels;
2603
2904
  declare const createDefaultBarOptions: (userOptions?: CustomBarChartOptions, defaultScales?: CommonAxesSacels) => CustomBarChartOptions;
@@ -2677,6 +2978,15 @@ declare const defaultTreemapTooltipCallback: {
2677
2978
  declare const createDefaultTreemapOptions: (userOptions?: CustomTreemapChartOptions) => CustomTreemapChartOptions;
2678
2979
 
2679
2980
  declare const LocalDefaults_CreateZoomRangeSlider: typeof CreateZoomRangeSlider;
2981
+ declare const LocalDefaults_DefaultArcRadius: typeof DefaultArcRadius;
2982
+ declare const LocalDefaults_DefaultDataLabelsOptions: typeof DefaultDataLabelsOptions;
2983
+ declare const LocalDefaults_DefaultHiddenLegendTopOptions: typeof DefaultHiddenLegendTopOptions;
2984
+ declare const LocalDefaults_DefaultHiddenSparkScales: typeof DefaultHiddenSparkScales;
2985
+ declare const LocalDefaults_DefaultResponsiveChartOptions: typeof DefaultResponsiveChartOptions;
2986
+ declare const LocalDefaults_DefaultSparkPluginOptions: typeof DefaultSparkPluginOptions;
2987
+ declare const LocalDefaults_DefaultTimeScaleOptions: typeof DefaultTimeScaleOptions;
2988
+ declare const LocalDefaults_DefaultTopLegendOptions: typeof DefaultTopLegendOptions;
2989
+ declare const LocalDefaults_DefaultZoomOptions: typeof DefaultZoomOptions;
2680
2990
  declare const LocalDefaults_barScaleImgPlugin: typeof barScaleImgPlugin;
2681
2991
  declare const LocalDefaults_blinkPlugin: typeof blinkPlugin;
2682
2992
  declare const LocalDefaults_changeSetting: typeof changeSetting;
@@ -2684,6 +2994,7 @@ declare const LocalDefaults_chartMountPlugin: typeof chartMountPlugin;
2684
2994
  declare const LocalDefaults_createAssignedTasksPlugin: typeof createAssignedTasksPlugin;
2685
2995
  declare const LocalDefaults_createDefaultBarOptions: typeof createDefaultBarOptions;
2686
2996
  declare const LocalDefaults_createDefaultBubbleOptions: typeof createDefaultBubbleOptions;
2997
+ declare const LocalDefaults_createDefaultCartesianScales: typeof createDefaultCartesianScales;
2687
2998
  declare const LocalDefaults_createDefaultDoughnutOptions: typeof createDefaultDoughnutOptions;
2688
2999
  declare const LocalDefaults_createDefaultLineOptions: typeof createDefaultLineOptions;
2689
3000
  declare const LocalDefaults_createDefaultPieOptions: typeof createDefaultPieOptions;
@@ -2715,6 +3026,15 @@ declare const LocalDefaults_zoomResetPlugin: typeof zoomResetPlugin;
2715
3026
  declare namespace LocalDefaults {
2716
3027
  export {
2717
3028
  LocalDefaults_CreateZoomRangeSlider as CreateZoomRangeSlider,
3029
+ LocalDefaults_DefaultArcRadius as DefaultArcRadius,
3030
+ LocalDefaults_DefaultDataLabelsOptions as DefaultDataLabelsOptions,
3031
+ LocalDefaults_DefaultHiddenLegendTopOptions as DefaultHiddenLegendTopOptions,
3032
+ LocalDefaults_DefaultHiddenSparkScales as DefaultHiddenSparkScales,
3033
+ LocalDefaults_DefaultResponsiveChartOptions as DefaultResponsiveChartOptions,
3034
+ LocalDefaults_DefaultSparkPluginOptions as DefaultSparkPluginOptions,
3035
+ LocalDefaults_DefaultTimeScaleOptions as DefaultTimeScaleOptions,
3036
+ LocalDefaults_DefaultTopLegendOptions as DefaultTopLegendOptions,
3037
+ LocalDefaults_DefaultZoomOptions as DefaultZoomOptions,
2718
3038
  LocalDefaults_barScaleImgPlugin as barScaleImgPlugin,
2719
3039
  LocalDefaults_blinkPlugin as blinkPlugin,
2720
3040
  LocalDefaults_changeSetting as changeSetting,
@@ -2722,6 +3042,7 @@ declare namespace LocalDefaults {
2722
3042
  LocalDefaults_createAssignedTasksPlugin as createAssignedTasksPlugin,
2723
3043
  LocalDefaults_createDefaultBarOptions as createDefaultBarOptions,
2724
3044
  LocalDefaults_createDefaultBubbleOptions as createDefaultBubbleOptions,
3045
+ LocalDefaults_createDefaultCartesianScales as createDefaultCartesianScales,
2725
3046
  LocalDefaults_createDefaultDoughnutOptions as createDefaultDoughnutOptions,
2726
3047
  LocalDefaults_createDefaultLineOptions as createDefaultLineOptions,
2727
3048
  LocalDefaults_createDefaultPieOptions as createDefaultPieOptions,
@@ -2904,5 +3225,5 @@ declare const T$: {
2904
3225
  };
2905
3226
  };
2906
3227
 
2907
- 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, DoughnutChart, DoughnutChart as DoughnutChartWrapper, LineChart, LineChart as LineChartWrapper, PieChart, PieChart as PieChartWrapper, T$, TreemapChart, TreemapChart as TreemapChartWrapper, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, createAssignedTasksPlugin, createDefaultBarOptions, createDefaultBubbleOptions, 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 };
2908
- 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, TreemapChartBuilder, UidImageMapping, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
3228
+ 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 };
3229
+ 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 };