@oliasoft-open-source/charts-library 3.8.1-beta-1 → 4.0.0-beta-1
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.js +604 -677
- package/dist/index.js.map +1 -1
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +2 -73
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +36 -10
- package/dist/src/components/bar-chart/{get-bar-chart-data-labels.d.ts → utils/get-bar-chart-data-labels.d.ts} +1 -4
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
- package/dist/src/components/bar-chart/{get-bar-chart-tooltips.d.ts → utils/get-bar-chart-tooltips.d.ts} +1 -1
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +24 -0
- package/dist/src/components/common/common.interface.d.ts +7 -3
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +10 -2
- package/dist/src/components/common/helpers/chart-consts.d.ts +3 -3
- package/dist/src/components/common/helpers/chart-utils.d.ts +10 -12
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -5
- package/dist/src/components/common/helpers/get-draggableData.d.ts +13 -13
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +2 -4
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +3 -1
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +3 -3
- package/dist/src/components/line-chart/controls/line-options.d.ts +1 -2
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +11 -15
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -7
- package/dist/src/components/line-chart/hooks/use-generated-labels.d.ts +4 -1
- package/dist/src/components/line-chart/hooks/use-legend-state.d.ts +6 -5
- package/dist/src/components/line-chart/legend/legend-interface.d.ts +2 -2
- package/dist/src/components/line-chart/line-chart.interface.d.ts +25 -20
- package/dist/src/components/line-chart/line-chart.stories.d.ts +178 -199
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -1
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +5 -4
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +2 -5
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +3 -4
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +9 -9
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +4 -4
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +4 -3
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +6 -10
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +2 -1
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +3 -2
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +1 -6
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +3 -5
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +2 -9
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +53 -0
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +2 -42
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +10 -2
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +41 -0
- package/package.json +4 -3
- package/dist/src/components/bar-chart/get-bar-chart-scales.d.ts +0 -5
- package/dist/src/components/line-chart/controls/legend-options.d.ts +0 -1
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -302
- package/dist/src/components/line-chart/utils/elipsis-annotation/ellipsis-annotation.d.ts +0 -1
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { Dispatch, RefObject } from 'react';
|
|
2
|
-
import { Chart } from 'chart.js';
|
|
3
|
-
import { IState } from '../state/state.interfaces';
|
|
4
|
-
import { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
|
|
5
|
-
import { ChartHoverMode, Events, PanZoomMode, PointStyle } from '../../common/helpers/enums';
|
|
6
|
-
interface IUseChartOptions {
|
|
7
|
-
chartRef: RefObject<Chart>;
|
|
8
|
-
state: IState;
|
|
9
|
-
options: ILineChartOptions;
|
|
10
|
-
dispatch: Dispatch<any>;
|
|
11
|
-
generatedDatasets: ILineChartDataset[];
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Custom hook to generate chart options.
|
|
15
|
-
*/
|
|
16
|
-
export declare const useChartOptions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IUseChartOptions) => {
|
|
17
|
-
layout: {
|
|
18
|
-
padding: string | number | {
|
|
19
|
-
top: number;
|
|
20
|
-
bottom: number;
|
|
21
|
-
left: number;
|
|
22
|
-
right: number;
|
|
23
|
-
} | undefined;
|
|
24
|
-
};
|
|
25
|
-
onHover: (evt: import("chart.js").ChartEvent, hoveredItems: import("../../common/common.interface").ICommonHoveredItems[]) => void;
|
|
26
|
-
maintainAspectRatio: boolean | undefined;
|
|
27
|
-
aspectRatio: number;
|
|
28
|
-
animation: boolean | {
|
|
29
|
-
duration: number;
|
|
30
|
-
onComplete: (() => void) | undefined;
|
|
31
|
-
};
|
|
32
|
-
hover: {
|
|
33
|
-
mode: ChartHoverMode;
|
|
34
|
-
intersect: boolean;
|
|
35
|
-
};
|
|
36
|
-
elements: {
|
|
37
|
-
line: {
|
|
38
|
-
pointStyle: PointStyle;
|
|
39
|
-
showLine: boolean;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
scales: any;
|
|
43
|
-
plugins: {
|
|
44
|
-
datalabels: {
|
|
45
|
-
display: string;
|
|
46
|
-
align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
|
|
47
|
-
formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
|
|
48
|
-
} | {
|
|
49
|
-
display: boolean;
|
|
50
|
-
align?: undefined;
|
|
51
|
-
formatter?: undefined;
|
|
52
|
-
};
|
|
53
|
-
annotation: {
|
|
54
|
-
annotations: {
|
|
55
|
-
annotationAxis?: string | undefined;
|
|
56
|
-
color?: string | undefined;
|
|
57
|
-
type?: string | undefined;
|
|
58
|
-
adjustScaleRange?: boolean | undefined;
|
|
59
|
-
label?: string | undefined;
|
|
60
|
-
value?: number | undefined;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
zoom: {
|
|
64
|
-
pan: {
|
|
65
|
-
enabled: boolean;
|
|
66
|
-
mode: PanZoomMode;
|
|
67
|
-
onPanComplete(): void;
|
|
68
|
-
};
|
|
69
|
-
zoom: {
|
|
70
|
-
mode: PanZoomMode;
|
|
71
|
-
drag: {
|
|
72
|
-
enabled: boolean;
|
|
73
|
-
threshold: number;
|
|
74
|
-
backgroundColor: string;
|
|
75
|
-
borderColor: string;
|
|
76
|
-
borderWidth: number;
|
|
77
|
-
};
|
|
78
|
-
onZoomComplete(): void;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
tooltip: {
|
|
82
|
-
enabled: boolean;
|
|
83
|
-
mode: ChartHoverMode;
|
|
84
|
-
intersect: boolean;
|
|
85
|
-
padding: number;
|
|
86
|
-
usePointStyle: boolean;
|
|
87
|
-
boxWidth: number;
|
|
88
|
-
boxHeight: number;
|
|
89
|
-
boxPadding: number;
|
|
90
|
-
callbacks: {
|
|
91
|
-
title: (tooltipItem: any, _data: any) => string;
|
|
92
|
-
label: (tooltipItem: any) => string;
|
|
93
|
-
afterLabel: (tooltipItem: Record<string, any>) => string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
legend: {
|
|
97
|
-
display: boolean;
|
|
98
|
-
position: import("../../common/helpers/enums").Position;
|
|
99
|
-
align: string | undefined;
|
|
100
|
-
labels: {
|
|
101
|
-
boxHeight: number;
|
|
102
|
-
boxWidth: number | undefined;
|
|
103
|
-
usePointStyle: boolean | undefined;
|
|
104
|
-
};
|
|
105
|
-
onClick: (_e: any, legendItem: any) => void;
|
|
106
|
-
};
|
|
107
|
-
customLegendPlugin: {
|
|
108
|
-
htmlLegend: {
|
|
109
|
-
containerID: string;
|
|
110
|
-
} | null | undefined;
|
|
111
|
-
};
|
|
112
|
-
chartAreaBorder: {
|
|
113
|
-
borderColor: string;
|
|
114
|
-
};
|
|
115
|
-
chartAreaText: {
|
|
116
|
-
showLabel: boolean | undefined;
|
|
117
|
-
text: string | string[] | undefined;
|
|
118
|
-
position: string | undefined;
|
|
119
|
-
fontSize: number | undefined;
|
|
120
|
-
xOffset: number | undefined;
|
|
121
|
-
yOffset: number | undefined;
|
|
122
|
-
maxWidth: number | undefined;
|
|
123
|
-
lineHeight: number | undefined;
|
|
124
|
-
};
|
|
125
|
-
} | {
|
|
126
|
-
dragData: {
|
|
127
|
-
dragX: boolean | undefined;
|
|
128
|
-
dragY: boolean | undefined;
|
|
129
|
-
round: boolean | undefined;
|
|
130
|
-
showTooltip: boolean | undefined;
|
|
131
|
-
onDragStart: () => void;
|
|
132
|
-
onDrag: () => void;
|
|
133
|
-
onDragEnd: () => void;
|
|
134
|
-
};
|
|
135
|
-
datalabels: {
|
|
136
|
-
display: string;
|
|
137
|
-
align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
|
|
138
|
-
formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
|
|
139
|
-
} | {
|
|
140
|
-
display: boolean;
|
|
141
|
-
align?: undefined;
|
|
142
|
-
formatter?: undefined;
|
|
143
|
-
};
|
|
144
|
-
annotation: {
|
|
145
|
-
annotations: {
|
|
146
|
-
annotationAxis?: string | undefined;
|
|
147
|
-
color?: string | undefined;
|
|
148
|
-
type?: string | undefined;
|
|
149
|
-
adjustScaleRange?: boolean | undefined;
|
|
150
|
-
label?: string | undefined;
|
|
151
|
-
value?: number | undefined;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
zoom: {
|
|
155
|
-
pan: {
|
|
156
|
-
enabled: boolean;
|
|
157
|
-
mode: PanZoomMode;
|
|
158
|
-
onPanComplete(): void;
|
|
159
|
-
};
|
|
160
|
-
zoom: {
|
|
161
|
-
mode: PanZoomMode;
|
|
162
|
-
drag: {
|
|
163
|
-
enabled: boolean;
|
|
164
|
-
threshold: number;
|
|
165
|
-
backgroundColor: string;
|
|
166
|
-
borderColor: string;
|
|
167
|
-
borderWidth: number;
|
|
168
|
-
};
|
|
169
|
-
onZoomComplete(): void;
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
tooltip: {
|
|
173
|
-
enabled: boolean;
|
|
174
|
-
mode: ChartHoverMode;
|
|
175
|
-
intersect: boolean;
|
|
176
|
-
padding: number;
|
|
177
|
-
usePointStyle: boolean;
|
|
178
|
-
boxWidth: number;
|
|
179
|
-
boxHeight: number;
|
|
180
|
-
boxPadding: number;
|
|
181
|
-
callbacks: {
|
|
182
|
-
title: (tooltipItem: any, _data: any) => string;
|
|
183
|
-
label: (tooltipItem: any) => string;
|
|
184
|
-
afterLabel: (tooltipItem: Record<string, any>) => string;
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
legend: {
|
|
188
|
-
display: boolean;
|
|
189
|
-
position: import("../../common/helpers/enums").Position;
|
|
190
|
-
align: string | undefined;
|
|
191
|
-
labels: {
|
|
192
|
-
boxHeight: number;
|
|
193
|
-
boxWidth: number | undefined;
|
|
194
|
-
usePointStyle: boolean | undefined;
|
|
195
|
-
};
|
|
196
|
-
onClick: (_e: any, legendItem: any) => void;
|
|
197
|
-
};
|
|
198
|
-
customLegendPlugin: {
|
|
199
|
-
htmlLegend: {
|
|
200
|
-
containerID: string;
|
|
201
|
-
} | null | undefined;
|
|
202
|
-
};
|
|
203
|
-
chartAreaBorder: {
|
|
204
|
-
borderColor: string;
|
|
205
|
-
};
|
|
206
|
-
chartAreaText: {
|
|
207
|
-
showLabel: boolean | undefined;
|
|
208
|
-
text: string | string[] | undefined;
|
|
209
|
-
position: string | undefined;
|
|
210
|
-
fontSize: number | undefined;
|
|
211
|
-
xOffset: number | undefined;
|
|
212
|
-
yOffset: number | undefined;
|
|
213
|
-
maxWidth: number | undefined;
|
|
214
|
-
lineHeight: number | undefined;
|
|
215
|
-
};
|
|
216
|
-
} | {
|
|
217
|
-
dragData?: undefined;
|
|
218
|
-
datalabels: {
|
|
219
|
-
display: string;
|
|
220
|
-
align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
|
|
221
|
-
formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
|
|
222
|
-
} | {
|
|
223
|
-
display: boolean;
|
|
224
|
-
align?: undefined;
|
|
225
|
-
formatter?: undefined;
|
|
226
|
-
};
|
|
227
|
-
annotation: {
|
|
228
|
-
annotations: {
|
|
229
|
-
annotationAxis?: string | undefined;
|
|
230
|
-
color?: string | undefined;
|
|
231
|
-
type?: string | undefined;
|
|
232
|
-
adjustScaleRange?: boolean | undefined;
|
|
233
|
-
label?: string | undefined;
|
|
234
|
-
value?: number | undefined;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
zoom: {
|
|
238
|
-
pan: {
|
|
239
|
-
enabled: boolean;
|
|
240
|
-
mode: PanZoomMode;
|
|
241
|
-
onPanComplete(): void;
|
|
242
|
-
};
|
|
243
|
-
zoom: {
|
|
244
|
-
mode: PanZoomMode;
|
|
245
|
-
drag: {
|
|
246
|
-
enabled: boolean;
|
|
247
|
-
threshold: number;
|
|
248
|
-
backgroundColor: string;
|
|
249
|
-
borderColor: string;
|
|
250
|
-
borderWidth: number;
|
|
251
|
-
};
|
|
252
|
-
onZoomComplete(): void;
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
tooltip: {
|
|
256
|
-
enabled: boolean;
|
|
257
|
-
mode: ChartHoverMode;
|
|
258
|
-
intersect: boolean;
|
|
259
|
-
padding: number;
|
|
260
|
-
usePointStyle: boolean;
|
|
261
|
-
boxWidth: number;
|
|
262
|
-
boxHeight: number;
|
|
263
|
-
boxPadding: number;
|
|
264
|
-
callbacks: {
|
|
265
|
-
title: (tooltipItem: any, _data: any) => string;
|
|
266
|
-
label: (tooltipItem: any) => string;
|
|
267
|
-
afterLabel: (tooltipItem: Record<string, any>) => string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
legend: {
|
|
271
|
-
display: boolean;
|
|
272
|
-
position: import("../../common/helpers/enums").Position;
|
|
273
|
-
align: string | undefined;
|
|
274
|
-
labels: {
|
|
275
|
-
boxHeight: number;
|
|
276
|
-
boxWidth: number | undefined;
|
|
277
|
-
usePointStyle: boolean | undefined;
|
|
278
|
-
};
|
|
279
|
-
onClick: (_e: any, legendItem: any) => void;
|
|
280
|
-
};
|
|
281
|
-
customLegendPlugin: {
|
|
282
|
-
htmlLegend: {
|
|
283
|
-
containerID: string;
|
|
284
|
-
} | null | undefined;
|
|
285
|
-
};
|
|
286
|
-
chartAreaBorder: {
|
|
287
|
-
borderColor: string;
|
|
288
|
-
};
|
|
289
|
-
chartAreaText: {
|
|
290
|
-
showLabel: boolean | undefined;
|
|
291
|
-
text: string | string[] | undefined;
|
|
292
|
-
position: string | undefined;
|
|
293
|
-
fontSize: number | undefined;
|
|
294
|
-
xOffset: number | undefined;
|
|
295
|
-
yOffset: number | undefined;
|
|
296
|
-
maxWidth: number | undefined;
|
|
297
|
-
lineHeight: number | undefined;
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
events: Events[];
|
|
301
|
-
};
|
|
302
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ellipsisAnnotation: (datasets: any[]) => Record<string, any>;
|