@oliasoft-open-source/charts-library 8.0.6 → 9.0.0
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 +15 -2249
- package/dist/index.js +920 -894
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +2 -0
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +3 -0
- package/dist/src/components/bar-chart/bar-chart.d.ts +43 -0
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +252 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +4 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +54 -0
- package/dist/src/components/common/common.interface.d.ts +510 -0
- package/dist/src/components/common/controls-portal.d.ts +7 -0
- package/dist/src/components/common/enums.d.ts +104 -0
- package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +1 -0
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +25 -0
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +16 -0
- package/dist/src/components/common/helpers/chart-consts.d.ts +40 -0
- package/dist/src/components/common/helpers/chart-utils.d.ts +86 -0
- package/dist/src/components/common/helpers/custom-format-number.d.ts +1 -0
- package/dist/src/components/common/helpers/download-png.d.ts +3 -0
- package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +28 -0
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +139 -0
- package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +1 -0
- package/dist/src/components/common/helpers/get-draggableData.d.ts +18 -0
- package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +12 -0
- package/dist/src/components/common/helpers/input-normalizers.d.ts +15 -0
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
- package/dist/src/components/common/helpers/range/range.d.ts +33 -0
- package/dist/src/components/common/helpers/to-annotation.d.ts +4 -0
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +4 -0
- package/dist/src/components/common/hooks/use-legend-state.d.ts +28 -0
- package/dist/src/components/common/hooks/use-legend.d.ts +4 -0
- package/dist/src/components/common/hooks/use-update-annotations.d.ts +4 -0
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-interface.d.ts +50 -0
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-panel.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-position-storage.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend.d.ts +3 -0
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +3 -0
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +14 -0
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +30 -0
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +27 -0
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +3 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +7 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +23 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +9 -0
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +18 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +11 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
- package/dist/src/components/line-chart/constants/default-translations.d.ts +25 -0
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +13 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +57 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +6 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +8 -0
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +19 -0
- package/dist/src/components/line-chart/controls/controls.d.ts +4 -0
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +14 -0
- package/dist/src/components/line-chart/controls/drag-options.d.ts +23 -0
- package/dist/src/components/line-chart/controls/line-options.d.ts +19 -0
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +32 -0
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +20 -0
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +7 -0
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +12 -0
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/config.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +17 -0
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/line-chart/line-chart.d.ts +42 -0
- package/dist/src/components/line-chart/line-chart.interface.d.ts +458 -0
- package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +11 -0
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +42 -0
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +39 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +10 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +204 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +40 -0
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +11 -0
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +9 -0
- package/dist/src/components/line-chart/state/action-types.d.ts +12 -0
- package/dist/src/components/line-chart/state/helpers.d.ts +13 -0
- package/dist/src/components/line-chart/state/initial-state.d.ts +11 -0
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +2 -0
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +26 -0
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +18 -0
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
- 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 +8 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
- package/dist/src/components/line-chart/utils/enums.d.ts +4 -0
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +8 -0
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +5 -0
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +9 -0
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +16 -0
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +5 -0
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +31 -0
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +24 -0
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +8 -0
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/pie-chart/pie-chart.d.ts +38 -0
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +150 -0
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +42 -0
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +69 -0
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +73 -0
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +4 -0
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +41 -0
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +193 -0
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +5 -0
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
- package/package.json +34 -34
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import type { Chart, ChartEvent, ChartTypeRegistry, Plugin, ScaleOptions } from 'chart.js';
|
|
2
|
+
import type { LabelOptions } from 'chartjs-plugin-annotation';
|
|
3
|
+
import { GradientDirection } from './plugins/gradient-background-plugin/enums.js';
|
|
4
|
+
import type { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums.js';
|
|
5
|
+
import type { AlignOptions, Position } from './enums';
|
|
6
|
+
import type { ILineMarkersAnnotation } from '../line-chart/plugins/line-markers-plugin/types.js';
|
|
7
|
+
/** Allowed positions for a Cartesian axis. */
|
|
8
|
+
export type TAxisPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
9
|
+
/** Recursively makes object properties optional while preserving callable types and array element shapes. */
|
|
10
|
+
export type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
11
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
12
|
+
} : T;
|
|
13
|
+
/** A Cartesian data point with an optional display label. */
|
|
14
|
+
export interface ICommonDataValue {
|
|
15
|
+
/** X coordinate in scale units. */
|
|
16
|
+
x: number | string;
|
|
17
|
+
/** Y coordinate in scale units. */
|
|
18
|
+
y: number | string;
|
|
19
|
+
/** Display text associated with this element. */
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Chart.js instance types used by the library's Cartesian chart helpers. */
|
|
23
|
+
export type TChart = Chart<'bar', ICommonDataValue[]> | Chart<'line', ICommonDataValue[]> | Chart<'scatter', ICommonDataValue[]>;
|
|
24
|
+
/** Shared input DS fields for Cartesian chart components. */
|
|
25
|
+
export interface ICommonDataset {
|
|
26
|
+
/** DS name used in the legend and tooltip. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Canvas colour used for the element outline. */
|
|
29
|
+
borderColor?: string;
|
|
30
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
31
|
+
backgroundColor?: string | string[];
|
|
32
|
+
/** Outline width in canvas pixels. */
|
|
33
|
+
borderWidth?: number;
|
|
34
|
+
/** Values rendered by the chart or DS. */
|
|
35
|
+
data: ICommonDataValue[];
|
|
36
|
+
/** Initial visibility flag for the DS. */
|
|
37
|
+
hidden?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Supported Chart.js scale option variants. */
|
|
40
|
+
export type ICommonScaleOptions = ScaleOptions<'category'> | ScaleOptions<'linear'> | ScaleOptions<'logarithmic'> | ScaleOptions<'time'> | ScaleOptions<'timeseries'>;
|
|
41
|
+
/** Scale configuration indexed by Chart.js scale ID. */
|
|
42
|
+
export type ICommonScales = Partial<Record<string, ICommonScaleOptions>>;
|
|
43
|
+
/** Rendered annotation metadata used by annotation interaction helpers. */
|
|
44
|
+
export interface ICommonAnnotationElement {
|
|
45
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
46
|
+
id?: string;
|
|
47
|
+
/** Whether this element is visible. */
|
|
48
|
+
display: boolean;
|
|
49
|
+
/** Index of the source annotation in the annotation collection. */
|
|
50
|
+
annotationIndex: number;
|
|
51
|
+
/** Rendered annotation label content and plugin options. */
|
|
52
|
+
label: {
|
|
53
|
+
/** Configuration for this chart or generated element. */
|
|
54
|
+
options: LabelOptions;
|
|
55
|
+
/** Text content of the generated label. */
|
|
56
|
+
content: string;
|
|
57
|
+
};
|
|
58
|
+
/** Configuration for this chart or generated element. */
|
|
59
|
+
options: {
|
|
60
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
61
|
+
id?: string;
|
|
62
|
+
/** Chart.js scale ID associated with this element. */
|
|
63
|
+
scaleID?: string;
|
|
64
|
+
/** Canvas colour used for the element outline. */
|
|
65
|
+
borderColor?: string;
|
|
66
|
+
/** Outline width in canvas pixels. */
|
|
67
|
+
borderWidth?: number;
|
|
68
|
+
/** Rendered annotation radius in pixels. */
|
|
69
|
+
radius?: number;
|
|
70
|
+
/** Rendered annotation label content and plugin options. */
|
|
71
|
+
label?: {
|
|
72
|
+
/** Text content of the generated label. */
|
|
73
|
+
content?: string;
|
|
74
|
+
/** Visual placement of this element. */
|
|
75
|
+
position?: string;
|
|
76
|
+
/** Whether this feature is active. */
|
|
77
|
+
enabled?: boolean;
|
|
78
|
+
/** Horizontal adjustment of the annotation label in pixels. */
|
|
79
|
+
xAdjust?: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** A pair of X/Y coordinates passed to annotation drag callbacks. */
|
|
84
|
+
export interface ICoordinates {
|
|
85
|
+
/** X coordinate in scale units. */
|
|
86
|
+
x: number;
|
|
87
|
+
/** Y coordinate in scale units. */
|
|
88
|
+
y: number;
|
|
89
|
+
}
|
|
90
|
+
/** Appearance, geometry and drag callbacks for a callout label. */
|
|
91
|
+
export interface ICalloutLabelConfig {
|
|
92
|
+
/** Whether this feature is active. */
|
|
93
|
+
enabled?: boolean;
|
|
94
|
+
/** Canvas/CSS colour used by this element. */
|
|
95
|
+
color?: string;
|
|
96
|
+
/** Canvas font specification used for the text. */
|
|
97
|
+
font?: string;
|
|
98
|
+
/** Canvas colour used for the element outline. */
|
|
99
|
+
borderColor?: string;
|
|
100
|
+
/** Canvas stroke colour used by the connector. */
|
|
101
|
+
strokeStyle?: string;
|
|
102
|
+
/** Stroke width in canvas pixels. */
|
|
103
|
+
lineWidth?: number;
|
|
104
|
+
/** Connector clearance from the source element, in canvas pixels. */
|
|
105
|
+
startOffset?: number;
|
|
106
|
+
/** Connector clearance from the label end, in canvas pixels. */
|
|
107
|
+
endOffset?: number;
|
|
108
|
+
/** Callout label margin in pixels. */
|
|
109
|
+
margin?: number;
|
|
110
|
+
/** X coordinate in scale units. */
|
|
111
|
+
xValue?: number;
|
|
112
|
+
/** Y coordinate in scale units. */
|
|
113
|
+
yValue?: number;
|
|
114
|
+
/** Horizontal adjustment of the annotation label in pixels. */
|
|
115
|
+
xAdjust?: number;
|
|
116
|
+
/** Vertical adjustment of the annotation label in pixels. */
|
|
117
|
+
yAdjust?: number;
|
|
118
|
+
/** Called when a drag starts. */
|
|
119
|
+
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
120
|
+
/** Called as the dragged value or annotation position changes. */
|
|
121
|
+
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
122
|
+
/** Called when dragging ends. */
|
|
123
|
+
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
124
|
+
}
|
|
125
|
+
/** Annotation label options, including additional plugin-specific fields. */
|
|
126
|
+
export interface IAnnotationLabelConfig {
|
|
127
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
128
|
+
backgroundColor?: string;
|
|
129
|
+
/** Whether this element is visible. */
|
|
130
|
+
display?: boolean;
|
|
131
|
+
/** Visual placement of this element. */
|
|
132
|
+
position?: string;
|
|
133
|
+
/** Canvas/CSS colour used by this element. */
|
|
134
|
+
color?: string;
|
|
135
|
+
/** Canvas font specification used for the text. */
|
|
136
|
+
font?: string;
|
|
137
|
+
/** Canvas colour used for the element outline. */
|
|
138
|
+
borderColor?: string;
|
|
139
|
+
/** Additional connector settings for an annotation label. */
|
|
140
|
+
callout?: Record<string, unknown>;
|
|
141
|
+
[key: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Geometry and interaction settings for one annotation.
|
|
145
|
+
* Coordinate values use the referenced scales; pixel offsets are named separately.
|
|
146
|
+
*/
|
|
147
|
+
export interface ICommonAnnotationsData {
|
|
148
|
+
/** Whether this element is visible. */
|
|
149
|
+
display?: boolean;
|
|
150
|
+
/** Excludes this entry from the legend where supported. */
|
|
151
|
+
hideLegend?: boolean;
|
|
152
|
+
/** Pixel offset between the label and its associated geometry. */
|
|
153
|
+
labelOffsetPx?: number;
|
|
154
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
155
|
+
id?: string;
|
|
156
|
+
/** Whether this annotation may expand the scale bounds to remain visible. */
|
|
157
|
+
adjustScaleRange?: boolean;
|
|
158
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
159
|
+
annotationAxis?: 'x' | 'y';
|
|
160
|
+
/** Annotation rotation in degrees. */
|
|
161
|
+
rotation?: number;
|
|
162
|
+
/** Canvas/CSS colour used by this element. */
|
|
163
|
+
color?: string;
|
|
164
|
+
/** End coordinate of a ranged annotation on `annotationAxis`. */
|
|
165
|
+
endValue?: number;
|
|
166
|
+
/** Outline width in canvas pixels. */
|
|
167
|
+
borderWidth?: number;
|
|
168
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
169
|
+
backgroundColor?: string;
|
|
170
|
+
/** Display text associated with this element. */
|
|
171
|
+
label?: string;
|
|
172
|
+
/** Appearance and placement of the annotation label. */
|
|
173
|
+
labelConfig?: IAnnotationLabelConfig;
|
|
174
|
+
/** Chart or annotation kind. */
|
|
175
|
+
type?: DraggableAnnotationType;
|
|
176
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
177
|
+
value?: number;
|
|
178
|
+
/** Lower X bound in scale units. */
|
|
179
|
+
xMin?: number;
|
|
180
|
+
/** Upper X bound in scale units. */
|
|
181
|
+
xMax?: number;
|
|
182
|
+
/** Lower Y bound in scale units. */
|
|
183
|
+
yMin?: number;
|
|
184
|
+
/** Upper Y bound in scale units. */
|
|
185
|
+
yMax?: number;
|
|
186
|
+
/** X coordinate in scale units. */
|
|
187
|
+
xValue?: number;
|
|
188
|
+
/** Y coordinate in scale units. */
|
|
189
|
+
yValue?: number;
|
|
190
|
+
/** Annotation point or circle radius in pixels. */
|
|
191
|
+
radius?: number;
|
|
192
|
+
/** Allows this annotation to be dragged when annotation dragging is enabled. */
|
|
193
|
+
enableDrag?: boolean;
|
|
194
|
+
/** Called when a drag starts. */
|
|
195
|
+
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
196
|
+
/** Called as the dragged value or annotation position changes. */
|
|
197
|
+
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
198
|
+
/** Called when dragging ends. */
|
|
199
|
+
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
200
|
+
/** Restricts annotation movement to X, Y, or both axes. */
|
|
201
|
+
dragAxis?: DragAxis;
|
|
202
|
+
/** Point marker shape. */
|
|
203
|
+
pointStyle?: string;
|
|
204
|
+
/** Allows interactive resizing of supported annotations. */
|
|
205
|
+
resizable?: boolean;
|
|
206
|
+
/** Inclusive dragging limits in axis units, expressed as [minimum, maximum]. */
|
|
207
|
+
dragRange?: {
|
|
208
|
+
/** Inclusive X dragging bounds [minimum, maximum], in scale units. */
|
|
209
|
+
x?: [number, number];
|
|
210
|
+
/** Inclusive Y dragging bounds [minimum, maximum], in scale units. */
|
|
211
|
+
y?: [number, number];
|
|
212
|
+
};
|
|
213
|
+
/** Displays coordinates while dragging an annotation. */
|
|
214
|
+
displayDragCoordinates?: boolean;
|
|
215
|
+
/** Horizontal Chart.js scale ID used to resolve annotation coordinates. */
|
|
216
|
+
xScaleID?: string;
|
|
217
|
+
/** Vertical Chart.js scale ID used to resolve annotation coordinates. */
|
|
218
|
+
yScaleID?: string;
|
|
219
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
220
|
+
opacity?: number;
|
|
221
|
+
}
|
|
222
|
+
/** One colour stop in a canvas gradient. */
|
|
223
|
+
export interface ICommonGradientColor {
|
|
224
|
+
/** Gradient stop position between 0 and 1. */
|
|
225
|
+
offset: number;
|
|
226
|
+
/** Canvas/CSS colour used by this element. */
|
|
227
|
+
color: string;
|
|
228
|
+
}
|
|
229
|
+
/** Background gradient settings used by ScatterChart. */
|
|
230
|
+
export interface ICommonGradient {
|
|
231
|
+
/** Whether this element is visible. */
|
|
232
|
+
display: boolean;
|
|
233
|
+
/** Ordered colour stops for the background gradient. */
|
|
234
|
+
gradientColors?: ICommonGradientColor[];
|
|
235
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
236
|
+
direction?: GradientDirection;
|
|
237
|
+
}
|
|
238
|
+
/** Shared chart container and canvas layout settings. */
|
|
239
|
+
export interface ICommonStyling {
|
|
240
|
+
/** Chart width as a number or CSS size string. */
|
|
241
|
+
width?: number | string;
|
|
242
|
+
/** Chart height as a number or CSS size string. */
|
|
243
|
+
height?: number | string;
|
|
244
|
+
/** Preserves the canvas aspect ratio while resizing. */
|
|
245
|
+
maintainAspectRatio?: boolean;
|
|
246
|
+
/** Uses the fixed-height layout instead of stretching to the container. */
|
|
247
|
+
staticChartHeight?: boolean;
|
|
248
|
+
/** Disables chart animation when true. Defaults to true. */
|
|
249
|
+
performanceMode?: boolean;
|
|
250
|
+
/** Background gradient configuration; consumed by ScatterChart. */
|
|
251
|
+
gradient?: ICommonGradient;
|
|
252
|
+
}
|
|
253
|
+
/** Common legend visibility and placement settings. */
|
|
254
|
+
export interface ICommonLegend {
|
|
255
|
+
/** Whether this element is visible. */
|
|
256
|
+
display: boolean;
|
|
257
|
+
/** Visual placement of this element. */
|
|
258
|
+
position?: Position;
|
|
259
|
+
/** Alignment within the available layout space. */
|
|
260
|
+
align?: AlignOptions;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Tooltip callback overrides consumed by LineChart.
|
|
264
|
+
* BarChart, PieChart and ScatterChart currently use their own tooltip formatters.
|
|
265
|
+
*/
|
|
266
|
+
export interface ICommonTooltipCallbacks {
|
|
267
|
+
/** Replaces the tooltip title callback. LineChart passes the hovered tooltip items. */
|
|
268
|
+
title?: (...args: unknown[]) => unknown;
|
|
269
|
+
/** Replaces the DS-row callback. LineChart passes one tooltip item. */
|
|
270
|
+
label?: (...args: unknown[]) => unknown;
|
|
271
|
+
/** Appends content below the DS value. LineChart uses this instead of its built-in after-label callback. */
|
|
272
|
+
afterLabel?: (...args: unknown[]) => unknown;
|
|
273
|
+
}
|
|
274
|
+
/** Shared tooltip settings; individual chart components determine supported callbacks. */
|
|
275
|
+
export interface ICommonTooltip {
|
|
276
|
+
/** Enables hover tooltips. Defaults to true. */
|
|
277
|
+
tooltips?: boolean;
|
|
278
|
+
/** Includes the optional point label in supported tooltips. Defaults to false. */
|
|
279
|
+
showLabelsInTooltips?: boolean;
|
|
280
|
+
/** Allows scientific notation when formatting tooltip numbers. Defaults to true. */
|
|
281
|
+
scientificNotation?: boolean;
|
|
282
|
+
/** Custom tooltip callbacks. LineChart preserves title, label and afterLabel overrides independently. */
|
|
283
|
+
callbacks?: ICommonTooltipCallbacks;
|
|
284
|
+
}
|
|
285
|
+
/** Shared Cartesian scale behaviour and range settings. */
|
|
286
|
+
export interface ICommonAdditionalAxesOptions {
|
|
287
|
+
/** Scale family used when constructing axes. */
|
|
288
|
+
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
289
|
+
/** Reverses the relevant scale or marker direction. */
|
|
290
|
+
reverse?: boolean;
|
|
291
|
+
/** Includes zero when determining automatic scale bounds. */
|
|
292
|
+
beginAtZero?: boolean;
|
|
293
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
294
|
+
stepSize?: number;
|
|
295
|
+
/** Enables stacked rendering where supported. */
|
|
296
|
+
stacked?: boolean;
|
|
297
|
+
/** Suggested lower scale bound; data may extend beyond it. */
|
|
298
|
+
suggestedMin?: number;
|
|
299
|
+
/** Suggested upper scale bound; data may extend beyond it. */
|
|
300
|
+
suggestedMax?: number;
|
|
301
|
+
/** Explicit lower bound in scale units. */
|
|
302
|
+
min?: number | string;
|
|
303
|
+
/** Explicit upper bound in scale units. */
|
|
304
|
+
max?: number | string;
|
|
305
|
+
}
|
|
306
|
+
/** A text overlay placed inside the chart area. */
|
|
307
|
+
export interface ICommonAnnotation {
|
|
308
|
+
/** Shows the chart-area text overlay. */
|
|
309
|
+
showLabel?: boolean;
|
|
310
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
311
|
+
text?: string | string[];
|
|
312
|
+
/** Visual placement of this element. */
|
|
313
|
+
position?: string;
|
|
314
|
+
/** Text size in pixels. */
|
|
315
|
+
fontSize?: number;
|
|
316
|
+
/** Horizontal offset of the text overlay in pixels. */
|
|
317
|
+
xOffset?: number;
|
|
318
|
+
/** Vertical offset of the text overlay in pixels. */
|
|
319
|
+
yOffset?: number;
|
|
320
|
+
/** Maximum width available for the text overlay, in pixels. */
|
|
321
|
+
maxWidth?: number;
|
|
322
|
+
/** Text line spacing in pixels. */
|
|
323
|
+
lineHeight?: number;
|
|
324
|
+
}
|
|
325
|
+
/** Annotation collection and associated controls. */
|
|
326
|
+
export interface ICommonAnnotations {
|
|
327
|
+
/** Whether configured annotations are rendered. */
|
|
328
|
+
showAnnotations?: boolean;
|
|
329
|
+
/** Enables annotation controls where supported by the chart. */
|
|
330
|
+
controlAnnotation?: boolean;
|
|
331
|
+
/** Enables annotation dragging in the corresponding controls. */
|
|
332
|
+
enableDragAnnotation?: boolean;
|
|
333
|
+
/** Enables callout annotation controls in LineChart. */
|
|
334
|
+
enableCalloutAnnotation?: boolean;
|
|
335
|
+
/** Line-marker plugin configuration. */
|
|
336
|
+
lineMarkersAnnotation?: ILineMarkersAnnotation;
|
|
337
|
+
/** Annotation definitions in drawing order. */
|
|
338
|
+
annotationsData?: ICommonAnnotationsData[];
|
|
339
|
+
/** Text overlay drawn inside the chart area. */
|
|
340
|
+
labelAnnotation?: ICommonAnnotation;
|
|
341
|
+
}
|
|
342
|
+
/** Shared line geometry, grid and data-label settings. */
|
|
343
|
+
export interface ICommonGraph {
|
|
344
|
+
/** Line interpolation tension; zero produces straight segments. */
|
|
345
|
+
lineTension?: number;
|
|
346
|
+
/** Connects line segments across missing values. */
|
|
347
|
+
spanGaps?: boolean;
|
|
348
|
+
/** Draws labels on data elements. */
|
|
349
|
+
showDataLabels?: boolean;
|
|
350
|
+
/** Draws intermediate grid lines between the main ticks. */
|
|
351
|
+
showMinorGridlines?: boolean;
|
|
352
|
+
}
|
|
353
|
+
/** Chart interaction callbacks. Generated DS indices may include annotation entries. */
|
|
354
|
+
export interface ICommonInteractions {
|
|
355
|
+
/** Receives the clicked legend text and its hidden state. */
|
|
356
|
+
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
357
|
+
/** Receives the chart event, DS index, point index and generated DS collection on hover. */
|
|
358
|
+
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: any[]) => void;
|
|
359
|
+
/** Called when the pointer leaves the hovered chart element. */
|
|
360
|
+
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
|
|
361
|
+
}
|
|
362
|
+
/** A Chart.js legend plugin paired with an external DOM container. */
|
|
363
|
+
export interface ICommonCustomLegend<T extends keyof ChartTypeRegistry> {
|
|
364
|
+
/** Chart.js plugin implementing the custom legend; null selects no custom plugin. */
|
|
365
|
+
customLegendPlugin: Plugin<T> | null;
|
|
366
|
+
/** ID of the DOM element used by the custom legend plugin. */
|
|
367
|
+
customLegendContainerID: string;
|
|
368
|
+
}
|
|
369
|
+
/** Shared zoom and pan controls; defaults differ between chart components. */
|
|
370
|
+
export interface ICommonChartOptions {
|
|
371
|
+
/** Enables zooming when supported by the chart. */
|
|
372
|
+
enableZoom?: boolean;
|
|
373
|
+
/** Enables panning when supported by the chart. */
|
|
374
|
+
enablePan?: boolean;
|
|
375
|
+
}
|
|
376
|
+
/** Data-point dragging configuration passed to the drag-data plugin. */
|
|
377
|
+
export interface ICommonDragData {
|
|
378
|
+
/** Enables dragging data points. Defaults to false. */
|
|
379
|
+
enableDragData?: boolean;
|
|
380
|
+
/** Displays the drag tooltip while moving a data point. */
|
|
381
|
+
showTooltip?: boolean;
|
|
382
|
+
/** Rounds values during point dragging. */
|
|
383
|
+
roundPoints?: boolean;
|
|
384
|
+
/** Allows point dragging along the X axis. */
|
|
385
|
+
dragX?: boolean;
|
|
386
|
+
/** Allows point dragging along the Y axis. */
|
|
387
|
+
dragY?: boolean;
|
|
388
|
+
/** Called when a drag starts. */
|
|
389
|
+
onDragStart?: (event: unknown, element: unknown) => unknown;
|
|
390
|
+
/** Called as the dragged value or annotation position changes. */
|
|
391
|
+
onDrag?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
392
|
+
/** Called when dragging ends. */
|
|
393
|
+
onDragEnd?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Common chart options extended by each chart component.
|
|
397
|
+
* A field's presence in this shared type does not imply support in every chart.
|
|
398
|
+
*/
|
|
399
|
+
export interface ICommonOptions {
|
|
400
|
+
/** Chart title; an array represents multiple lines. */
|
|
401
|
+
title?: string | string[];
|
|
402
|
+
/** Chart sizing and visual layout settings. */
|
|
403
|
+
chartStyling?: ICommonStyling;
|
|
404
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
405
|
+
tooltip?: ICommonTooltip;
|
|
406
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
407
|
+
legend?: ICommonLegend;
|
|
408
|
+
/** Initial interaction and rendering controls. */
|
|
409
|
+
chartOptions?: ICommonChartOptions;
|
|
410
|
+
/** Callbacks for legend and pointer interactions. */
|
|
411
|
+
interactions?: ICommonInteractions;
|
|
412
|
+
/** Point-dragging options and lifecycle callbacks. */
|
|
413
|
+
dragData?: ICommonDragData;
|
|
414
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
415
|
+
annotations?: ICommonAnnotations;
|
|
416
|
+
/** Plugin configuration accepted by this options shape; forwarding is chart-specific. */
|
|
417
|
+
plugins?: {
|
|
418
|
+
/** Line-marker plugin enablement settings. */
|
|
419
|
+
lineMarkersPlugin?: {
|
|
420
|
+
/** Whether this feature is active. */
|
|
421
|
+
enabled?: boolean;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
/** Base chart input extended by component-specific data models. */
|
|
426
|
+
export interface ICommonData {
|
|
427
|
+
/** Test identifier applied to the rendered chart container. */
|
|
428
|
+
testId?: string;
|
|
429
|
+
/** Values rendered by the chart or DS. */
|
|
430
|
+
data?: {
|
|
431
|
+
/** Labels associated with the input data. */
|
|
432
|
+
labels?: string[];
|
|
433
|
+
/** DS definitions in rendering order. */
|
|
434
|
+
datasets?: ICommonDataset[];
|
|
435
|
+
};
|
|
436
|
+
/** Configuration for this chart or generated element. */
|
|
437
|
+
options: ICommonOptions;
|
|
438
|
+
}
|
|
439
|
+
/** Indices identifying the currently hovered DS and point. */
|
|
440
|
+
export interface ICommonHoveredItems {
|
|
441
|
+
/** Zero-based index of the data item. */
|
|
442
|
+
index: number;
|
|
443
|
+
/** Zero-based index of the DS in the chart data. */
|
|
444
|
+
datasetIndex: number;
|
|
445
|
+
}
|
|
446
|
+
/** Shared legend and title plugin option shapes. */
|
|
447
|
+
export interface ICommonChartPlugins {
|
|
448
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
449
|
+
legend: {
|
|
450
|
+
/** Visual placement of this element. */
|
|
451
|
+
position: TAxisPosition;
|
|
452
|
+
};
|
|
453
|
+
/** Chart title; an array represents multiple lines. */
|
|
454
|
+
title: {
|
|
455
|
+
/** Whether this element is visible. */
|
|
456
|
+
display: boolean;
|
|
457
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
458
|
+
text: string;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
/** Shared Cartesian axis label, placement and tick settings. */
|
|
462
|
+
export interface ICommonAxis<PositionType = string> {
|
|
463
|
+
/** Display text associated with this element. */
|
|
464
|
+
label?: string;
|
|
465
|
+
/** Visual placement of this element. */
|
|
466
|
+
position?: PositionType;
|
|
467
|
+
/** Canvas/CSS colour used by this element. */
|
|
468
|
+
color?: string | string[];
|
|
469
|
+
/** Unit identifier used by the axis. */
|
|
470
|
+
unit?: string;
|
|
471
|
+
/** Grid-line configuration for this axis. */
|
|
472
|
+
gridLines?: boolean;
|
|
473
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
474
|
+
stepSize?: number;
|
|
475
|
+
}
|
|
476
|
+
/** Legend label produced by chart dataset generation. */
|
|
477
|
+
export interface IChartGeneratedLabel {
|
|
478
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
479
|
+
text: string;
|
|
480
|
+
/** Canvas fill style used by the generated legend label. */
|
|
481
|
+
fillStyle: string;
|
|
482
|
+
/** Canvas stroke colour used by the connector. */
|
|
483
|
+
strokeStyle: string;
|
|
484
|
+
/** Zero-based index of the data item. */
|
|
485
|
+
index: number;
|
|
486
|
+
}
|
|
487
|
+
/** DS visibility metadata passed to legend filtering helpers. */
|
|
488
|
+
export interface IChartLegendItemFilter {
|
|
489
|
+
/** Zero-based index of the data item. */
|
|
490
|
+
index: number;
|
|
491
|
+
/** Zero-based index of the DS in the chart data. */
|
|
492
|
+
datasetIndex: number;
|
|
493
|
+
/** Initial visibility flag for the DS. */
|
|
494
|
+
hidden: boolean;
|
|
495
|
+
}
|
|
496
|
+
/** Data-label plugin display and formatting options. */
|
|
497
|
+
export interface IChartDataLabelsOptions {
|
|
498
|
+
/** Whether this element is visible. */
|
|
499
|
+
display?: 'auto' | boolean;
|
|
500
|
+
/** Alignment within the available layout space. */
|
|
501
|
+
align?: 'center';
|
|
502
|
+
/** Anchor used to place the data label relative to its element. */
|
|
503
|
+
anchor?: 'center';
|
|
504
|
+
/** Formats the displayed data label from the value and plugin context. */
|
|
505
|
+
formatter?: (_value: unknown, context: unknown) => unknown;
|
|
506
|
+
}
|
|
507
|
+
/** Placeholder for a callback parameter whose runtime value is intentionally unspecified. */
|
|
508
|
+
export type UnusedParameter = unknown;
|
|
509
|
+
/** Primitive configuration values excluding undefined. */
|
|
510
|
+
export type TPrimitive = string | number | boolean | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
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.Element;
|
|
7
|
+
export default ControlsPortal;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** Cartesian axis identifiers. */
|
|
2
|
+
export declare enum AxisType {
|
|
3
|
+
X = "x",
|
|
4
|
+
Y = "y"
|
|
5
|
+
}
|
|
6
|
+
/** Legend/layout positions. Individual options accept only the positions relevant to their layout. */
|
|
7
|
+
export declare enum Position {
|
|
8
|
+
Bottom = "bottom",
|
|
9
|
+
Top = "top",
|
|
10
|
+
Left = "left",
|
|
11
|
+
Right = "right",
|
|
12
|
+
TopRight = "top-right",
|
|
13
|
+
TopLeft = "top-left",
|
|
14
|
+
BottomLeft = "bottom-left",
|
|
15
|
+
BottomRight = "bottom-right"
|
|
16
|
+
}
|
|
17
|
+
/** Chart.js chart-kind identifiers used by the library. */
|
|
18
|
+
export declare enum ChartType {
|
|
19
|
+
LINE = "line",
|
|
20
|
+
BAR = "bar",
|
|
21
|
+
PIE = "pie",
|
|
22
|
+
DOUGHNUT = "doughnut",
|
|
23
|
+
SCATTER = "scatter"
|
|
24
|
+
}
|
|
25
|
+
/** CSS cursors used during chart interactions. */
|
|
26
|
+
export declare enum CursorStyle {
|
|
27
|
+
Pointer = "pointer",
|
|
28
|
+
Initial = "initial",
|
|
29
|
+
Grab = "grab",
|
|
30
|
+
Grabbing = "grabbing",
|
|
31
|
+
Crosshair = "crosshair",
|
|
32
|
+
Move = "move"
|
|
33
|
+
}
|
|
34
|
+
/** Chart.js scale-family identifiers. */
|
|
35
|
+
export declare enum ScaleType {
|
|
36
|
+
Category = "category",
|
|
37
|
+
Linear = "linear",
|
|
38
|
+
Logarithmic = "logarithmic",
|
|
39
|
+
Time = "time",
|
|
40
|
+
TimeSeries = "timeseries"
|
|
41
|
+
}
|
|
42
|
+
/** Cartesian rendering orientation; this does not select LineChart tooltip content. */
|
|
43
|
+
export declare enum ChartDirection {
|
|
44
|
+
VERTICAL = "vertical",
|
|
45
|
+
HORIZONTAL = "horizontal"
|
|
46
|
+
}
|
|
47
|
+
/** Legacy tooltip label keys. */
|
|
48
|
+
export declare enum TooltipLabel {
|
|
49
|
+
Y = "yLabel",
|
|
50
|
+
X = "xLabel"
|
|
51
|
+
}
|
|
52
|
+
/** Alignment identifiers used by chart layout and legend options. */
|
|
53
|
+
export declare enum AlignOptions {
|
|
54
|
+
End = "end",
|
|
55
|
+
Start = "start",
|
|
56
|
+
Center = "center",
|
|
57
|
+
Right = "right",
|
|
58
|
+
Left = "left"
|
|
59
|
+
}
|
|
60
|
+
/** Legacy point classification identifiers. */
|
|
61
|
+
export declare enum PointType {
|
|
62
|
+
Casing = "casing"
|
|
63
|
+
}
|
|
64
|
+
/** Annotation shape identifiers. */
|
|
65
|
+
export declare enum AnnotationType {
|
|
66
|
+
Box = "box",
|
|
67
|
+
Ellipse = "ellipse",
|
|
68
|
+
Line = "line",
|
|
69
|
+
Text = "text",
|
|
70
|
+
Label = "label"
|
|
71
|
+
}
|
|
72
|
+
/** Point marker shapes compatible with Chart.js. */
|
|
73
|
+
export declare enum PointStyle {
|
|
74
|
+
Circle = "circle",
|
|
75
|
+
Square = "rect",
|
|
76
|
+
Diamond = "rectRot",
|
|
77
|
+
Triangle = "triangle"
|
|
78
|
+
}
|
|
79
|
+
/** Hover interaction modes used by the library. */
|
|
80
|
+
export declare enum ChartHoverMode {
|
|
81
|
+
Nearest = "nearest"
|
|
82
|
+
}
|
|
83
|
+
/** Interaction mode identifiers; availability depends on the chart controls. */
|
|
84
|
+
export declare enum PanZoomMode {
|
|
85
|
+
X = "x",
|
|
86
|
+
Y = "y",
|
|
87
|
+
XY = "xy",
|
|
88
|
+
Z = "z"
|
|
89
|
+
}
|
|
90
|
+
/** Keyboard modifier identifiers used by chart interactions. */
|
|
91
|
+
export declare enum Key {
|
|
92
|
+
Shift = "Shift"
|
|
93
|
+
}
|
|
94
|
+
/** DOM event names used by chart interaction handlers. */
|
|
95
|
+
export declare enum Events {
|
|
96
|
+
Mousemove = "mousemove",
|
|
97
|
+
Mouseout = "mouseout",
|
|
98
|
+
Click = "click",
|
|
99
|
+
Touchstart = "touchstart",
|
|
100
|
+
Touchmove = "touchmove",
|
|
101
|
+
Dblclick = "dblclick"
|
|
102
|
+
}
|
|
103
|
+
export { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums';
|
|
104
|
+
export { GradientDirection } from './plugins/gradient-background-plugin/enums';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addTransparency(input: string, alpha: number, out?: 'rgb' | 'hex'): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ICommonAnnotationsData } from '../../common.interface.js';
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {};
|