@oliasoft-open-source/charts-library 6.1.0 → 7.0.0-beta-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 +1266 -15
- package/dist/index.js +33 -21
- package/package.json +12 -11
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -146
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -4
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -54
- package/dist/src/components/common/common.interface.d.ts +0 -273
- package/dist/src/components/common/controls-portal.d.ts +0 -7
- package/dist/src/components/common/enums.d.ts +0 -89
- package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -25
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
- package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
- package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
- package/dist/src/components/common/helpers/container.d.ts +0 -18
- package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
- package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
- package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +0 -28
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -139
- package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
- package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -6
- package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
- package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
- package/dist/src/components/common/helpers/input-normalizers.d.ts +0 -15
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
- package/dist/src/components/common/helpers/range/range.d.ts +0 -33
- package/dist/src/components/common/helpers/text.d.ts +0 -1
- package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
- package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
- package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
- package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -47
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
- package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -19
- package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
- package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
- package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -32
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -241
- package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -42
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
- package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +0 -39
- package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +0 -10
- package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +0 -109
- package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +0 -40
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
- package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
- package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
- package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -18
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
- package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -5
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -85
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -69
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -73
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -4
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -111
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -5
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { ChartEvent, ChartTypeRegistry, Plugin, ScaleOptions } from 'chart.js';
|
|
2
|
-
import { LabelOptions } from 'chartjs-plugin-annotation';
|
|
3
|
-
import { GradientDirection } from './plugins/gradient-background-plugin/enums';
|
|
4
|
-
import { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums';
|
|
5
|
-
import { AlignOptions, Position } from './enums';
|
|
6
|
-
import { ILineMarkersAnnotation } from '../line-chart/plugins/line-markers-plugin/types';
|
|
7
|
-
export type TAxisPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
-
export type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
9
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
10
|
-
} : T;
|
|
11
|
-
export interface ICommonDataValue {
|
|
12
|
-
x: number | string;
|
|
13
|
-
y: number | string;
|
|
14
|
-
label?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ICommonDataset {
|
|
17
|
-
label?: string;
|
|
18
|
-
borderColor?: string;
|
|
19
|
-
backgroundColor?: string | string[];
|
|
20
|
-
borderWidth?: number;
|
|
21
|
-
data: ICommonDataValue[];
|
|
22
|
-
hidden?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export type ICommonScaleOptions = ScaleOptions<'category'> | ScaleOptions<'linear'> | ScaleOptions<'logarithmic'> | ScaleOptions<'time'> | ScaleOptions<'timeseries'>;
|
|
25
|
-
export type ICommonScales = Partial<Record<string, ICommonScaleOptions>>;
|
|
26
|
-
export interface ICommonAnnotationElement {
|
|
27
|
-
id?: string;
|
|
28
|
-
display: boolean;
|
|
29
|
-
annotationIndex: number;
|
|
30
|
-
label: {
|
|
31
|
-
options: LabelOptions;
|
|
32
|
-
content: string;
|
|
33
|
-
};
|
|
34
|
-
options: {
|
|
35
|
-
id?: string;
|
|
36
|
-
scaleID?: string;
|
|
37
|
-
borderColor?: string;
|
|
38
|
-
borderWidth?: number;
|
|
39
|
-
radius?: number;
|
|
40
|
-
label?: {
|
|
41
|
-
content?: string;
|
|
42
|
-
position?: string;
|
|
43
|
-
enabled?: boolean;
|
|
44
|
-
xAdjust?: number;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export interface ICoordinates {
|
|
49
|
-
x: number;
|
|
50
|
-
y: number;
|
|
51
|
-
}
|
|
52
|
-
export interface ICalloutLabelConfig {
|
|
53
|
-
enabled?: boolean;
|
|
54
|
-
color?: string;
|
|
55
|
-
font?: string;
|
|
56
|
-
borderColor?: string;
|
|
57
|
-
strokeStyle?: string;
|
|
58
|
-
lineWidth?: number;
|
|
59
|
-
startOffset?: number;
|
|
60
|
-
endOffset?: number;
|
|
61
|
-
margin?: number;
|
|
62
|
-
xValue?: number;
|
|
63
|
-
yValue?: number;
|
|
64
|
-
xAdjust?: number;
|
|
65
|
-
yAdjust?: number;
|
|
66
|
-
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
67
|
-
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
68
|
-
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
69
|
-
}
|
|
70
|
-
export interface IAnnotationLabelConfig {
|
|
71
|
-
backgroundColor?: string;
|
|
72
|
-
display?: boolean;
|
|
73
|
-
position?: string;
|
|
74
|
-
color?: string;
|
|
75
|
-
font?: string;
|
|
76
|
-
borderColor?: string;
|
|
77
|
-
callout?: Record<string, unknown>;
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
}
|
|
80
|
-
export interface ICommonAnnotationsData {
|
|
81
|
-
display?: boolean;
|
|
82
|
-
hideLegend?: boolean;
|
|
83
|
-
labelOffsetPx?: number;
|
|
84
|
-
id?: string;
|
|
85
|
-
adjustScaleRange?: boolean;
|
|
86
|
-
annotationAxis?: 'x' | 'y';
|
|
87
|
-
rotation?: number;
|
|
88
|
-
color?: string;
|
|
89
|
-
endValue?: number;
|
|
90
|
-
borderWidth?: number;
|
|
91
|
-
backgroundColor?: string;
|
|
92
|
-
label?: string;
|
|
93
|
-
labelConfig?: IAnnotationLabelConfig;
|
|
94
|
-
type?: DraggableAnnotationType;
|
|
95
|
-
value?: number;
|
|
96
|
-
xMin?: number;
|
|
97
|
-
xMax?: number;
|
|
98
|
-
yMin?: number;
|
|
99
|
-
yMax?: number;
|
|
100
|
-
xValue?: number;
|
|
101
|
-
yValue?: number;
|
|
102
|
-
radius?: number;
|
|
103
|
-
enableDrag?: boolean;
|
|
104
|
-
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
105
|
-
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
106
|
-
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
107
|
-
dragAxis?: DragAxis;
|
|
108
|
-
pointStyle?: string;
|
|
109
|
-
resizable?: boolean;
|
|
110
|
-
dragRange?: {
|
|
111
|
-
x?: [number, number];
|
|
112
|
-
y?: [number, number];
|
|
113
|
-
};
|
|
114
|
-
displayDragCoordinates?: boolean;
|
|
115
|
-
xScaleID?: string;
|
|
116
|
-
yScaleID?: string;
|
|
117
|
-
opacity?: number;
|
|
118
|
-
}
|
|
119
|
-
export interface ICommonGradientColor {
|
|
120
|
-
offset: number;
|
|
121
|
-
color: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ICommonGradient {
|
|
124
|
-
display: boolean;
|
|
125
|
-
gradientColors?: ICommonGradientColor[];
|
|
126
|
-
direction?: GradientDirection;
|
|
127
|
-
}
|
|
128
|
-
export interface ICommonStyling {
|
|
129
|
-
width?: number | string;
|
|
130
|
-
height?: number | string;
|
|
131
|
-
maintainAspectRatio?: boolean;
|
|
132
|
-
staticChartHeight?: boolean;
|
|
133
|
-
performanceMode?: boolean;
|
|
134
|
-
gradient?: ICommonGradient;
|
|
135
|
-
}
|
|
136
|
-
export interface ICommonLegend {
|
|
137
|
-
display: boolean;
|
|
138
|
-
position?: Position;
|
|
139
|
-
align?: AlignOptions;
|
|
140
|
-
}
|
|
141
|
-
export interface ICommonTooltipCallbacks {
|
|
142
|
-
title?: (...args: unknown[]) => unknown;
|
|
143
|
-
label?: (...args: unknown[]) => unknown;
|
|
144
|
-
afterLabel?: (...args: unknown[]) => unknown;
|
|
145
|
-
}
|
|
146
|
-
export interface ICommonTooltip {
|
|
147
|
-
tooltips?: boolean;
|
|
148
|
-
showLabelsInTooltips?: boolean;
|
|
149
|
-
scientificNotation?: boolean;
|
|
150
|
-
callbacks?: ICommonTooltipCallbacks;
|
|
151
|
-
}
|
|
152
|
-
export interface ICommonAdditionalAxesOptions {
|
|
153
|
-
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
154
|
-
reverse?: boolean;
|
|
155
|
-
beginAtZero?: boolean;
|
|
156
|
-
stepSize?: number;
|
|
157
|
-
stacked?: boolean;
|
|
158
|
-
suggestedMin?: number;
|
|
159
|
-
suggestedMax?: number;
|
|
160
|
-
min?: number | string;
|
|
161
|
-
max?: number | string;
|
|
162
|
-
}
|
|
163
|
-
export interface ICommonAnnotation {
|
|
164
|
-
showLabel?: boolean;
|
|
165
|
-
text?: string | string[];
|
|
166
|
-
position?: string;
|
|
167
|
-
fontSize?: number;
|
|
168
|
-
xOffset?: number;
|
|
169
|
-
yOffset?: number;
|
|
170
|
-
maxWidth?: number;
|
|
171
|
-
lineHeight?: number;
|
|
172
|
-
}
|
|
173
|
-
export interface ICommonAnnotations {
|
|
174
|
-
showAnnotations?: boolean;
|
|
175
|
-
controlAnnotation?: boolean;
|
|
176
|
-
enableDragAnnotation?: boolean;
|
|
177
|
-
enableCalloutAnnotation?: boolean;
|
|
178
|
-
lineMarkersAnnotation?: ILineMarkersAnnotation;
|
|
179
|
-
annotationsData?: ICommonAnnotationsData[];
|
|
180
|
-
labelAnnotation?: ICommonAnnotation;
|
|
181
|
-
}
|
|
182
|
-
export interface ICommonGraph {
|
|
183
|
-
lineTension?: number;
|
|
184
|
-
spanGaps?: boolean;
|
|
185
|
-
showDataLabels?: boolean;
|
|
186
|
-
showMinorGridlines?: boolean;
|
|
187
|
-
}
|
|
188
|
-
export interface ICommonInteractions {
|
|
189
|
-
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
190
|
-
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: any[]) => void;
|
|
191
|
-
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
|
|
192
|
-
}
|
|
193
|
-
export interface ICommonCustomLegend<T extends keyof ChartTypeRegistry> {
|
|
194
|
-
customLegendPlugin: Plugin<T> | null;
|
|
195
|
-
customLegendContainerID: string;
|
|
196
|
-
}
|
|
197
|
-
export interface ICommonChartOptions {
|
|
198
|
-
enableZoom?: boolean;
|
|
199
|
-
enablePan?: boolean;
|
|
200
|
-
}
|
|
201
|
-
export interface ICommonDragData {
|
|
202
|
-
enableDragData?: boolean;
|
|
203
|
-
showTooltip?: boolean;
|
|
204
|
-
roundPoints?: boolean;
|
|
205
|
-
dragX?: boolean;
|
|
206
|
-
dragY?: boolean;
|
|
207
|
-
onDragStart?: (event: unknown, element: unknown) => unknown;
|
|
208
|
-
onDrag?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
209
|
-
onDragEnd?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
210
|
-
}
|
|
211
|
-
export interface ICommonOptions {
|
|
212
|
-
title?: string | string[];
|
|
213
|
-
chartStyling?: ICommonStyling;
|
|
214
|
-
tooltip?: ICommonTooltip;
|
|
215
|
-
legend?: ICommonLegend;
|
|
216
|
-
chartOptions?: ICommonChartOptions;
|
|
217
|
-
interactions?: ICommonInteractions;
|
|
218
|
-
dragData?: ICommonDragData;
|
|
219
|
-
annotations?: ICommonAnnotations;
|
|
220
|
-
plugins?: {
|
|
221
|
-
lineMarkersPlugin?: {
|
|
222
|
-
enabled?: boolean;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
export interface ICommonData {
|
|
227
|
-
testId?: string;
|
|
228
|
-
data?: {
|
|
229
|
-
labels?: string[];
|
|
230
|
-
datasets?: ICommonDataset[];
|
|
231
|
-
};
|
|
232
|
-
options: ICommonOptions;
|
|
233
|
-
}
|
|
234
|
-
export interface ICommonHoveredItems {
|
|
235
|
-
index: number;
|
|
236
|
-
datasetIndex: number;
|
|
237
|
-
}
|
|
238
|
-
export interface ICommonChartPlugins {
|
|
239
|
-
legend: {
|
|
240
|
-
position: TAxisPosition;
|
|
241
|
-
};
|
|
242
|
-
title: {
|
|
243
|
-
display: boolean;
|
|
244
|
-
text: string;
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
export interface ICommonAxis<PositionType = string> {
|
|
248
|
-
label?: string;
|
|
249
|
-
position?: PositionType;
|
|
250
|
-
color?: string | string[];
|
|
251
|
-
unit?: string;
|
|
252
|
-
gridLines?: boolean;
|
|
253
|
-
stepSize?: number;
|
|
254
|
-
}
|
|
255
|
-
export interface IChartGeneratedLabel {
|
|
256
|
-
text: string;
|
|
257
|
-
fillStyle: string;
|
|
258
|
-
strokeStyle: string;
|
|
259
|
-
index: number;
|
|
260
|
-
}
|
|
261
|
-
export interface IChartLegendItemFilter {
|
|
262
|
-
index: number;
|
|
263
|
-
datasetIndex: number;
|
|
264
|
-
hidden: boolean;
|
|
265
|
-
}
|
|
266
|
-
export interface IChartDataLabelsOptions {
|
|
267
|
-
display?: 'auto' | boolean;
|
|
268
|
-
align?: 'center';
|
|
269
|
-
anchor?: 'center';
|
|
270
|
-
formatter?: (_value: unknown, context: unknown) => unknown;
|
|
271
|
-
}
|
|
272
|
-
export type UnusedParameter = unknown;
|
|
273
|
-
export type TPrimitive = string | number | boolean | null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
interface ControlsPortalProps {
|
|
3
|
-
children: ReactElement;
|
|
4
|
-
controlsPortalId: string;
|
|
5
|
-
}
|
|
6
|
-
declare const ControlsPortal: ({ children, controlsPortalId }: ControlsPortalProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default ControlsPortal;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export declare enum AxisType {
|
|
2
|
-
X = "x",
|
|
3
|
-
Y = "y"
|
|
4
|
-
}
|
|
5
|
-
export declare enum Position {
|
|
6
|
-
Bottom = "bottom",
|
|
7
|
-
Top = "top",
|
|
8
|
-
Left = "left",
|
|
9
|
-
Right = "right",
|
|
10
|
-
TopRight = "top-right",
|
|
11
|
-
TopLeft = "top-left",
|
|
12
|
-
BottomLeft = "bottom-left",
|
|
13
|
-
BottomRight = "bottom-right"
|
|
14
|
-
}
|
|
15
|
-
export declare enum ChartType {
|
|
16
|
-
LINE = "line",
|
|
17
|
-
BAR = "bar",
|
|
18
|
-
PIE = "pie",
|
|
19
|
-
DOUGHNUT = "doughnut",
|
|
20
|
-
SCATTER = "scatter"
|
|
21
|
-
}
|
|
22
|
-
export declare enum CursorStyle {
|
|
23
|
-
Pointer = "pointer",
|
|
24
|
-
Initial = "initial",
|
|
25
|
-
Grab = "grab",
|
|
26
|
-
Grabbing = "grabbing",
|
|
27
|
-
Crosshair = "crosshair",
|
|
28
|
-
Move = "move"
|
|
29
|
-
}
|
|
30
|
-
export declare enum ScaleType {
|
|
31
|
-
Category = "category",
|
|
32
|
-
Linear = "linear",
|
|
33
|
-
Logarithmic = "logarithmic",
|
|
34
|
-
Time = "time",
|
|
35
|
-
TimeSeries = "timeseries"
|
|
36
|
-
}
|
|
37
|
-
export declare enum ChartDirection {
|
|
38
|
-
VERTICAL = "vertical",
|
|
39
|
-
HORIZONTAL = "horizontal"
|
|
40
|
-
}
|
|
41
|
-
export declare enum TooltipLabel {
|
|
42
|
-
Y = "yLabel",
|
|
43
|
-
X = "xLabel"
|
|
44
|
-
}
|
|
45
|
-
export declare enum AlignOptions {
|
|
46
|
-
End = "end",
|
|
47
|
-
Start = "start",
|
|
48
|
-
Center = "center",
|
|
49
|
-
Right = "right",
|
|
50
|
-
Left = "left"
|
|
51
|
-
}
|
|
52
|
-
export declare enum PointType {
|
|
53
|
-
Casing = "casing"
|
|
54
|
-
}
|
|
55
|
-
export declare enum AnnotationType {
|
|
56
|
-
Box = "box",
|
|
57
|
-
Ellipse = "ellipse",
|
|
58
|
-
Line = "line",
|
|
59
|
-
Text = "text",
|
|
60
|
-
Label = "label"
|
|
61
|
-
}
|
|
62
|
-
export declare enum PointStyle {
|
|
63
|
-
Circle = "circle",
|
|
64
|
-
Square = "rect",
|
|
65
|
-
Diamond = "rectRot",
|
|
66
|
-
Triangle = "triangle"
|
|
67
|
-
}
|
|
68
|
-
export declare enum ChartHoverMode {
|
|
69
|
-
Nearest = "nearest"
|
|
70
|
-
}
|
|
71
|
-
export declare enum PanZoomMode {
|
|
72
|
-
X = "x",
|
|
73
|
-
Y = "y",
|
|
74
|
-
XY = "xy",
|
|
75
|
-
Z = "z"
|
|
76
|
-
}
|
|
77
|
-
export declare enum Key {
|
|
78
|
-
Shift = "Shift"
|
|
79
|
-
}
|
|
80
|
-
export declare enum Events {
|
|
81
|
-
Mousemove = "mousemove",
|
|
82
|
-
Mouseout = "mouseout",
|
|
83
|
-
Click = "click",
|
|
84
|
-
Touchstart = "touchstart",
|
|
85
|
-
Touchmove = "touchmove",
|
|
86
|
-
Dblclick = "dblclick"
|
|
87
|
-
}
|
|
88
|
-
export { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums';
|
|
89
|
-
export { GradientDirection } from './plugins/gradient-background-plugin/enums';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function addTransparency(input: string, alpha: number, out?: 'rgb' | 'hex'): string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ICommonAnnotationsData } from '../../common.interface';
|
|
2
|
-
export interface ICalloutCfg extends Record<string, unknown> {
|
|
3
|
-
enabled?: boolean;
|
|
4
|
-
onlyWhenOverlapping?: boolean;
|
|
5
|
-
margin?: number;
|
|
6
|
-
gapPx?: number;
|
|
7
|
-
minConnectorLengthPx?: number;
|
|
8
|
-
xAdjust?: number;
|
|
9
|
-
yAdjust?: number;
|
|
10
|
-
xValue?: number;
|
|
11
|
-
yValue?: number;
|
|
12
|
-
font?: string | {
|
|
13
|
-
size?: number | string;
|
|
14
|
-
};
|
|
15
|
-
padding?: number | {
|
|
16
|
-
top?: number;
|
|
17
|
-
right?: number;
|
|
18
|
-
bottom?: number;
|
|
19
|
-
left?: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare const isCalloutOverlapping: (ctx: any, refAnnotation: ICommonAnnotationsData, index: number) => boolean;
|
|
23
|
-
export declare const resolveCalloutXValue: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: ICalloutCfg, index: number) => number | undefined;
|
|
24
|
-
export declare const resolveCalloutYValue: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: ICalloutCfg, index: number) => number | undefined;
|
|
25
|
-
export declare const isCalloutAnchorInChartArea: (ctx: any, refAnnotation: ICommonAnnotationsData, margin?: number) => boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Chart } from 'chart.js';
|
|
2
|
-
import { UnusedParameter } from '../common.interface';
|
|
3
|
-
interface IChartAreaBorderPluginOptions {
|
|
4
|
-
borderColor: string;
|
|
5
|
-
borderWidth: number;
|
|
6
|
-
borderDash: number[];
|
|
7
|
-
borderDashOffset?: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Chart border plugin config
|
|
11
|
-
*/
|
|
12
|
-
export declare const chartAreaBorderPlugin: {
|
|
13
|
-
id: string;
|
|
14
|
-
beforeDraw(chart: Chart, _: UnusedParameter, options: IChartAreaBorderPluginOptions): void;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ICommonGradientColor } from '../common.interface';
|
|
2
|
-
export declare const BORDER_WIDTH: {
|
|
3
|
-
ZERO: number;
|
|
4
|
-
INITIAL: number;
|
|
5
|
-
HOVERED: number;
|
|
6
|
-
POINT_HOVERED: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const BORDER_COLOR = "rgba(0,0,0,0.1)";
|
|
9
|
-
export declare const ANNOTATION_DASH: number[];
|
|
10
|
-
export declare const DEFAULT_FONT_SIZE = 12;
|
|
11
|
-
export declare const DEFAULT_FONT_FAMILY = "\"Roobert\", \"Noto Sans\", sans-serif";
|
|
12
|
-
export declare const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
|
|
13
|
-
export declare const LEGEND_LABEL_BOX_SIZE = 12;
|
|
14
|
-
export declare const TOOLTIP_PADDING = 8;
|
|
15
|
-
export declare const TOOLTIP_BOX_PADDING = 4;
|
|
16
|
-
export declare const TRANSPARENT = "transparent";
|
|
17
|
-
export declare const LOGARITHMIC_STEPS: number[];
|
|
18
|
-
export declare const COLORS: string[];
|
|
19
|
-
/**
|
|
20
|
-
* @type {string}
|
|
21
|
-
* @desc equivalent of 0.6 rgba alpha chanel
|
|
22
|
-
*/
|
|
23
|
-
export declare const ALPHA_CHANEL = "99";
|
|
24
|
-
/**
|
|
25
|
-
* @type {number}
|
|
26
|
-
* @desc #FFFFFF as decimal number
|
|
27
|
-
*/
|
|
28
|
-
export declare const WHITE_COLOR_AS_DECIMAL = 16777215;
|
|
29
|
-
export declare const AUTO = "auto";
|
|
30
|
-
export declare const ANIMATION_DURATION: {
|
|
31
|
-
NO: number;
|
|
32
|
-
SLOW: number;
|
|
33
|
-
FAST: number;
|
|
34
|
-
};
|
|
35
|
-
export declare const DEFAULT_CHART_NAME = "new_chart";
|
|
36
|
-
export declare const CUSTOM_LEGEND_PLUGIN_NAME = "htmlLegend";
|
|
37
|
-
export declare const DECIMAL_POINT_TOLERANCE = 9;
|
|
38
|
-
export declare const MAX_DECIMAL_DIFF: number;
|
|
39
|
-
export declare const GRADIENT_COLORS: ICommonGradientColor[];
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ChartTypeRegistry, LegendItem, Plugin } from 'chart.js';
|
|
2
|
-
import { ICommonCustomLegend, UnusedParameter } from '../common.interface';
|
|
3
|
-
import { Position } from '../enums';
|
|
4
|
-
export interface IChartGraph {
|
|
5
|
-
showMinorGridlines?: boolean;
|
|
6
|
-
}
|
|
7
|
-
interface IOptions {
|
|
8
|
-
title?: string | string[];
|
|
9
|
-
legend?: {
|
|
10
|
-
position?: Position;
|
|
11
|
-
display?: boolean;
|
|
12
|
-
align?: string;
|
|
13
|
-
usePointStyle?: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
interface IStyling {
|
|
17
|
-
width?: string | number;
|
|
18
|
-
height?: string | number;
|
|
19
|
-
squareAspectRatio?: number | boolean;
|
|
20
|
-
maintainAspectRatio?: boolean;
|
|
21
|
-
staticChartHeight?: boolean;
|
|
22
|
-
performanceMode?: boolean;
|
|
23
|
-
}
|
|
24
|
-
interface IAxis {
|
|
25
|
-
label?: string;
|
|
26
|
-
}
|
|
27
|
-
interface ILegend {
|
|
28
|
-
customLegend?: ICommonCustomLegend<any>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @param { graph } graph - graph data from chart options
|
|
32
|
-
* @param { legend } legend
|
|
33
|
-
* @return {[]}
|
|
34
|
-
*/
|
|
35
|
-
export declare const getPlugins: <T extends keyof ChartTypeRegistry>(graph: IChartGraph | undefined, legend: ILegend) => Plugin<T>[] | any;
|
|
36
|
-
/**
|
|
37
|
-
* @param {string[]} colors - color schema
|
|
38
|
-
* @return {string} - random color
|
|
39
|
-
*/
|
|
40
|
-
export declare const generateRandomColor: (colors: string[]) => string[];
|
|
41
|
-
/**
|
|
42
|
-
* @param {ICommonChartOptions} options - chart options object
|
|
43
|
-
* @return {{color: (string|undefined), display: boolean, text}|{}}
|
|
44
|
-
*/
|
|
45
|
-
export declare const getTitle: (options: IOptions) => {
|
|
46
|
-
display: boolean;
|
|
47
|
-
text: string | string[];
|
|
48
|
-
} | {
|
|
49
|
-
display?: undefined;
|
|
50
|
-
text?: undefined;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* @function isVertical
|
|
54
|
-
*/
|
|
55
|
-
export declare const isVertical: (direction: "vertical" | "horizontal") => direction is "vertical";
|
|
56
|
-
/**
|
|
57
|
-
* @param {'x'|'y'} axisType
|
|
58
|
-
* @param {number} i - index
|
|
59
|
-
* @return {'top'|'bottom'|'left'|'right'|*}
|
|
60
|
-
*/
|
|
61
|
-
export declare const getAxisPosition: (axisType: string, i: number) => Position;
|
|
62
|
-
/**
|
|
63
|
-
* @param {chartStyling} chartStyling
|
|
64
|
-
* @param {Object} styles - styles imported form .less file
|
|
65
|
-
* @return {string} - class name
|
|
66
|
-
*/
|
|
67
|
-
export declare const getClassName: (chartStyling: IStyling, styles: Record<string, string>) => string;
|
|
68
|
-
export declare const getLegend: (options: IOptions, clickHandler: (_: UnusedParameter, legendItem: LegendItem) => void) => {
|
|
69
|
-
position: any;
|
|
70
|
-
display: boolean | undefined;
|
|
71
|
-
align: "center" | "start" | "end";
|
|
72
|
-
labels: {
|
|
73
|
-
boxHeight: number;
|
|
74
|
-
boxWidth: number | undefined;
|
|
75
|
-
usePointStyle: boolean | undefined;
|
|
76
|
-
};
|
|
77
|
-
onClick: (_: UnusedParameter, legendItem: LegendItem) => void;
|
|
78
|
-
};
|
|
79
|
-
export declare const afterLabelCallback: (tooltipItem: Record<string, any>) => string;
|
|
80
|
-
export declare const getTooltipLabel: (tooltipItem: Record<string, any>, showLabelsInTooltips: boolean) => string;
|
|
81
|
-
export declare const sanitize: (str: string) => string;
|
|
82
|
-
export declare const getChartFileName: (axes?: IAxis[]) => string;
|
|
83
|
-
export declare const setDefaultTheme: () => void;
|
|
84
|
-
export declare const isNilOrEmpty: <T>(value: T | null | undefined) => boolean;
|
|
85
|
-
export declare const isEmptyString: (value: string) => value is "";
|
|
86
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
interface ContainerProps {
|
|
3
|
-
style?: CSSProperties;
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
margin?: boolean;
|
|
6
|
-
deprecatedMessage?: string;
|
|
7
|
-
warningMessage?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const Container: {
|
|
10
|
-
({ style, children, margin, deprecatedMessage, warningMessage }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
defaultProps: {
|
|
12
|
-
style: {};
|
|
13
|
-
margin: boolean;
|
|
14
|
-
deprecatedMessage: null;
|
|
15
|
-
warningMessage: null;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const customFormatNumber: (labelNumber: number, scientificNotation: boolean) => string;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Tick } from 'chart.js';
|
|
2
|
-
import { ICommonScaleOptions, UnusedParameter } from '../common.interface';
|
|
3
|
-
type TScaleType = NonNullable<ICommonScaleOptions['type']>;
|
|
4
|
-
export declare const isTimeScaleType: (scaleType?: ICommonScaleOptions["type"]) => scaleType is "time" | "timeseries";
|
|
5
|
-
interface IGetCartesianScaleOptionsParams {
|
|
6
|
-
axisData?: {
|
|
7
|
-
gridLines?: unknown;
|
|
8
|
-
label?: string;
|
|
9
|
-
position?: unknown;
|
|
10
|
-
stepSize?: number;
|
|
11
|
-
unit?: unknown;
|
|
12
|
-
};
|
|
13
|
-
scaleType?: TScaleType;
|
|
14
|
-
scaleConfigFromProps?: ICommonScaleOptions;
|
|
15
|
-
display?: boolean;
|
|
16
|
-
beginAtZero?: boolean;
|
|
17
|
-
reverse?: boolean;
|
|
18
|
-
suggestedMax?: number | string;
|
|
19
|
-
suggestedMin?: number | string;
|
|
20
|
-
min?: number | string;
|
|
21
|
-
max?: number | string;
|
|
22
|
-
additionalStepSize?: number | null;
|
|
23
|
-
useStepSize?: boolean;
|
|
24
|
-
stacked?: boolean;
|
|
25
|
-
numericTickCallback?: (tick: string | number, unused: UnusedParameter, ticks: Tick[]) => unknown;
|
|
26
|
-
}
|
|
27
|
-
export declare const getCartesianScaleOptions: ({ axisData, scaleType, scaleConfigFromProps, display, beginAtZero, reverse, suggestedMax, suggestedMin, min, max, additionalStepSize, useStepSize, stacked, numericTickCallback, }: IGetCartesianScaleOptionsParams) => ICommonScaleOptions;
|
|
28
|
-
export {};
|