stz-chart-maker 1.3.1 → 1.3.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 +55 -12
- package/dist/index.js +1934 -1895
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ interface ChartBuilder<TType extends ChartType> {
|
|
|
76
76
|
}) => void): this;
|
|
77
77
|
setTitle(titleOptions: CommonCartesianTitleConfig): this;
|
|
78
78
|
setLegend(legendOptions: DeepPartial<LegendOptions<TType>>): this;
|
|
79
|
+
getChartData(uid: string): object;
|
|
80
|
+
setChartData(uid: string, data: CustomChartDatasets<TType>): void;
|
|
79
81
|
}
|
|
80
82
|
type Align = 'start' | 'center' | 'end';
|
|
81
83
|
type Position = Align | 'left' | 'right' | 'top' | 'bottom';
|
|
@@ -88,6 +90,16 @@ type DeepPartial<T> = {
|
|
|
88
90
|
[P in keyof T]?: T[P] extends object ? (T[P] extends Function ? T[P] : DeepPartial<T[P]>) : T[P];
|
|
89
91
|
};
|
|
90
92
|
type Override<T, U> = Omit<T, keyof U> & U;
|
|
93
|
+
type CustomChartDatasets<TType extends ChartType = ChartType> = ChartDataset<TType, (number | null)[]> & {
|
|
94
|
+
_aux?: any;
|
|
95
|
+
_uid?: string;
|
|
96
|
+
_group?: string | number;
|
|
97
|
+
_legendOrder?: number;
|
|
98
|
+
_visible?: boolean;
|
|
99
|
+
_tooltip?: string | ((context: any) => string);
|
|
100
|
+
_groupLabel?: string;
|
|
101
|
+
_toggleBehavior?: 'normal' | 'radio' | 'disabled';
|
|
102
|
+
};
|
|
91
103
|
interface SettingOptions {
|
|
92
104
|
img: string;
|
|
93
105
|
iconSize: {
|
|
@@ -126,7 +138,6 @@ interface CommonCartesianTitleConfig {
|
|
|
126
138
|
bottom: number;
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
|
-
|
|
130
141
|
interface CommonCartesianLegendConfig {
|
|
131
142
|
display?: boolean;
|
|
132
143
|
position?: 'top' | 'left' | 'bottom' | 'right' | 'center' | 'chartArea';
|
|
@@ -440,6 +451,7 @@ type Types_CustomArcChartOptions<TType extends ArcChartType = ArcChartType> = Cu
|
|
|
440
451
|
type Types_CustomBarChartOptions = CustomBarChartOptions;
|
|
441
452
|
type Types_CustomBubbleChartOptions = CustomBubbleChartOptions;
|
|
442
453
|
type Types_CustomCartesianDataset<TType extends CartesianChartType = CartesianChartType> = CustomCartesianDataset<TType>;
|
|
454
|
+
type Types_CustomChartDatasets<TType extends ChartType = ChartType> = CustomChartDatasets<TType>;
|
|
443
455
|
type Types_CustomChartOptions<TType extends ChartType = ChartType> = CustomChartOptions<TType>;
|
|
444
456
|
type Types_CustomDoughnutChartOptions = CustomDoughnutChartOptions;
|
|
445
457
|
type Types_CustomLineChartOptions = CustomLineChartOptions;
|
|
@@ -458,7 +470,7 @@ type Types_RadarChartBuilder = RadarChartBuilder;
|
|
|
458
470
|
type Types_RadialChartType = RadialChartType;
|
|
459
471
|
type Types_SettingOptions = SettingOptions;
|
|
460
472
|
declare namespace Types {
|
|
461
|
-
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_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_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_SettingOptions as SettingOptions };
|
|
473
|
+
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_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_SettingOptions as SettingOptions };
|
|
462
474
|
}
|
|
463
475
|
|
|
464
476
|
interface ChartConfig {
|
|
@@ -482,12 +494,14 @@ type ChartBuilderMap = {
|
|
|
482
494
|
declare abstract class ChartWrapper<TType extends ChartType, TOptions extends CustomChartOptions<TType> = CustomChartOptions<TType>> implements ChartBuilder<TType> {
|
|
483
495
|
protected type: TType;
|
|
484
496
|
protected labels: (string | number)[];
|
|
485
|
-
|
|
497
|
+
private _datasets;
|
|
486
498
|
protected options: TOptions;
|
|
487
499
|
protected plugins?: any | undefined;
|
|
500
|
+
protected get datasets(): CustomChartDatasets<TType>[];
|
|
501
|
+
protected set datasets(value: CustomChartDatasets<TType>[]);
|
|
488
502
|
static registry: Map<string, Constructor<any, any>>;
|
|
489
|
-
constructor(type: TType, labels: (string | number)[],
|
|
490
|
-
static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets:
|
|
503
|
+
constructor(type: TType, labels: (string | number)[], _datasets: CustomChartDatasets<TType>[], options: TOptions, plugins?: any | undefined);
|
|
504
|
+
static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets: CustomChartDatasets<TType>[], options?: CustomChartOptions<TType>, plugins?: Plugin$1): TType extends keyof ChartBuilderMap ? ChartBuilderMap[TType] : ChartBuilder<TType>;
|
|
491
505
|
static register<TType extends ChartType, TInstance>(type: TType, wrapperClass: Constructor<TType, TInstance>): void;
|
|
492
506
|
static has(type: ChartType): boolean;
|
|
493
507
|
protected abstract normalize(): void;
|
|
@@ -576,6 +590,29 @@ declare abstract class ChartWrapper<TType extends ChartType, TOptions extends Cu
|
|
|
576
590
|
* });
|
|
577
591
|
*/
|
|
578
592
|
setLegend(legendOptions: DeepPartial<LegendOptions<TType>>): this;
|
|
593
|
+
/**
|
|
594
|
+
* @description 특정 데이터셋을 식별자(UID 또는 라벨)로 조회합니다.
|
|
595
|
+
* @param {string} uid
|
|
596
|
+
* @returns {CustomChartDatasets<TType>}
|
|
597
|
+
* @since 1.0.0
|
|
598
|
+
* @category dataset
|
|
599
|
+
* @example
|
|
600
|
+
* const dataset = chart.getChartData('dataset-uid-or-label');
|
|
601
|
+
* console.log(dataset);
|
|
602
|
+
* @beta
|
|
603
|
+
*/
|
|
604
|
+
getChartData(uid: string): CustomChartDatasets<TType>;
|
|
605
|
+
/**
|
|
606
|
+
* @description 특정 데이터셋을 식별자(UID 또는 라벨)로 찾아 새로운 데이터셋으로 교체합니다.
|
|
607
|
+
* @param {string} uid
|
|
608
|
+
* @param {CustomChartDatasets<TType>} newDataset
|
|
609
|
+
* @since 1.0.0
|
|
610
|
+
* @category dataset
|
|
611
|
+
* @example
|
|
612
|
+
* chart.setChartData('dataset-uid-or-label', { label: 'New Dataset', data: [10, 20, 30] });
|
|
613
|
+
* @beta
|
|
614
|
+
*/
|
|
615
|
+
setChartData(uid: string, newDataset: CustomChartDatasets<TType>): void;
|
|
579
616
|
}
|
|
580
617
|
|
|
581
618
|
interface AxisColors {
|
|
@@ -659,6 +696,7 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
659
696
|
protected decorateDataset(ds: any, idx: number): void;
|
|
660
697
|
protected mustHavePlugins(): {
|
|
661
698
|
id: string;
|
|
699
|
+
_tooltips: WeakMap<WeakKey, any>;
|
|
662
700
|
afterDraw(chart: any, args: any, options: any): void;
|
|
663
701
|
afterInit(chart: any, args: any, options: any): void;
|
|
664
702
|
beforeUpdate(chart: any, args: any, options: any): void;
|
|
@@ -666,8 +704,8 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
666
704
|
_handleLegendClick(e: any, legendItem: any, legend: any, toggleBehavior: string): void;
|
|
667
705
|
_setupLegendTooltip(chart: any): void;
|
|
668
706
|
_hitTestLegend(chart: any, x: number, y: number): any;
|
|
669
|
-
_showTooltip(e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
670
|
-
_hideTooltip(): void;
|
|
707
|
+
_showTooltip(chart: any, e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
708
|
+
_hideTooltip(chart: any): void;
|
|
671
709
|
afterDestroy(chart: any): void;
|
|
672
710
|
}[];
|
|
673
711
|
protected isLine(): boolean;
|
|
@@ -1443,6 +1481,7 @@ declare abstract class ArcChartWrapper<TType extends ArcChartType> extends Chart
|
|
|
1443
1481
|
protected decorateDataset(ds: any, idx: number): void;
|
|
1444
1482
|
protected mustHavePlugins(): {
|
|
1445
1483
|
id: string;
|
|
1484
|
+
_tooltips: WeakMap<WeakKey, any>;
|
|
1446
1485
|
afterDraw(chart: any, args: any, options: any): void;
|
|
1447
1486
|
afterInit(chart: any, args: any, options: any): void;
|
|
1448
1487
|
beforeUpdate(chart: any, args: any, options: any): void;
|
|
@@ -1450,8 +1489,8 @@ declare abstract class ArcChartWrapper<TType extends ArcChartType> extends Chart
|
|
|
1450
1489
|
_handleLegendClick(e: any, legendItem: any, legend: any, toggleBehavior: string): void;
|
|
1451
1490
|
_setupLegendTooltip(chart: any): void;
|
|
1452
1491
|
_hitTestLegend(chart: any, x: number, y: number): any;
|
|
1453
|
-
_showTooltip(e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
1454
|
-
_hideTooltip(): void;
|
|
1492
|
+
_showTooltip(chart: any, e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
1493
|
+
_hideTooltip(chart: any): void;
|
|
1455
1494
|
afterDestroy(chart: any): void;
|
|
1456
1495
|
}[];
|
|
1457
1496
|
protected normalize(): void;
|
|
@@ -1801,8 +1840,12 @@ declare const customLegend: {
|
|
|
1801
1840
|
*
|
|
1802
1841
|
* @beta (aux 정상동작 , _group : 에러 , groupLabel : 정상 , _tooltip : 에러 , _toggleBehavior : 정상 , _visible : 정상 , _legendOrder : 확인중)
|
|
1803
1842
|
*/
|
|
1843
|
+
/**
|
|
1844
|
+
* @description 차트가 마운트될 때 호출되는 플러그인입니다.
|
|
1845
|
+
*/
|
|
1804
1846
|
declare const chartMountPlugin: {
|
|
1805
1847
|
id: string;
|
|
1848
|
+
_tooltips: WeakMap<WeakKey, any>;
|
|
1806
1849
|
afterDraw(chart: any, args: any, options: any): void;
|
|
1807
1850
|
afterInit(chart: any, args: any, options: any): void;
|
|
1808
1851
|
beforeUpdate(chart: any, args: any, options: any): void;
|
|
@@ -1810,8 +1853,8 @@ declare const chartMountPlugin: {
|
|
|
1810
1853
|
_handleLegendClick(e: any, legendItem: any, legend: any, toggleBehavior: string): void;
|
|
1811
1854
|
_setupLegendTooltip(chart: any): void;
|
|
1812
1855
|
_hitTestLegend(chart: any, x: number, y: number): any;
|
|
1813
|
-
_showTooltip(e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
1814
|
-
_hideTooltip(): void;
|
|
1856
|
+
_showTooltip(chart: any, e: MouseEvent, tooltipContent: string | ((context: any) => string), legendItem: any): void;
|
|
1857
|
+
_hideTooltip(chart: any): void;
|
|
1815
1858
|
afterDestroy(chart: any): void;
|
|
1816
1859
|
};
|
|
1817
1860
|
declare const blinkPlugin: Plugin$1;
|
|
@@ -1963,4 +2006,4 @@ declare const T$: {
|
|
|
1963
2006
|
};
|
|
1964
2007
|
|
|
1965
2008
|
export { ArcChartWrapper, BarChartWrapper, BubbleChartWrapper, CartesianChartWrapper, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, ChartWrapper, CreateZoomRangeSlider, DoughnutChartWrapper, LineChartWrapper, T$, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultLineOptions, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultLineScales, defaultLineTooltipCallback, doughnutCenterTextPlugin, loadingPlugin, makeCenterHtml, noDataPlugin, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, zoomRangeSlider, zoomResetPlugin };
|
|
1966
|
-
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, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HtmlLegendOptions, LineChartBuilder, Mode, OriginalColors, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SettingOptions, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
|
|
2009
|
+
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, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SettingOptions, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar };
|