@oliasoft-open-source/charts-library 7.0.0 → 7.0.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/README.md +415 -0
- package/dist/index.d.ts +982 -13
- package/dist/index.js +194 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Plugin as Plugin_2 } from 'chart.js';
|
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
9
|
import { ScaleOptions } from 'chart.js';
|
|
10
10
|
|
|
11
|
+
/** Alignment identifiers used by chart layout and legend options. */
|
|
11
12
|
export declare enum AlignOptions {
|
|
12
13
|
End = "end",
|
|
13
14
|
Start = "start",
|
|
@@ -16,6 +17,7 @@ export declare enum AlignOptions {
|
|
|
16
17
|
Left = "left"
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
/** Annotation shape identifiers. */
|
|
19
21
|
export declare enum AnnotationType {
|
|
20
22
|
Box = "box",
|
|
21
23
|
Ellipse = "ellipse",
|
|
@@ -24,22 +26,65 @@ export declare enum AnnotationType {
|
|
|
24
26
|
Label = "label"
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
/** Cartesian axis identifiers. */
|
|
27
30
|
export declare enum AxisType {
|
|
28
31
|
X = "x",
|
|
29
32
|
Y = "y"
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Renders vertical or horizontal bars with optional stacking, annotations and a legend.
|
|
37
|
+
*
|
|
38
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Defaults: vertical bars, a top-left legend, zero included in automatic scale bounds, and annotations enabled.
|
|
43
|
+
* Zoom, pan, stacking and data labels are disabled. No fixed width or height is assigned.
|
|
44
|
+
* Performance mode is enabled by default, disabling animations.
|
|
45
|
+
* The linked reference lists the complete normalized default configuration.
|
|
46
|
+
*
|
|
47
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#barchart
|
|
48
|
+
*
|
|
49
|
+
* @param props - Chart data and options.
|
|
50
|
+
* @returns The chart canvas and its associated UI.
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <BarChart chart={{
|
|
54
|
+
* data: {
|
|
55
|
+
* labels: ['A', 'B', 'C'],
|
|
56
|
+
* datasets: [{
|
|
57
|
+
* label: 'DS A',
|
|
58
|
+
* data: [{ x: 'A', y: 10 }, { x: 'B', y: 20 }, { x: 'C', y: 15 }],
|
|
59
|
+
* }],
|
|
60
|
+
* },
|
|
61
|
+
* options: {
|
|
62
|
+
* direction: 'vertical',
|
|
63
|
+
* axes: {
|
|
64
|
+
* x: [{ label: 'Category', position: 'bottom' }],
|
|
65
|
+
* y: [{ label: 'Value', position: 'left' }],
|
|
66
|
+
* },
|
|
67
|
+
* chartStyling: { height: 320 },
|
|
68
|
+
* legend: { display: true, position: 'top-left' },
|
|
69
|
+
* graph: { showDataLabels: false },
|
|
70
|
+
* },
|
|
71
|
+
* }} />
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
32
74
|
export declare const BarChart: (props: IBarChartProps) => JSX.Element;
|
|
33
75
|
|
|
76
|
+
/** Cartesian rendering orientation; this does not select LineChart tooltip content. */
|
|
34
77
|
export declare enum ChartDirection {
|
|
35
78
|
VERTICAL = "vertical",
|
|
36
79
|
HORIZONTAL = "horizontal"
|
|
37
80
|
}
|
|
38
81
|
|
|
82
|
+
/** Hover interaction modes used by the library. */
|
|
39
83
|
export declare enum ChartHoverMode {
|
|
40
84
|
Nearest = "nearest"
|
|
41
85
|
}
|
|
42
86
|
|
|
87
|
+
/** Chart.js chart-kind identifiers used by the library. */
|
|
43
88
|
export declare enum ChartType {
|
|
44
89
|
LINE = "line",
|
|
45
90
|
BAR = "bar",
|
|
@@ -48,8 +93,10 @@ export declare enum ChartType {
|
|
|
48
93
|
SCATTER = "scatter"
|
|
49
94
|
}
|
|
50
95
|
|
|
96
|
+
/** Default categorical DS colour palette. Treat the exported array as read-only. */
|
|
51
97
|
export declare const COLORS: string[];
|
|
52
98
|
|
|
99
|
+
/** CSS cursors used during chart interactions. */
|
|
53
100
|
export declare enum CursorStyle {
|
|
54
101
|
Pointer = "pointer",
|
|
55
102
|
Initial = "initial",
|
|
@@ -59,16 +106,19 @@ export declare enum CursorStyle {
|
|
|
59
106
|
Move = "move"
|
|
60
107
|
}
|
|
61
108
|
|
|
109
|
+
/** Recursively makes object properties optional while preserving callable types and array element shapes. */
|
|
62
110
|
export declare type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
63
111
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
64
112
|
} : T;
|
|
65
113
|
|
|
114
|
+
/** Allowed axes for annotation dragging. */
|
|
66
115
|
export declare enum DragAxis {
|
|
67
116
|
X = "x",
|
|
68
117
|
Y = "y",
|
|
69
118
|
Both = "both"
|
|
70
119
|
}
|
|
71
120
|
|
|
121
|
+
/** Annotation shape identifiers. */
|
|
72
122
|
export declare enum DraggableAnnotationType {
|
|
73
123
|
POINT = "point",
|
|
74
124
|
BOX = "box",
|
|
@@ -77,6 +127,7 @@ export declare enum DraggableAnnotationType {
|
|
|
77
127
|
LABEL = "label"
|
|
78
128
|
}
|
|
79
129
|
|
|
130
|
+
/** DOM event names used by chart interaction handlers. */
|
|
80
131
|
export declare enum Events {
|
|
81
132
|
Mousemove = "mousemove",
|
|
82
133
|
Mouseout = "mouseout",
|
|
@@ -86,8 +137,20 @@ export declare enum Events {
|
|
|
86
137
|
Dblclick = "dblclick"
|
|
87
138
|
}
|
|
88
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Builds a darkest-first palette by varying LCH lightness while retaining the starting hue and chroma.
|
|
142
|
+
*
|
|
143
|
+
* @param length - Requested number of colours. Use a non-negative integer; zero returns an empty array.
|
|
144
|
+
* @param startingColor - Colour understood by colord. A length of one returns this string unchanged.
|
|
145
|
+
* @returns CSS LCH colour strings, except for the unchanged single-colour case.
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* const colors = getGroupedColorScheme(3, '#3366cc');
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
89
151
|
export declare const getGroupedColorScheme: (length: number, startingColor: string) => string[];
|
|
90
152
|
|
|
153
|
+
/** Direction of the background gradient between chart-area edges or corners. */
|
|
91
154
|
export declare enum GradientDirection {
|
|
92
155
|
TopToBottom = 0,
|
|
93
156
|
BottomToTop = 1,
|
|
@@ -99,140 +162,237 @@ export declare enum GradientDirection {
|
|
|
99
162
|
TopRightToBottomLeft = 7
|
|
100
163
|
}
|
|
101
164
|
|
|
165
|
+
/** Annotation label options, including additional plugin-specific fields. */
|
|
102
166
|
export declare interface IAnnotationLabelConfig {
|
|
167
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
103
168
|
backgroundColor?: string;
|
|
169
|
+
/** Whether this element is visible. */
|
|
104
170
|
display?: boolean;
|
|
171
|
+
/** Visual placement of this element. */
|
|
105
172
|
position?: string;
|
|
173
|
+
/** Canvas/CSS colour used by this element. */
|
|
106
174
|
color?: string;
|
|
175
|
+
/** Canvas font specification used for the text. */
|
|
107
176
|
font?: string;
|
|
177
|
+
/** Canvas colour used for the element outline. */
|
|
108
178
|
borderColor?: string;
|
|
179
|
+
/** Additional connector settings for an annotation label. */
|
|
109
180
|
callout?: Record<string, unknown>;
|
|
110
181
|
[key: string]: unknown;
|
|
111
182
|
}
|
|
112
183
|
|
|
184
|
+
/** BarChart scale options with independent X/Y stacking controls. */
|
|
113
185
|
export declare interface IBarAdditionalAxesOptions extends ICommonAdditionalAxesOptions {
|
|
186
|
+
/** Enables stacking on the X scale. */
|
|
114
187
|
stackedX?: boolean;
|
|
188
|
+
/** Enables stacking on the Y scale. */
|
|
115
189
|
stackedY?: boolean;
|
|
116
190
|
}
|
|
117
191
|
|
|
192
|
+
/** Ordered horizontal and vertical BarChart axis collections. */
|
|
118
193
|
export declare interface IBarAxes {
|
|
194
|
+
/** Horizontal axis definitions in order. */
|
|
119
195
|
x: ICommonAxis<'top' | 'bottom'>[];
|
|
196
|
+
/** Vertical axis definitions in order. */
|
|
120
197
|
y: ICommonAxis<'left' | 'right'>[];
|
|
121
198
|
[key: string]: ICommonAxis[];
|
|
122
199
|
}
|
|
123
200
|
|
|
201
|
+
/** Bar labels and DS definitions. */
|
|
124
202
|
export declare interface IBarChartBaseData {
|
|
203
|
+
/** Labels associated with the input data. */
|
|
125
204
|
labels: string[];
|
|
205
|
+
/** DS definitions in rendering order. */
|
|
126
206
|
datasets: IBarChartDataset[];
|
|
127
207
|
}
|
|
128
208
|
|
|
209
|
+
/** Normalized BarChart data, options and controls container. */
|
|
129
210
|
export declare interface IBarChartData extends ICommonData {
|
|
211
|
+
/** Test identifier applied to the rendered chart container. */
|
|
130
212
|
testId?: string;
|
|
213
|
+
/** ID of an existing DOM element in which chart controls should be rendered. */
|
|
131
214
|
controlsPortalId?: string;
|
|
215
|
+
/** Values rendered by the chart or DS. */
|
|
132
216
|
data: IBarChartBaseData;
|
|
217
|
+
/** Configuration for this chart or generated element. */
|
|
133
218
|
options: IBarOptions;
|
|
134
219
|
}
|
|
135
220
|
|
|
221
|
+
/** Consumer-facing BarChart configuration with optional datasets and options. */
|
|
136
222
|
export declare interface IBarChartDataInput extends Omit<IBarChartData, 'options' | 'data'> {
|
|
223
|
+
/** Values rendered by the chart or DS. */
|
|
137
224
|
data?: Omit<DeepPartial<IBarChartData['data']>, 'datasets'> & {
|
|
225
|
+
/** DS definitions in rendering order. */
|
|
138
226
|
datasets?: Array<DeepPartial<IBarChartDataset> | object | null>;
|
|
139
227
|
};
|
|
228
|
+
/** Configuration for this chart or generated element. */
|
|
140
229
|
options?: IBarOptionsInput;
|
|
141
230
|
}
|
|
142
231
|
|
|
232
|
+
/** Input bar DS, including axis bindings and legend grouping. */
|
|
143
233
|
export declare interface IBarChartDataset extends ICommonDataset {
|
|
234
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
144
235
|
isAnnotation?: boolean;
|
|
236
|
+
/** Index of the source annotation in the annotation collection. */
|
|
145
237
|
annotationIndex?: number;
|
|
238
|
+
/** Controls whether a bar border edge is omitted. */
|
|
146
239
|
borderSkipped?: boolean;
|
|
240
|
+
/** Bar corner radius in pixels. */
|
|
147
241
|
borderRadius?: number;
|
|
242
|
+
/** Horizontal scale ID for this DS, such as `x` or `x2`. */
|
|
148
243
|
xAxisID?: string;
|
|
244
|
+
/** Vertical scale ID for this DS, such as `y` or `y2`. */
|
|
149
245
|
yAxisID?: string;
|
|
246
|
+
/** Initial visibility flag for the DS. */
|
|
150
247
|
hidden?: boolean;
|
|
248
|
+
/** Groups DS entries for legend display. */
|
|
151
249
|
displayGroup?: string | number;
|
|
250
|
+
/** Chart or annotation kind. */
|
|
152
251
|
type?: ChartType.BAR;
|
|
153
252
|
}
|
|
154
253
|
|
|
254
|
+
/** Props accepted by the BarChart React component. */
|
|
155
255
|
export declare interface IBarChartProps {
|
|
256
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
156
257
|
chart: IBarChartDataInput;
|
|
157
258
|
}
|
|
158
259
|
|
|
260
|
+
/** BarChart configuration after default values have been applied. */
|
|
159
261
|
export declare interface IBarDefaultProps {
|
|
262
|
+
/** Test identifier applied to the rendered chart container. */
|
|
160
263
|
testId: string;
|
|
264
|
+
/** ID of an existing DOM element in which chart controls should be rendered. */
|
|
161
265
|
controlsPortalId: string;
|
|
266
|
+
/** Values rendered by the chart or DS. */
|
|
162
267
|
data: IBarChartBaseData;
|
|
268
|
+
/** Configuration for this chart or generated element. */
|
|
163
269
|
options: {
|
|
270
|
+
/** Chart title; an array represents multiple lines. */
|
|
164
271
|
title?: string | string[];
|
|
272
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
165
273
|
direction: 'vertical' | 'horizontal';
|
|
274
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
166
275
|
axes: IBarAxes;
|
|
276
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
167
277
|
additionalAxesOptions: IBarAdditionalAxesOptions;
|
|
278
|
+
/** Chart sizing and visual layout settings. */
|
|
168
279
|
chartStyling: IBarStyling;
|
|
280
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
169
281
|
tooltip: ICommonTooltip;
|
|
282
|
+
/** Geometry, grid and data-label rendering options. */
|
|
170
283
|
graph: IChartGraph;
|
|
284
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
171
285
|
scales?: ICommonScales;
|
|
286
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
172
287
|
annotations: {
|
|
288
|
+
/** Whether configured annotations are rendered. */
|
|
173
289
|
showAnnotations: boolean;
|
|
290
|
+
/** Enables annotation controls where supported by the chart. */
|
|
174
291
|
controlAnnotation: boolean;
|
|
292
|
+
/** Annotation definitions in drawing order. */
|
|
175
293
|
annotationsData: ICommonAnnotationsData[];
|
|
176
294
|
};
|
|
295
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
177
296
|
legend: IBarLegend;
|
|
297
|
+
/** Initial interaction and rendering controls. */
|
|
178
298
|
chartOptions: ICommonChartOptions;
|
|
299
|
+
/** Callbacks for legend and pointer interactions. */
|
|
179
300
|
interactions: ICommonInteractions;
|
|
301
|
+
/** Point-dragging options and lifecycle callbacks. */
|
|
180
302
|
dragData: ICommonDragData;
|
|
181
303
|
};
|
|
182
304
|
}
|
|
183
305
|
|
|
306
|
+
/** BarChart legend options, including custom HTML legend integration. */
|
|
184
307
|
export declare interface IBarLegend extends ICommonLegend {
|
|
308
|
+
/** Custom legend plugin and its target DOM container. */
|
|
185
309
|
customLegend?: ICommonCustomLegend<any>;
|
|
186
310
|
}
|
|
187
311
|
|
|
312
|
+
/** Resolved BarChart options. Use {@link IBarOptionsInput} for partial consumer configuration. */
|
|
188
313
|
export declare interface IBarOptions extends ICommonOptions {
|
|
314
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
189
315
|
direction?: 'vertical' | 'horizontal';
|
|
316
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
190
317
|
axes: IBarAxes;
|
|
318
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
191
319
|
scales?: ICommonScales;
|
|
320
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
192
321
|
additionalAxesOptions?: IBarAdditionalAxesOptions;
|
|
322
|
+
/** Chart sizing and visual layout settings. */
|
|
193
323
|
chartStyling: IBarStyling;
|
|
324
|
+
/** Geometry, grid and data-label rendering options. */
|
|
194
325
|
graph?: ICommonGraph;
|
|
326
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
195
327
|
annotations?: ICommonAnnotations;
|
|
328
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
196
329
|
legend?: IBarLegend;
|
|
330
|
+
/** Point-dragging options and lifecycle callbacks. */
|
|
197
331
|
dragData?: ICommonDragData;
|
|
198
332
|
}
|
|
199
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Partial BarChart options accepted at the component boundary.
|
|
336
|
+
* Unknown fields are accepted for compatibility, not guaranteed to be forwarded.
|
|
337
|
+
*/
|
|
200
338
|
export declare type IBarOptionsInput = Omit<DeepPartial<IBarOptions>, 'title' | 'direction' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'annotations' | 'additionalAxesOptions' | 'scales'> & {
|
|
201
339
|
[key: string]: unknown;
|
|
340
|
+
/** Chart title; an array represents multiple lines. */
|
|
202
341
|
title?: unknown;
|
|
342
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
203
343
|
direction?: string;
|
|
344
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
204
345
|
axes?: {
|
|
346
|
+
/** Horizontal axis definitions in order. */
|
|
205
347
|
x?: ILooseBarAxis[];
|
|
348
|
+
/** Vertical axis definitions in order. */
|
|
206
349
|
y?: ILooseBarAxis[];
|
|
207
350
|
[key: string]: ILooseBarAxis[] | undefined;
|
|
208
351
|
};
|
|
352
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
209
353
|
legend?: Omit<DeepPartial<IBarLegend>, 'position' | 'align'> & {
|
|
354
|
+
/** Visual placement of this element; does not select LineChart tooltip axes. */
|
|
210
355
|
position?: string;
|
|
356
|
+
/** Alignment within the available layout space. */
|
|
211
357
|
align?: string;
|
|
212
358
|
[key: string]: unknown;
|
|
213
359
|
};
|
|
360
|
+
/** Chart sizing and visual layout settings. */
|
|
214
361
|
chartStyling?: DeepPartial<IBarStyling> & {
|
|
362
|
+
/** Compatibility input; not currently consumed by the chart option normalizers. */
|
|
215
363
|
hideControls?: boolean;
|
|
364
|
+
/** Compatibility input; not currently consumed by the chart option normalizers. */
|
|
216
365
|
minHeight?: number | string;
|
|
217
366
|
[key: string]: unknown;
|
|
218
367
|
};
|
|
368
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
219
369
|
additionalAxesOptions?: Omit<DeepPartial<IBarAdditionalAxesOptions>, 'chartScaleType'> & {
|
|
370
|
+
/** Scale family used when constructing axes. */
|
|
220
371
|
chartScaleType?: string;
|
|
221
372
|
[key: string]: unknown;
|
|
222
373
|
};
|
|
374
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
223
375
|
scales?: Record<string, unknown>;
|
|
376
|
+
/** Callbacks for legend and pointer interactions. */
|
|
224
377
|
interactions?: DeepPartial<ICommonInteractions> & {
|
|
378
|
+
/** Compatibility interaction input; configure zoom through `chartOptions.enableZoom`. */
|
|
225
379
|
enableZoom?: boolean;
|
|
380
|
+
/** Compatibility interaction input; configure pan through `chartOptions.enablePan`. */
|
|
226
381
|
enablePan?: boolean;
|
|
227
382
|
[key: string]: unknown;
|
|
228
383
|
};
|
|
384
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
229
385
|
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
386
|
+
/** Annotation definitions in drawing order. */
|
|
230
387
|
annotationsData?: ILooseBarAnnotation[];
|
|
231
388
|
}) | null;
|
|
232
389
|
};
|
|
233
390
|
|
|
391
|
+
/** BarChart canvas sizing and padding. */
|
|
234
392
|
export declare interface IBarStyling extends ICommonStyling {
|
|
393
|
+
/** Requests a square chart layout; LineChart also accepts a numeric layout value. */
|
|
235
394
|
squareAspectRatio?: boolean;
|
|
395
|
+
/** Padding around the chart area, globally or per side. */
|
|
236
396
|
layoutPadding?: string | number | {
|
|
237
397
|
top: number;
|
|
238
398
|
bottom: number;
|
|
@@ -241,36 +401,63 @@ export declare interface IBarStyling extends ICommonStyling {
|
|
|
241
401
|
};
|
|
242
402
|
}
|
|
243
403
|
|
|
404
|
+
/** Appearance, geometry and drag callbacks for a callout label. */
|
|
244
405
|
export declare interface ICalloutLabelConfig {
|
|
406
|
+
/** Whether this feature is active. */
|
|
245
407
|
enabled?: boolean;
|
|
408
|
+
/** Canvas/CSS colour used by this element. */
|
|
246
409
|
color?: string;
|
|
410
|
+
/** Canvas font specification used for the text. */
|
|
247
411
|
font?: string;
|
|
412
|
+
/** Canvas colour used for the element outline. */
|
|
248
413
|
borderColor?: string;
|
|
414
|
+
/** Canvas stroke colour used by the connector. */
|
|
249
415
|
strokeStyle?: string;
|
|
416
|
+
/** Stroke width in canvas pixels. */
|
|
250
417
|
lineWidth?: number;
|
|
418
|
+
/** Connector clearance from the source element, in canvas pixels. */
|
|
251
419
|
startOffset?: number;
|
|
420
|
+
/** Connector clearance from the label end, in canvas pixels. */
|
|
252
421
|
endOffset?: number;
|
|
422
|
+
/** Callout label margin in pixels. */
|
|
253
423
|
margin?: number;
|
|
424
|
+
/** X coordinate in scale units. */
|
|
254
425
|
xValue?: number;
|
|
426
|
+
/** Y coordinate in scale units. */
|
|
255
427
|
yValue?: number;
|
|
428
|
+
/** Horizontal adjustment of the annotation label in pixels. */
|
|
256
429
|
xAdjust?: number;
|
|
430
|
+
/** Vertical adjustment of the annotation label in pixels. */
|
|
257
431
|
yAdjust?: number;
|
|
432
|
+
/** Called when a drag starts. */
|
|
258
433
|
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
434
|
+
/** Called as the dragged value or annotation position changes. */
|
|
259
435
|
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
436
|
+
/** Called when dragging ends. */
|
|
260
437
|
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
261
438
|
}
|
|
262
439
|
|
|
440
|
+
/** Data-label plugin display and formatting options. */
|
|
263
441
|
export declare interface IChartDataLabelsOptions {
|
|
442
|
+
/** Whether this element is visible. */
|
|
264
443
|
display?: 'auto' | boolean;
|
|
444
|
+
/** Alignment within the available layout space. */
|
|
265
445
|
align?: 'center';
|
|
446
|
+
/** Anchor used to place the data label relative to its element. */
|
|
266
447
|
anchor?: 'center';
|
|
448
|
+
/** Formats the displayed data label from the value and plugin context. */
|
|
267
449
|
formatter?: (_value: unknown, context: unknown) => unknown;
|
|
268
450
|
}
|
|
269
451
|
|
|
452
|
+
/** Legend label produced by chart dataset generation. */
|
|
270
453
|
export declare interface IChartGeneratedLabel {
|
|
454
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
271
455
|
text: string;
|
|
456
|
+
/** Canvas fill style used by the generated legend label. */
|
|
272
457
|
fillStyle: string;
|
|
458
|
+
/** Canvas stroke colour used by the connector. */
|
|
273
459
|
strokeStyle: string;
|
|
460
|
+
/** Zero-based index of the data item. */
|
|
274
461
|
index: number;
|
|
275
462
|
}
|
|
276
463
|
|
|
@@ -278,486 +465,872 @@ declare interface IChartGraph {
|
|
|
278
465
|
showMinorGridlines?: boolean;
|
|
279
466
|
}
|
|
280
467
|
|
|
468
|
+
/** DS visibility metadata passed to legend filtering helpers. */
|
|
281
469
|
export declare interface IChartLegendItemFilter {
|
|
470
|
+
/** Zero-based index of the data item. */
|
|
282
471
|
index: number;
|
|
472
|
+
/** Zero-based index of the DS in the chart data. */
|
|
283
473
|
datasetIndex: number;
|
|
474
|
+
/** Initial visibility flag for the DS. */
|
|
284
475
|
hidden: boolean;
|
|
285
476
|
}
|
|
286
477
|
|
|
478
|
+
/** Shared Cartesian scale behaviour and range settings. */
|
|
287
479
|
export declare interface ICommonAdditionalAxesOptions {
|
|
480
|
+
/** Scale family used when constructing axes. */
|
|
288
481
|
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
482
|
+
/** Reverses the relevant scale or marker direction. */
|
|
289
483
|
reverse?: boolean;
|
|
484
|
+
/** Includes zero when determining automatic scale bounds. */
|
|
290
485
|
beginAtZero?: boolean;
|
|
486
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
291
487
|
stepSize?: number;
|
|
488
|
+
/** Enables stacked rendering where supported. */
|
|
292
489
|
stacked?: boolean;
|
|
490
|
+
/** Suggested lower scale bound; data may extend beyond it. */
|
|
293
491
|
suggestedMin?: number;
|
|
492
|
+
/** Suggested upper scale bound; data may extend beyond it. */
|
|
294
493
|
suggestedMax?: number;
|
|
494
|
+
/** Explicit lower bound in scale units. */
|
|
295
495
|
min?: number | string;
|
|
496
|
+
/** Explicit upper bound in scale units. */
|
|
296
497
|
max?: number | string;
|
|
297
498
|
}
|
|
298
499
|
|
|
500
|
+
/** A text overlay placed inside the chart area. */
|
|
299
501
|
export declare interface ICommonAnnotation {
|
|
502
|
+
/** Shows the chart-area text overlay. */
|
|
300
503
|
showLabel?: boolean;
|
|
504
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
301
505
|
text?: string | string[];
|
|
506
|
+
/** Visual placement of this element. */
|
|
302
507
|
position?: string;
|
|
508
|
+
/** Text size in pixels. */
|
|
303
509
|
fontSize?: number;
|
|
510
|
+
/** Horizontal offset of the text overlay in pixels. */
|
|
304
511
|
xOffset?: number;
|
|
512
|
+
/** Vertical offset of the text overlay in pixels. */
|
|
305
513
|
yOffset?: number;
|
|
514
|
+
/** Maximum width available for the text overlay, in pixels. */
|
|
306
515
|
maxWidth?: number;
|
|
516
|
+
/** Text line spacing in pixels. */
|
|
307
517
|
lineHeight?: number;
|
|
308
518
|
}
|
|
309
519
|
|
|
520
|
+
/** Rendered annotation metadata used by annotation interaction helpers. */
|
|
310
521
|
export declare interface ICommonAnnotationElement {
|
|
522
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
311
523
|
id?: string;
|
|
524
|
+
/** Whether this element is visible. */
|
|
312
525
|
display: boolean;
|
|
526
|
+
/** Index of the source annotation in the annotation collection. */
|
|
313
527
|
annotationIndex: number;
|
|
528
|
+
/** Rendered annotation label content and plugin options. */
|
|
314
529
|
label: {
|
|
530
|
+
/** Configuration for this chart or generated element. */
|
|
315
531
|
options: LabelOptions;
|
|
532
|
+
/** Text content of the generated label. */
|
|
316
533
|
content: string;
|
|
317
534
|
};
|
|
535
|
+
/** Configuration for this chart or generated element. */
|
|
318
536
|
options: {
|
|
537
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
319
538
|
id?: string;
|
|
539
|
+
/** Chart.js scale ID associated with this element. */
|
|
320
540
|
scaleID?: string;
|
|
541
|
+
/** Canvas colour used for the element outline. */
|
|
321
542
|
borderColor?: string;
|
|
543
|
+
/** Outline width in canvas pixels. */
|
|
322
544
|
borderWidth?: number;
|
|
545
|
+
/** Rendered annotation radius in pixels. */
|
|
323
546
|
radius?: number;
|
|
547
|
+
/** Rendered annotation label content and plugin options. */
|
|
324
548
|
label?: {
|
|
549
|
+
/** Text content of the generated label. */
|
|
325
550
|
content?: string;
|
|
551
|
+
/** Visual placement of this element. */
|
|
326
552
|
position?: string;
|
|
553
|
+
/** Whether this feature is active. */
|
|
327
554
|
enabled?: boolean;
|
|
555
|
+
/** Horizontal adjustment of the annotation label in pixels. */
|
|
328
556
|
xAdjust?: number;
|
|
329
557
|
};
|
|
330
558
|
};
|
|
331
559
|
}
|
|
332
560
|
|
|
561
|
+
/** Annotation collection and associated controls. */
|
|
333
562
|
export declare interface ICommonAnnotations {
|
|
563
|
+
/** Whether configured annotations are rendered. */
|
|
334
564
|
showAnnotations?: boolean;
|
|
565
|
+
/** Enables annotation controls where supported by the chart. */
|
|
335
566
|
controlAnnotation?: boolean;
|
|
567
|
+
/** Enables annotation dragging in the corresponding controls. */
|
|
336
568
|
enableDragAnnotation?: boolean;
|
|
569
|
+
/** Enables callout annotation controls in LineChart. */
|
|
337
570
|
enableCalloutAnnotation?: boolean;
|
|
571
|
+
/** Line-marker plugin configuration. */
|
|
338
572
|
lineMarkersAnnotation?: ILineMarkersAnnotation;
|
|
573
|
+
/** Annotation definitions in drawing order. */
|
|
339
574
|
annotationsData?: ICommonAnnotationsData[];
|
|
575
|
+
/** Text overlay drawn inside the chart area. */
|
|
340
576
|
labelAnnotation?: ICommonAnnotation;
|
|
341
577
|
}
|
|
342
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Geometry and interaction settings for one annotation.
|
|
581
|
+
* Coordinate values use the referenced scales; pixel offsets are named separately.
|
|
582
|
+
*/
|
|
343
583
|
export declare interface ICommonAnnotationsData {
|
|
584
|
+
/** Whether this element is visible. */
|
|
344
585
|
display?: boolean;
|
|
586
|
+
/** Excludes this entry from the legend where supported. */
|
|
345
587
|
hideLegend?: boolean;
|
|
588
|
+
/** Pixel offset between the label and its associated geometry. */
|
|
346
589
|
labelOffsetPx?: number;
|
|
590
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
347
591
|
id?: string;
|
|
592
|
+
/** Whether this annotation may expand the scale bounds to remain visible. */
|
|
348
593
|
adjustScaleRange?: boolean;
|
|
594
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
349
595
|
annotationAxis?: 'x' | 'y';
|
|
596
|
+
/** Annotation rotation in degrees. */
|
|
350
597
|
rotation?: number;
|
|
598
|
+
/** Canvas/CSS colour used by this element. */
|
|
351
599
|
color?: string;
|
|
600
|
+
/** End coordinate of a ranged annotation on `annotationAxis`. */
|
|
352
601
|
endValue?: number;
|
|
602
|
+
/** Outline width in canvas pixels. */
|
|
353
603
|
borderWidth?: number;
|
|
604
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
354
605
|
backgroundColor?: string;
|
|
606
|
+
/** Display text associated with this element. */
|
|
355
607
|
label?: string;
|
|
608
|
+
/** Appearance and placement of the annotation label. */
|
|
356
609
|
labelConfig?: IAnnotationLabelConfig;
|
|
610
|
+
/** Chart or annotation kind. */
|
|
357
611
|
type?: DraggableAnnotationType;
|
|
612
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
358
613
|
value?: number;
|
|
614
|
+
/** Lower X bound in scale units. */
|
|
359
615
|
xMin?: number;
|
|
616
|
+
/** Upper X bound in scale units. */
|
|
360
617
|
xMax?: number;
|
|
618
|
+
/** Lower Y bound in scale units. */
|
|
361
619
|
yMin?: number;
|
|
620
|
+
/** Upper Y bound in scale units. */
|
|
362
621
|
yMax?: number;
|
|
622
|
+
/** X coordinate in scale units. */
|
|
363
623
|
xValue?: number;
|
|
624
|
+
/** Y coordinate in scale units. */
|
|
364
625
|
yValue?: number;
|
|
626
|
+
/** Annotation point or circle radius in pixels. */
|
|
365
627
|
radius?: number;
|
|
628
|
+
/** Allows this annotation to be dragged when annotation dragging is enabled. */
|
|
366
629
|
enableDrag?: boolean;
|
|
630
|
+
/** Called when a drag starts. */
|
|
367
631
|
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
632
|
+
/** Called as the dragged value or annotation position changes. */
|
|
368
633
|
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
634
|
+
/** Called when dragging ends. */
|
|
369
635
|
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
636
|
+
/** Restricts annotation movement to X, Y, or both axes. */
|
|
370
637
|
dragAxis?: DragAxis;
|
|
638
|
+
/** Point marker shape. */
|
|
371
639
|
pointStyle?: string;
|
|
640
|
+
/** Allows interactive resizing of supported annotations. */
|
|
372
641
|
resizable?: boolean;
|
|
642
|
+
/** Inclusive dragging limits in axis units, expressed as [minimum, maximum]. */
|
|
373
643
|
dragRange?: {
|
|
644
|
+
/** Inclusive X dragging bounds [minimum, maximum], in scale units. */
|
|
374
645
|
x?: [number, number];
|
|
646
|
+
/** Inclusive Y dragging bounds [minimum, maximum], in scale units. */
|
|
375
647
|
y?: [number, number];
|
|
376
648
|
};
|
|
649
|
+
/** Displays coordinates while dragging an annotation. */
|
|
377
650
|
displayDragCoordinates?: boolean;
|
|
651
|
+
/** Horizontal Chart.js scale ID used to resolve annotation coordinates. */
|
|
378
652
|
xScaleID?: string;
|
|
653
|
+
/** Vertical Chart.js scale ID used to resolve annotation coordinates. */
|
|
379
654
|
yScaleID?: string;
|
|
655
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
380
656
|
opacity?: number;
|
|
381
657
|
}
|
|
382
658
|
|
|
659
|
+
/** Shared Cartesian axis label, placement and tick settings. */
|
|
383
660
|
export declare interface ICommonAxis<PositionType = string> {
|
|
661
|
+
/** Display text associated with this element. */
|
|
384
662
|
label?: string;
|
|
663
|
+
/** Visual placement of this element. */
|
|
385
664
|
position?: PositionType;
|
|
665
|
+
/** Canvas/CSS colour used by this element. */
|
|
386
666
|
color?: string | string[];
|
|
667
|
+
/** Unit identifier used by the axis. */
|
|
387
668
|
unit?: string;
|
|
669
|
+
/** Grid-line configuration for this axis. */
|
|
388
670
|
gridLines?: boolean;
|
|
671
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
389
672
|
stepSize?: number;
|
|
390
673
|
}
|
|
391
674
|
|
|
675
|
+
/** Shared zoom and pan controls; defaults differ between chart components. */
|
|
392
676
|
export declare interface ICommonChartOptions {
|
|
677
|
+
/** Enables zooming when supported by the chart. */
|
|
393
678
|
enableZoom?: boolean;
|
|
679
|
+
/** Enables panning when supported by the chart. */
|
|
394
680
|
enablePan?: boolean;
|
|
395
681
|
}
|
|
396
682
|
|
|
683
|
+
/** Shared legend and title plugin option shapes. */
|
|
397
684
|
export declare interface ICommonChartPlugins {
|
|
685
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
398
686
|
legend: {
|
|
687
|
+
/** Visual placement of this element. */
|
|
399
688
|
position: TAxisPosition;
|
|
400
689
|
};
|
|
690
|
+
/** Chart title; an array represents multiple lines. */
|
|
401
691
|
title: {
|
|
692
|
+
/** Whether this element is visible. */
|
|
402
693
|
display: boolean;
|
|
694
|
+
/** Text to display; arrays represent multiple lines where supported. */
|
|
403
695
|
text: string;
|
|
404
696
|
};
|
|
405
697
|
}
|
|
406
698
|
|
|
699
|
+
/** A Chart.js legend plugin paired with an external DOM container. */
|
|
407
700
|
export declare interface ICommonCustomLegend<T extends keyof ChartTypeRegistry> {
|
|
701
|
+
/** Chart.js plugin implementing the custom legend; null selects no custom plugin. */
|
|
408
702
|
customLegendPlugin: Plugin_2<T> | null;
|
|
703
|
+
/** ID of the DOM element used by the custom legend plugin. */
|
|
409
704
|
customLegendContainerID: string;
|
|
410
705
|
}
|
|
411
706
|
|
|
707
|
+
/** Base chart input extended by component-specific data models. */
|
|
412
708
|
export declare interface ICommonData {
|
|
709
|
+
/** Test identifier applied to the rendered chart container. */
|
|
413
710
|
testId?: string;
|
|
711
|
+
/** Values rendered by the chart or DS. */
|
|
414
712
|
data?: {
|
|
713
|
+
/** Labels associated with the input data. */
|
|
415
714
|
labels?: string[];
|
|
715
|
+
/** DS definitions in rendering order. */
|
|
416
716
|
datasets?: ICommonDataset[];
|
|
417
717
|
};
|
|
718
|
+
/** Configuration for this chart or generated element. */
|
|
418
719
|
options: ICommonOptions;
|
|
419
720
|
}
|
|
420
721
|
|
|
722
|
+
/** Shared input DS fields for Cartesian chart components. */
|
|
421
723
|
export declare interface ICommonDataset {
|
|
724
|
+
/** DS name used in the legend and tooltip. */
|
|
422
725
|
label?: string;
|
|
726
|
+
/** Canvas colour used for the element outline. */
|
|
423
727
|
borderColor?: string;
|
|
728
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
424
729
|
backgroundColor?: string | string[];
|
|
730
|
+
/** Outline width in canvas pixels. */
|
|
425
731
|
borderWidth?: number;
|
|
732
|
+
/** Values rendered by the chart or DS. */
|
|
426
733
|
data: ICommonDataValue[];
|
|
734
|
+
/** Initial visibility flag for the DS. */
|
|
427
735
|
hidden?: boolean;
|
|
428
736
|
}
|
|
429
737
|
|
|
738
|
+
/** A Cartesian data point with an optional display label. */
|
|
430
739
|
export declare interface ICommonDataValue {
|
|
740
|
+
/** X coordinate in scale units. */
|
|
431
741
|
x: number | string;
|
|
742
|
+
/** Y coordinate in scale units. */
|
|
432
743
|
y: number | string;
|
|
744
|
+
/** Display text associated with this element. */
|
|
433
745
|
label?: string;
|
|
434
746
|
}
|
|
435
747
|
|
|
748
|
+
/** Data-point dragging configuration passed to the drag-data plugin. */
|
|
436
749
|
export declare interface ICommonDragData {
|
|
750
|
+
/** Enables dragging data points. Defaults to false. */
|
|
437
751
|
enableDragData?: boolean;
|
|
752
|
+
/** Displays the drag tooltip while moving a data point. */
|
|
438
753
|
showTooltip?: boolean;
|
|
754
|
+
/** Rounds values during point dragging. */
|
|
439
755
|
roundPoints?: boolean;
|
|
756
|
+
/** Allows point dragging along the X axis. */
|
|
440
757
|
dragX?: boolean;
|
|
758
|
+
/** Allows point dragging along the Y axis. */
|
|
441
759
|
dragY?: boolean;
|
|
760
|
+
/** Called when a drag starts. */
|
|
442
761
|
onDragStart?: (event: unknown, element: unknown) => unknown;
|
|
762
|
+
/** Called as the dragged value or annotation position changes. */
|
|
443
763
|
onDrag?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
764
|
+
/** Called when dragging ends. */
|
|
444
765
|
onDragEnd?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
445
766
|
}
|
|
446
767
|
|
|
768
|
+
/** Background gradient settings used by ScatterChart. */
|
|
447
769
|
export declare interface ICommonGradient {
|
|
770
|
+
/** Whether this element is visible. */
|
|
448
771
|
display: boolean;
|
|
772
|
+
/** Ordered colour stops for the background gradient. */
|
|
449
773
|
gradientColors?: ICommonGradientColor[];
|
|
774
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
450
775
|
direction?: GradientDirection;
|
|
451
776
|
}
|
|
452
777
|
|
|
778
|
+
/** One colour stop in a canvas gradient. */
|
|
453
779
|
export declare interface ICommonGradientColor {
|
|
780
|
+
/** Gradient stop position between 0 and 1. */
|
|
454
781
|
offset: number;
|
|
782
|
+
/** Canvas/CSS colour used by this element. */
|
|
455
783
|
color: string;
|
|
456
784
|
}
|
|
457
785
|
|
|
786
|
+
/** Shared line geometry, grid and data-label settings. */
|
|
458
787
|
export declare interface ICommonGraph {
|
|
788
|
+
/** Line interpolation tension; zero produces straight segments. */
|
|
459
789
|
lineTension?: number;
|
|
790
|
+
/** Connects line segments across missing values. */
|
|
460
791
|
spanGaps?: boolean;
|
|
792
|
+
/** Draws labels on data elements. */
|
|
461
793
|
showDataLabels?: boolean;
|
|
794
|
+
/** Draws intermediate grid lines between the main ticks. */
|
|
462
795
|
showMinorGridlines?: boolean;
|
|
463
796
|
}
|
|
464
797
|
|
|
798
|
+
/** Indices identifying the currently hovered DS and point. */
|
|
465
799
|
export declare interface ICommonHoveredItems {
|
|
800
|
+
/** Zero-based index of the data item. */
|
|
466
801
|
index: number;
|
|
802
|
+
/** Zero-based index of the DS in the chart data. */
|
|
467
803
|
datasetIndex: number;
|
|
468
804
|
}
|
|
469
805
|
|
|
806
|
+
/** Chart interaction callbacks. Generated DS indices may include annotation entries. */
|
|
470
807
|
export declare interface ICommonInteractions {
|
|
808
|
+
/** Receives the clicked legend text and its hidden state. */
|
|
471
809
|
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
810
|
+
/** Receives the chart event, DS index, point index and generated DS collection on hover. */
|
|
472
811
|
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: any[]) => void;
|
|
812
|
+
/** Called when the pointer leaves the hovered chart element. */
|
|
473
813
|
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
|
|
474
814
|
}
|
|
475
815
|
|
|
816
|
+
/** Common legend visibility and placement settings. */
|
|
476
817
|
export declare interface ICommonLegend {
|
|
818
|
+
/** Whether this element is visible. */
|
|
477
819
|
display: boolean;
|
|
820
|
+
/** Visual placement of this element. */
|
|
478
821
|
position?: Position;
|
|
822
|
+
/** Alignment within the available layout space. */
|
|
479
823
|
align?: AlignOptions;
|
|
480
824
|
}
|
|
481
825
|
|
|
826
|
+
/**
|
|
827
|
+
* Common chart options extended by each chart component.
|
|
828
|
+
* A field's presence in this shared type does not imply support in every chart.
|
|
829
|
+
*/
|
|
482
830
|
export declare interface ICommonOptions {
|
|
831
|
+
/** Chart title; an array represents multiple lines. */
|
|
483
832
|
title?: string | string[];
|
|
833
|
+
/** Chart sizing and visual layout settings. */
|
|
484
834
|
chartStyling?: ICommonStyling;
|
|
835
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
485
836
|
tooltip?: ICommonTooltip;
|
|
837
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
486
838
|
legend?: ICommonLegend;
|
|
839
|
+
/** Initial interaction and rendering controls. */
|
|
487
840
|
chartOptions?: ICommonChartOptions;
|
|
841
|
+
/** Callbacks for legend and pointer interactions. */
|
|
488
842
|
interactions?: ICommonInteractions;
|
|
843
|
+
/** Point-dragging options and lifecycle callbacks. */
|
|
489
844
|
dragData?: ICommonDragData;
|
|
845
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
490
846
|
annotations?: ICommonAnnotations;
|
|
847
|
+
/** Plugin configuration accepted by this options shape; forwarding is chart-specific. */
|
|
491
848
|
plugins?: {
|
|
849
|
+
/** Line-marker plugin enablement settings. */
|
|
492
850
|
lineMarkersPlugin?: {
|
|
851
|
+
/** Whether this feature is active. */
|
|
493
852
|
enabled?: boolean;
|
|
494
853
|
};
|
|
495
854
|
};
|
|
496
855
|
}
|
|
497
856
|
|
|
857
|
+
/** Supported Chart.js scale option variants. */
|
|
498
858
|
export declare type ICommonScaleOptions = ScaleOptions<'category'> | ScaleOptions<'linear'> | ScaleOptions<'logarithmic'> | ScaleOptions<'time'> | ScaleOptions<'timeseries'>;
|
|
499
859
|
|
|
860
|
+
/** Scale configuration indexed by Chart.js scale ID. */
|
|
500
861
|
export declare type ICommonScales = Partial<Record<string, ICommonScaleOptions>>;
|
|
501
862
|
|
|
863
|
+
/** Shared chart container and canvas layout settings. */
|
|
502
864
|
export declare interface ICommonStyling {
|
|
865
|
+
/** Chart width as a number or CSS size string. */
|
|
503
866
|
width?: number | string;
|
|
867
|
+
/** Chart height as a number or CSS size string. */
|
|
504
868
|
height?: number | string;
|
|
869
|
+
/** Preserves the canvas aspect ratio while resizing. */
|
|
505
870
|
maintainAspectRatio?: boolean;
|
|
871
|
+
/** Uses the fixed-height layout instead of stretching to the container. */
|
|
506
872
|
staticChartHeight?: boolean;
|
|
873
|
+
/** Disables chart animation when true. Defaults to true. */
|
|
507
874
|
performanceMode?: boolean;
|
|
875
|
+
/** Background gradient configuration; consumed by ScatterChart. */
|
|
508
876
|
gradient?: ICommonGradient;
|
|
509
877
|
}
|
|
510
878
|
|
|
879
|
+
/** Shared tooltip settings; individual chart components determine supported callbacks. */
|
|
511
880
|
export declare interface ICommonTooltip {
|
|
881
|
+
/** Enables hover tooltips. Defaults to true. */
|
|
512
882
|
tooltips?: boolean;
|
|
883
|
+
/** Includes the optional point label in supported tooltips. Defaults to false. */
|
|
513
884
|
showLabelsInTooltips?: boolean;
|
|
885
|
+
/** Allows scientific notation when formatting tooltip numbers. Defaults to true. */
|
|
514
886
|
scientificNotation?: boolean;
|
|
887
|
+
/** Custom tooltip callbacks. LineChart preserves title, label and afterLabel overrides independently. */
|
|
515
888
|
callbacks?: ICommonTooltipCallbacks;
|
|
516
889
|
}
|
|
517
890
|
|
|
891
|
+
/**
|
|
892
|
+
* Tooltip callback overrides consumed by LineChart.
|
|
893
|
+
* BarChart, PieChart and ScatterChart currently use their own tooltip formatters.
|
|
894
|
+
*/
|
|
518
895
|
export declare interface ICommonTooltipCallbacks {
|
|
896
|
+
/** Replaces the tooltip title callback. LineChart passes the hovered tooltip items. */
|
|
519
897
|
title?: (...args: unknown[]) => unknown;
|
|
898
|
+
/** Replaces the DS-row callback. LineChart passes one tooltip item. */
|
|
520
899
|
label?: (...args: unknown[]) => unknown;
|
|
900
|
+
/** Appends content below the DS value. LineChart uses this instead of its built-in after-label callback. */
|
|
521
901
|
afterLabel?: (...args: unknown[]) => unknown;
|
|
522
902
|
}
|
|
523
903
|
|
|
904
|
+
/** A pair of X/Y coordinates passed to annotation drag callbacks. */
|
|
524
905
|
export declare interface ICoordinates {
|
|
906
|
+
/** X coordinate in scale units. */
|
|
525
907
|
x: number;
|
|
908
|
+
/** Y coordinate in scale units. */
|
|
526
909
|
y: number;
|
|
527
910
|
}
|
|
528
911
|
|
|
912
|
+
/** Legacy selector type retained for source compatibility. */
|
|
529
913
|
export declare interface IDepthType {
|
|
914
|
+
/** Available selector values. */
|
|
530
915
|
options: string[];
|
|
916
|
+
/** Currently selected unit identifier. */
|
|
531
917
|
selectedUnit: string;
|
|
918
|
+
/** Notifies the consumer when another unit is selected; the consumer owns the selection. */
|
|
532
919
|
setSelectedUnit: (value: string) => void;
|
|
533
920
|
}
|
|
534
921
|
|
|
922
|
+
/** Generated bar DS with annotation and legend metadata. */
|
|
535
923
|
export declare interface IGenerateBarChartDataset extends ChartDataset<'bar', ICommonDataValue[]> {
|
|
924
|
+
/** Canvas colour used for the element outline. */
|
|
536
925
|
borderColor: string;
|
|
926
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
537
927
|
backgroundColor: string | string[];
|
|
928
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
538
929
|
borderDash?: number[];
|
|
930
|
+
/** Outline width in canvas pixels. */
|
|
539
931
|
borderWidth?: number;
|
|
932
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
540
933
|
annotationType?: string;
|
|
934
|
+
/** Excludes this entry from the legend where supported. */
|
|
541
935
|
hideLegend?: boolean;
|
|
936
|
+
/** Groups DS entries for legend display. */
|
|
542
937
|
displayGroup?: string | number;
|
|
938
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
543
939
|
isAnnotation?: boolean;
|
|
940
|
+
/** Index of the source annotation in the annotation collection. */
|
|
544
941
|
annotationIndex?: number;
|
|
545
942
|
}
|
|
546
943
|
|
|
944
|
+
/** DS produced by LineChart normalization, including generated annotation metadata. */
|
|
547
945
|
export declare interface IGeneratedLineChartDataset {
|
|
946
|
+
/** Display text associated with this element. */
|
|
548
947
|
label?: string;
|
|
948
|
+
/** Values rendered by the chart or DS. */
|
|
549
949
|
data: ICommonDataValue[];
|
|
950
|
+
/** Whether to draw connecting lines. */
|
|
550
951
|
showLine?: boolean;
|
|
952
|
+
/** Resolved interpolation tension for the generated DS. */
|
|
551
953
|
lineTension: number;
|
|
954
|
+
/** Connects line segments across missing values. */
|
|
552
955
|
spanGaps: boolean;
|
|
956
|
+
/** Outline width in canvas pixels. */
|
|
553
957
|
borderWidth: number;
|
|
958
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
554
959
|
borderDash: number[];
|
|
960
|
+
/** Canvas join style at line segment corners. */
|
|
555
961
|
borderJoinStyle: 'round' | 'bevel' | 'miter';
|
|
962
|
+
/** Canvas colour used for the element outline. */
|
|
556
963
|
borderColor: string;
|
|
964
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
557
965
|
backgroundColor: string | string[];
|
|
966
|
+
/** Fill colour of the point marker. */
|
|
558
967
|
pointBackgroundColor: string;
|
|
968
|
+
/** Point marker radius in pixels. */
|
|
559
969
|
pointRadius: number;
|
|
970
|
+
/** Point radius while hovered, in pixels. */
|
|
560
971
|
pointHoverRadius: number;
|
|
972
|
+
/** Additional hit-test radius around a point, in pixels. */
|
|
561
973
|
pointHitRadius: number;
|
|
974
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
562
975
|
isAnnotation?: boolean;
|
|
976
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
563
977
|
annotationType?: string;
|
|
978
|
+
/** Index of the source annotation in the annotation collection. */
|
|
564
979
|
annotationIndex?: number;
|
|
980
|
+
/** Text retained for the generated annotation DS. */
|
|
565
981
|
annotationLabel?: string;
|
|
982
|
+
/** Fill colour retained for the generated annotation DS. */
|
|
566
983
|
annotationBackgroundColor?: string;
|
|
984
|
+
/** Point fill retained for the generated annotation DS. */
|
|
567
985
|
annotationPointBackgroundColor?: string;
|
|
986
|
+
/** Outline colour retained for the generated annotation DS. */
|
|
568
987
|
annotationBorderColor?: string;
|
|
988
|
+
/** Outline dash pattern retained for the generated annotation DS. */
|
|
569
989
|
annotationBorderDash?: number[];
|
|
990
|
+
/** Outline width retained for the generated annotation DS. */
|
|
570
991
|
annotationBorderWidth?: number;
|
|
992
|
+
/** Groups DS entries for legend display. */
|
|
571
993
|
displayGroup?: string | number;
|
|
994
|
+
/** Excludes this entry from the legend where supported. */
|
|
572
995
|
hideLegend?: boolean;
|
|
996
|
+
/** Point marker shape. */
|
|
573
997
|
pointStyle?: string;
|
|
998
|
+
/** Horizontal scale ID for this DS, such as `x` or `x2`. */
|
|
574
999
|
xAxisID?: string;
|
|
1000
|
+
/** Vertical scale ID for this DS, such as `y` or `y2`. */
|
|
575
1001
|
yAxisID?: string;
|
|
576
1002
|
}
|
|
577
1003
|
|
|
1004
|
+
/** Generated pie DS with annotation and legend metadata. */
|
|
578
1005
|
export declare interface IGeneratedPieChartDataset {
|
|
1006
|
+
/** Display text associated with this element. */
|
|
579
1007
|
label: string;
|
|
1008
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
580
1009
|
backgroundColor: string[];
|
|
1010
|
+
/** Canvas colour used for the element outline. */
|
|
581
1011
|
borderColor: string;
|
|
1012
|
+
/** Outline width in canvas pixels. */
|
|
582
1013
|
borderWidth: number;
|
|
1014
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
583
1015
|
borderDash: number[];
|
|
1016
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
584
1017
|
annotationType?: string;
|
|
1018
|
+
/** Values rendered by the chart or DS. */
|
|
585
1019
|
data: IPieDataValue[];
|
|
1020
|
+
/** Excludes this entry from the legend where supported. */
|
|
586
1021
|
hideLegend?: boolean;
|
|
1022
|
+
/** Groups DS entries for legend display. */
|
|
587
1023
|
displayGroup?: string | number;
|
|
1024
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
588
1025
|
isAnnotation?: boolean;
|
|
1026
|
+
/** Index of the source annotation in the annotation collection. */
|
|
589
1027
|
annotationIndex?: number;
|
|
590
1028
|
}
|
|
591
1029
|
|
|
1030
|
+
/** Generated scatter DS with annotation and legend metadata. */
|
|
592
1031
|
export declare interface IGeneratedScatterChartDataset {
|
|
1032
|
+
/** Display text associated with this element. */
|
|
593
1033
|
label: string;
|
|
1034
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
594
1035
|
backgroundColor: string[];
|
|
1036
|
+
/** Canvas colour used for the element outline. */
|
|
595
1037
|
borderColor: string;
|
|
1038
|
+
/** Outline width in canvas pixels. */
|
|
596
1039
|
borderWidth: number;
|
|
1040
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
597
1041
|
borderDash: number[];
|
|
1042
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
598
1043
|
annotationType?: string;
|
|
1044
|
+
/** Values rendered by the chart or DS. */
|
|
599
1045
|
data: IScatterDataValue[];
|
|
1046
|
+
/** Excludes this entry from the legend where supported. */
|
|
600
1047
|
hideLegend?: boolean;
|
|
1048
|
+
/** Groups DS entries for legend display. */
|
|
601
1049
|
displayGroup?: string | number;
|
|
1050
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
602
1051
|
isAnnotation?: boolean;
|
|
1052
|
+
/** Index of the source annotation in the annotation collection. */
|
|
603
1053
|
annotationIndex?: number;
|
|
604
1054
|
}
|
|
605
1055
|
|
|
1056
|
+
/** Initial LineChart rendering and interaction controls. */
|
|
606
1057
|
export declare interface ILChartOptions extends ICommonChartOptions {
|
|
1058
|
+
/** Whether to draw point markers. */
|
|
607
1059
|
showPoints?: boolean;
|
|
1060
|
+
/** Closes the LineChart controls panel when clicking outside it. Defaults to false. */
|
|
608
1061
|
closeOnOutsideClick?: boolean;
|
|
1062
|
+
/** Whether to draw connecting lines. */
|
|
609
1063
|
showLine?: boolean;
|
|
1064
|
+
/** Enables zooming when supported by the chart. */
|
|
610
1065
|
enableZoom?: boolean;
|
|
1066
|
+
/** Enables panning when supported by the chart. */
|
|
611
1067
|
enablePan?: boolean;
|
|
1068
|
+
/** Enables annotation dragging in the corresponding controls. */
|
|
612
1069
|
enableDragAnnotation?: boolean;
|
|
1070
|
+
/** Legacy control flag; use `dragData.enableDragData` to configure LineChart point dragging. */
|
|
613
1071
|
enableDragPoints?: boolean;
|
|
614
1072
|
}
|
|
615
1073
|
|
|
1074
|
+
/** LineChart scale defaults and per-axis range overrides. */
|
|
616
1075
|
export declare interface ILineChartAdditionalAxesOptions {
|
|
1076
|
+
/** Scale family used when constructing axes. */
|
|
617
1077
|
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
1078
|
+
/** Reverses the Y scale direction. Does not change tooltip axis selection. */
|
|
618
1079
|
reverse?: boolean;
|
|
1080
|
+
/** Includes zero when determining automatic scale bounds. */
|
|
619
1081
|
beginAtZero?: boolean;
|
|
1082
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
620
1083
|
stepSize?: number;
|
|
1084
|
+
/** Suggested lower scale bound; data may extend beyond it. */
|
|
621
1085
|
suggestedMin?: number;
|
|
1086
|
+
/** Suggested upper scale bound; data may extend beyond it. */
|
|
622
1087
|
suggestedMax?: number;
|
|
1088
|
+
/** Per-axis bounds keyed by scale ID, such as `x`, `y`, or `y2`. */
|
|
623
1089
|
range?: ILineRange;
|
|
1090
|
+
/** Adds padding to automatically computed axis bounds. Defaults to false in LineChart. */
|
|
624
1091
|
autoAxisPadding?: boolean;
|
|
625
1092
|
}
|
|
626
1093
|
|
|
1094
|
+
/** Ordered horizontal and vertical axis collections for LineChart. */
|
|
627
1095
|
export declare interface ILineChartAxes {
|
|
1096
|
+
/** Horizontal axis definitions in order. */
|
|
628
1097
|
x: ILineChartAxis<'top' | 'bottom'>[];
|
|
1098
|
+
/** Vertical axis definitions in order. */
|
|
629
1099
|
y: ILineChartAxis<'left' | 'right'>[];
|
|
630
1100
|
[key: string]: ILineChartAxis[];
|
|
631
1101
|
}
|
|
632
1102
|
|
|
1103
|
+
/** One LineChart axis. Array order determines generated IDs (`x`, `x2`, ... or `y`, `y2`, ...). */
|
|
633
1104
|
export declare interface ILineChartAxis<PositionType = TAxisPosition> {
|
|
1105
|
+
/** Optional axis metadata; generated scale IDs currently follow the axis array order. */
|
|
634
1106
|
id?: string;
|
|
1107
|
+
/** Axis title, also appended to the default tooltip title when this is the selected title axis. */
|
|
635
1108
|
label?: string;
|
|
1109
|
+
/** Axis placement. Placing the first X axis at the top also swaps the default tooltip coordinate roles. */
|
|
636
1110
|
position?: PositionType;
|
|
1111
|
+
/** Canvas/CSS colour used by this element. */
|
|
637
1112
|
color?: string | string[];
|
|
1113
|
+
/**
|
|
1114
|
+
* Unit metadata or a consumer-owned unit selector. Does not convert DS coordinates.
|
|
1115
|
+
* Default tooltip units are extracted from square brackets in the axis label, not from this field.
|
|
1116
|
+
*/
|
|
638
1117
|
unit?: IUnitOptions | string;
|
|
1118
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
639
1119
|
stepSize?: number;
|
|
1120
|
+
/** Grid-line configuration for this axis. */
|
|
640
1121
|
gridLines?: ILineChartGraph;
|
|
1122
|
+
/** Explicit lower bound in scale units. */
|
|
641
1123
|
min?: number | string;
|
|
1124
|
+
/** Explicit upper bound in scale units. */
|
|
642
1125
|
max?: number | string;
|
|
643
1126
|
}
|
|
644
1127
|
|
|
1128
|
+
/** Normalized LineChart configuration and control integration identifiers. */
|
|
645
1129
|
export declare interface ILineChartData extends ICommonData {
|
|
1130
|
+
/** Values rendered by the chart or DS. */
|
|
646
1131
|
data?: {
|
|
1132
|
+
/** DS definitions in rendering order. */
|
|
647
1133
|
datasets: ILineChartDataset[];
|
|
648
1134
|
};
|
|
1135
|
+
/** Configuration for this chart or generated element. */
|
|
649
1136
|
options: ILineChartOptions;
|
|
1137
|
+
/** Key used by LineChart to persist chart settings; use distinct IDs for independent charts. */
|
|
650
1138
|
persistenceId?: string;
|
|
1139
|
+
/** ID of an existing DOM element in which chart controls should be rendered. */
|
|
651
1140
|
controlsPortalId?: string;
|
|
652
1141
|
}
|
|
653
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* Consumer-facing LineChart configuration. Missing datasets and options receive component defaults.
|
|
1145
|
+
* Use this type for standalone chart configuration objects.
|
|
1146
|
+
*/
|
|
654
1147
|
export declare interface ILineChartDataInput extends Omit<ILineChartData, 'data' | 'options'> {
|
|
1148
|
+
/** Values rendered by the chart or DS. */
|
|
655
1149
|
data?: Omit<DeepPartial<ILineChartData['data']>, 'datasets'> & {
|
|
1150
|
+
/** DS definitions in rendering order. */
|
|
656
1151
|
datasets?: Array<(DeepPartial<ILineChartDataset> & {
|
|
1152
|
+
/** Line interpolation tension; zero produces straight segments. */
|
|
657
1153
|
lineTension?: number | string;
|
|
1154
|
+
/** Controls filling beneath or between lines. */
|
|
658
1155
|
fill?: boolean | string | Record<string, unknown>;
|
|
1156
|
+
/** Point marker shape. */
|
|
659
1157
|
pointStyle?: unknown;
|
|
1158
|
+
/** Legacy input accepted for compatibility; prefer `showPoints`. */
|
|
660
1159
|
showPoint?: boolean;
|
|
1160
|
+
/** Whether to draw point markers. */
|
|
661
1161
|
showPoints?: boolean;
|
|
1162
|
+
/** Legacy DS input accepted for compatibility; not a tooltip formatting option. */
|
|
662
1163
|
lineHeight?: number;
|
|
1164
|
+
/** Values rendered by the chart or DS. */
|
|
663
1165
|
data?: Array<DeepPartial<ICommonDataValue> | null>;
|
|
664
1166
|
[key: string]: unknown;
|
|
665
1167
|
}) | object | null> | object;
|
|
666
1168
|
};
|
|
1169
|
+
/** Configuration for this chart or generated element. */
|
|
667
1170
|
options?: ILineChartOptionsInput;
|
|
668
1171
|
}
|
|
669
1172
|
|
|
1173
|
+
/** Input DS for LineChart. Axis IDs bind values and tooltip units to the corresponding axes. */
|
|
670
1174
|
export declare interface ILineChartDataset extends ICommonDataset {
|
|
1175
|
+
/** DS interpolation tension; overrides `options.graph.lineTension` when provided. */
|
|
671
1176
|
lineTension?: number;
|
|
1177
|
+
/** Fill colour of the point marker. */
|
|
672
1178
|
pointBackgroundColor?: string;
|
|
1179
|
+
/** Point marker radius in pixels. */
|
|
673
1180
|
pointRadius?: number;
|
|
1181
|
+
/** Point radius while hovered, in pixels. */
|
|
674
1182
|
pointHoverRadius?: number;
|
|
1183
|
+
/** Additional hit-test radius around a point, in pixels. */
|
|
675
1184
|
pointHitRadius?: number;
|
|
1185
|
+
/** Controls filling beneath or between lines. */
|
|
676
1186
|
fill?: boolean;
|
|
1187
|
+
/** Horizontal scale ID for this DS, such as `x` or `x2`. */
|
|
677
1188
|
xAxisID?: string;
|
|
1189
|
+
/** Vertical scale ID for this DS, such as `y` or `y2`. */
|
|
678
1190
|
yAxisID?: string;
|
|
1191
|
+
/** Legacy flag that clips the DS endpoints against the first axis bounds. */
|
|
679
1192
|
formation?: boolean;
|
|
1193
|
+
/** Groups DS entries for legend display. */
|
|
680
1194
|
displayGroup?: string | number;
|
|
1195
|
+
/** Point marker shape. */
|
|
681
1196
|
pointStyle?: string;
|
|
682
1197
|
}
|
|
683
1198
|
|
|
1199
|
+
/** LineChart interpolation, missing-value and grid rendering settings. */
|
|
684
1200
|
export declare interface ILineChartGraph {
|
|
1201
|
+
/** Line interpolation tension; zero produces straight segments. */
|
|
685
1202
|
lineTension?: number;
|
|
1203
|
+
/** Connects line segments across missing values. */
|
|
686
1204
|
spanGaps?: boolean;
|
|
1205
|
+
/** Draws labels on data elements. */
|
|
687
1206
|
showDataLabels?: boolean;
|
|
1207
|
+
/** Draws intermediate grid lines between the main ticks. */
|
|
688
1208
|
showMinorGridlines?: boolean;
|
|
689
1209
|
}
|
|
690
1210
|
|
|
1211
|
+
/** Resolved LineChart options. Consumers normally provide the partial {@link ILineChartOptionsInput}. */
|
|
691
1212
|
export declare interface ILineChartOptions extends ICommonOptions {
|
|
1213
|
+
/** Chart title; an array represents multiple lines. */
|
|
692
1214
|
title?: string | string[];
|
|
1215
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
693
1216
|
axes: ILineChartAxes;
|
|
1217
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
694
1218
|
scales: ICommonScales;
|
|
1219
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
695
1220
|
additionalAxesOptions: ILineChartAdditionalAxesOptions;
|
|
1221
|
+
/** Chart sizing and visual layout settings. */
|
|
696
1222
|
chartStyling: ILineChartStyling;
|
|
1223
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
697
1224
|
tooltip: ILineChartTooltip;
|
|
1225
|
+
/** Geometry, grid and data-label rendering options. */
|
|
698
1226
|
graph: ILineChartGraph;
|
|
1227
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
699
1228
|
annotations: ICommonAnnotations;
|
|
1229
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
700
1230
|
legend: ILineLegend;
|
|
1231
|
+
/** Initial interaction and rendering controls. */
|
|
701
1232
|
chartOptions: ILChartOptions;
|
|
1233
|
+
/** Callbacks for legend and pointer interactions. */
|
|
702
1234
|
interactions: ILineInteractions;
|
|
1235
|
+
/** Point-dragging options and lifecycle callbacks. */
|
|
703
1236
|
dragData?: ICommonDragData;
|
|
1237
|
+
/** Legacy selector configuration passed to the LineChart axes controls. */
|
|
704
1238
|
depthType?: IDepthType | object;
|
|
705
1239
|
}
|
|
706
1240
|
|
|
1241
|
+
/**
|
|
1242
|
+
* Consumer-facing LineChart options with optional defaults and compatibility fields.
|
|
1243
|
+
* Unknown fields are accepted for compatibility, not guaranteed to be forwarded to Chart.js.
|
|
1244
|
+
*/
|
|
707
1245
|
export declare type ILineChartOptionsInput = Omit<DeepPartial<ILineChartOptions>, 'title' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'graph' | 'annotations' | 'additionalAxesOptions' | 'scales' | 'plugins'> & {
|
|
708
1246
|
[key: string]: unknown;
|
|
1247
|
+
/** Chart title; an array represents multiple lines. */
|
|
709
1248
|
title?: unknown;
|
|
1249
|
+
/** Legacy input accepted for compatibility; LineChart does not use it to swap axes or tooltip values. */
|
|
710
1250
|
direction?: string;
|
|
1251
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
711
1252
|
axes?: {
|
|
1253
|
+
/** Horizontal axis definitions in order. */
|
|
712
1254
|
x?: ILooseLineAxis[];
|
|
1255
|
+
/** Vertical axis definitions in order. */
|
|
713
1256
|
y?: ILooseLineAxis[];
|
|
714
1257
|
[key: string]: ILooseLineAxis[] | undefined;
|
|
715
1258
|
};
|
|
1259
|
+
/** Chart.js scale overrides keyed by generated scale ID (`x`, `x2`, `y`, `y2`, ...). */
|
|
716
1260
|
scales?: Record<string, unknown>;
|
|
1261
|
+
/** Compatibility input; not forwarded by the LineChart option normalizer. */
|
|
717
1262
|
plugins?: Record<string, unknown>;
|
|
1263
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
718
1264
|
legend?: Omit<DeepPartial<ILineLegend>, 'position' | 'align'> & {
|
|
1265
|
+
/** Visual placement of this element. */
|
|
719
1266
|
position?: string;
|
|
1267
|
+
/** Alignment within the available layout space. */
|
|
720
1268
|
align?: string;
|
|
721
1269
|
[key: string]: unknown;
|
|
722
1270
|
};
|
|
1271
|
+
/** Chart sizing and visual layout settings. */
|
|
723
1272
|
chartStyling?: DeepPartial<ILineChartStyling> & {
|
|
1273
|
+
/** Compatibility input; not currently consumed by the chart option normalizers. */
|
|
724
1274
|
hideControls?: boolean;
|
|
1275
|
+
/** Compatibility input; not currently consumed by the chart option normalizers. */
|
|
725
1276
|
minHeight?: number | string;
|
|
726
1277
|
[key: string]: unknown;
|
|
727
1278
|
};
|
|
1279
|
+
/** Callbacks for legend and pointer interactions. */
|
|
728
1280
|
interactions?: DeepPartial<ILineInteractions> & {
|
|
1281
|
+
/** Compatibility interaction input; configure zoom through `chartOptions.enableZoom`. */
|
|
729
1282
|
enableZoom?: boolean;
|
|
1283
|
+
/** Compatibility interaction input; configure pan through `chartOptions.enablePan`. */
|
|
730
1284
|
enablePan?: boolean;
|
|
731
1285
|
[key: string]: unknown;
|
|
732
1286
|
};
|
|
1287
|
+
/** Geometry, grid and data-label rendering options. */
|
|
733
1288
|
graph?: DeepPartial<ILineChartGraph> & {
|
|
1289
|
+
/** Legacy graph-level input; configure tooltips through `options.tooltip` instead. */
|
|
734
1290
|
tooltip?: unknown;
|
|
735
1291
|
[key: string]: unknown;
|
|
736
1292
|
};
|
|
1293
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
737
1294
|
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
1295
|
+
/** Annotation definitions in drawing order. */
|
|
738
1296
|
annotationsData?: ILooseLineAnnotation[];
|
|
739
1297
|
}) | ILooseLineAnnotation[] | null;
|
|
1298
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
740
1299
|
additionalAxesOptions?: Omit<DeepPartial<ILineChartAdditionalAxesOptions>, 'chartScaleType'> & {
|
|
1300
|
+
/** Scale family used when constructing axes. */
|
|
741
1301
|
chartScaleType?: string;
|
|
1302
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
742
1303
|
stepSize?: unknown;
|
|
1304
|
+
/** Per-axis bounds keyed by scale ID, such as `x`, `y`, or `y2`. */
|
|
743
1305
|
range?: ILineRange | ILineChartRange | Record<string, ILineChartRange | undefined>;
|
|
744
1306
|
} & Record<string, unknown>;
|
|
745
1307
|
};
|
|
746
1308
|
|
|
1309
|
+
/** Props accepted by the LineChart React component. */
|
|
747
1310
|
export declare interface ILineChartProps {
|
|
1311
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
748
1312
|
chart: ILineChartDataInput;
|
|
1313
|
+
/** React table content exposed through the LineChart controls. */
|
|
749
1314
|
table?: ReactNode;
|
|
1315
|
+
/** React content rendered in the LineChart header. */
|
|
750
1316
|
headerComponent?: ReactNode;
|
|
1317
|
+
/** React content rendered below the LineChart header. */
|
|
751
1318
|
subheaderComponent?: ReactNode;
|
|
752
1319
|
}
|
|
753
1320
|
|
|
1321
|
+
/** Optional lower and upper bounds for one scale. */
|
|
754
1322
|
export declare interface ILineChartRange {
|
|
1323
|
+
/** Explicit lower bound in scale units. */
|
|
755
1324
|
min?: number | string;
|
|
1325
|
+
/** Explicit upper bound in scale units. */
|
|
756
1326
|
max?: number | string;
|
|
757
1327
|
}
|
|
758
1328
|
|
|
1329
|
+
/** LineChart canvas size and chart-area padding. */
|
|
759
1330
|
export declare interface ILineChartStyling extends ICommonStyling {
|
|
1331
|
+
/** Requests a square chart layout; LineChart also accepts a numeric layout value. */
|
|
760
1332
|
squareAspectRatio?: number | boolean;
|
|
1333
|
+
/** Padding around the chart area, globally or per side. */
|
|
761
1334
|
layoutPadding?: number | {
|
|
762
1335
|
top: number;
|
|
763
1336
|
bottom: number;
|
|
@@ -766,295 +1339,513 @@ export declare interface ILineChartStyling extends ICommonStyling {
|
|
|
766
1339
|
};
|
|
767
1340
|
}
|
|
768
1341
|
|
|
1342
|
+
/**
|
|
1343
|
+
* LineChart tooltip formatting and callback overrides.
|
|
1344
|
+
* When the first X axis is placed at the top, the default title uses Y and the DS row uses X.
|
|
1345
|
+
* Otherwise, the title uses X and the DS row uses Y. Callbacks can override this formatting.
|
|
1346
|
+
*/
|
|
769
1347
|
export declare interface ILineChartTooltip extends ICommonTooltip {
|
|
1348
|
+
/** Compatibility flag retained by LineChart; currently does not alter tooltip text. */
|
|
770
1349
|
hideSimulationName?: boolean;
|
|
1350
|
+
/** Allows scientific notation when formatting tooltip numbers. Defaults to true. */
|
|
771
1351
|
scientificNotation?: boolean;
|
|
772
1352
|
}
|
|
773
1353
|
|
|
1354
|
+
/** LineChart pointer, legend and animation lifecycle callbacks. */
|
|
774
1355
|
export declare interface ILineInteractions extends ICommonInteractions {
|
|
1356
|
+
/** Called after a LineChart animation completes. */
|
|
775
1357
|
onAnimationComplete?: () => void;
|
|
776
1358
|
}
|
|
777
1359
|
|
|
1360
|
+
/** LineChart legend options, including external legend integration. */
|
|
778
1361
|
export declare interface ILineLegend extends ICommonLegend {
|
|
1362
|
+
/** Custom legend plugin and its target DOM container. */
|
|
779
1363
|
customLegend?: ICommonCustomLegend<any>;
|
|
1364
|
+
/** Uses point symbols in legend entries. */
|
|
780
1365
|
usePointStyle?: boolean;
|
|
781
1366
|
}
|
|
782
1367
|
|
|
1368
|
+
/** Annotation configuration alias for the line-marker plugin. */
|
|
783
1369
|
export declare type ILineMarkersAnnotation = TLineMarkersOptions;
|
|
784
1370
|
|
|
1371
|
+
/** LineChart bounds indexed by scale ID. */
|
|
785
1372
|
export declare interface ILineRange {
|
|
786
1373
|
[key: string]: ILineChartRange;
|
|
787
1374
|
}
|
|
788
1375
|
|
|
1376
|
+
/** Compatibility annotation input normalized by BarChart. */
|
|
789
1377
|
declare type ILooseBarAnnotation = Omit<DeepPartial<ICommonAnnotationsData>, 'annotationAxis'> & {
|
|
790
1378
|
[key: string]: unknown;
|
|
1379
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
791
1380
|
annotationAxis?: string;
|
|
1381
|
+
/** Chart or annotation kind. */
|
|
792
1382
|
type?: string;
|
|
1383
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
793
1384
|
value?: number | string | null;
|
|
794
1385
|
};
|
|
795
1386
|
|
|
1387
|
+
/** Compatibility input for a BarChart axis. */
|
|
796
1388
|
declare type ILooseBarAxis = Omit<DeepPartial<ICommonAxis<string>>, 'gridLines'> & {
|
|
797
1389
|
[key: string]: unknown;
|
|
1390
|
+
/** Grid-line configuration for this axis. */
|
|
798
1391
|
gridLines?: unknown;
|
|
799
1392
|
};
|
|
800
1393
|
|
|
1394
|
+
/** Permissive annotation input normalized by LineChart. */
|
|
801
1395
|
declare type ILooseLineAnnotation = {
|
|
802
1396
|
[key: string]: unknown;
|
|
1397
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
803
1398
|
id?: string;
|
|
1399
|
+
/** Display text associated with this element. */
|
|
804
1400
|
label?: string;
|
|
1401
|
+
/** Canvas/CSS colour used by this element. */
|
|
805
1402
|
color?: string;
|
|
1403
|
+
/** Canvas colour used for the element outline. */
|
|
806
1404
|
borderColor?: string;
|
|
1405
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
807
1406
|
backgroundColor?: string;
|
|
1407
|
+
/** Outline width in canvas pixels. */
|
|
808
1408
|
borderWidth?: number;
|
|
1409
|
+
/** Whether this element is visible. */
|
|
809
1410
|
display?: boolean;
|
|
1411
|
+
/** Whether this annotation may expand the scale bounds to remain visible. */
|
|
810
1412
|
adjustScaleRange?: boolean;
|
|
1413
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
811
1414
|
opacity?: number;
|
|
1415
|
+
/** Excludes this entry from the legend where supported. */
|
|
812
1416
|
hideLegend?: boolean;
|
|
1417
|
+
/** Pixel offset between the label and its associated geometry. */
|
|
813
1418
|
labelOffsetPx?: number;
|
|
1419
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
814
1420
|
annotationAxis?: string;
|
|
1421
|
+
/** Chart or annotation kind. */
|
|
815
1422
|
type?: string;
|
|
1423
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
816
1424
|
value?: number | string | null;
|
|
1425
|
+
/** Lower X bound in scale units. */
|
|
817
1426
|
xMin?: number | string | null;
|
|
1427
|
+
/** Upper X bound in scale units. */
|
|
818
1428
|
xMax?: number | string | null;
|
|
1429
|
+
/** Lower Y bound in scale units. */
|
|
819
1430
|
yMin?: number | string | null;
|
|
1431
|
+
/** Upper Y bound in scale units. */
|
|
820
1432
|
yMax?: number | string | null;
|
|
1433
|
+
/** X coordinate in scale units. */
|
|
821
1434
|
xValue?: number | string | null;
|
|
1435
|
+
/** Y coordinate in scale units. */
|
|
822
1436
|
yValue?: number | string | null;
|
|
1437
|
+
/** Called when a drag starts. */
|
|
823
1438
|
onDragStart?: (...args: unknown[]) => void;
|
|
1439
|
+
/** Called as the dragged value or annotation position changes. */
|
|
824
1440
|
onDrag?: (...args: unknown[]) => void;
|
|
1441
|
+
/** Called when dragging ends. */
|
|
825
1442
|
onDragEnd?: (...args: unknown[]) => void;
|
|
826
1443
|
};
|
|
827
1444
|
|
|
1445
|
+
/** Compatibility input for a LineChart axis; known fields are normalized before rendering. */
|
|
828
1446
|
declare type ILooseLineAxis = Omit<DeepPartial<ILineChartAxis<string>>, 'gridLines'> & {
|
|
829
1447
|
[key: string]: unknown;
|
|
1448
|
+
/** Requested spacing between axis ticks, in scale units. */
|
|
830
1449
|
stepSize?: unknown;
|
|
1450
|
+
/** Grid-line configuration for this axis. */
|
|
831
1451
|
gridLines?: unknown;
|
|
832
1452
|
};
|
|
833
1453
|
|
|
1454
|
+
/** Compatibility annotation input normalized by ScatterChart. */
|
|
834
1455
|
declare type ILooseScatterAnnotation = Omit<DeepPartial<ICommonAnnotationsData>, 'annotationAxis'> & {
|
|
835
1456
|
[key: string]: unknown;
|
|
1457
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
836
1458
|
annotationAxis?: string;
|
|
1459
|
+
/** Chart or annotation kind. */
|
|
837
1460
|
type?: string;
|
|
1461
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
838
1462
|
value?: number | string | null;
|
|
839
1463
|
};
|
|
840
1464
|
|
|
1465
|
+
/** Compatibility input for a ScatterChart axis. */
|
|
841
1466
|
declare type ILooseScatterAxis = DeepPartial<ICommonAxis<string>> & {
|
|
842
1467
|
[key: string]: unknown;
|
|
843
1468
|
};
|
|
844
1469
|
|
|
845
1470
|
/**
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
1471
|
+
* Updates the shared chart configuration, including the language and translated control labels.
|
|
1472
|
+
*
|
|
1473
|
+
* Call during application setup before rendering charts. Configuration is shared across chart instances;
|
|
1474
|
+
* this is not a per-chart configuration API. Each call sets the language key (default `en`) and updates
|
|
1475
|
+
* the supplied configuration entries. Non-primitive entries other than translations are shallow-copied.
|
|
1476
|
+
*
|
|
1477
|
+
* @param options - Language key, translations and other shared configuration entries.
|
|
1478
|
+
* @example
|
|
1479
|
+
* ```ts
|
|
1480
|
+
* initializeLineChart({ languageKey: 'en' });
|
|
1481
|
+
* ```
|
|
852
1482
|
*/
|
|
853
1483
|
export declare const initializeLineChart: ({ languageKey, ...options }: {
|
|
854
1484
|
[x: string]: any;
|
|
855
1485
|
languageKey?: string | undefined;
|
|
856
1486
|
}) => void;
|
|
857
1487
|
|
|
1488
|
+
/** Normalized PieChart input structure. */
|
|
858
1489
|
export declare interface IPieChartData extends ICommonData {
|
|
1490
|
+
/** Values rendered by the chart or DS. */
|
|
859
1491
|
data: IPieData;
|
|
1492
|
+
/** Configuration for this chart or generated element. */
|
|
860
1493
|
options: IPieOptions;
|
|
861
1494
|
}
|
|
862
1495
|
|
|
1496
|
+
/** Consumer-facing PieChart configuration; point input accepts numbers or partial value objects. */
|
|
863
1497
|
export declare interface IPieChartDataInput extends Omit<IPieChartData, 'data' | 'options'> {
|
|
1498
|
+
/** Values rendered by the chart or DS. */
|
|
864
1499
|
data?: Omit<DeepPartial<IPieChartData['data']>, 'datasets'> & {
|
|
1500
|
+
/** DS definitions in rendering order. */
|
|
865
1501
|
datasets?: Array<(Omit<DeepPartial<IPieChartDataset>, 'data'> & {
|
|
1502
|
+
/** Values rendered by the chart or DS. */
|
|
866
1503
|
data?: Array<DeepPartial<IPieDataValue> | number>;
|
|
867
1504
|
[key: string]: unknown;
|
|
868
1505
|
}) | object | null>;
|
|
869
1506
|
};
|
|
1507
|
+
/** Configuration for this chart or generated element. */
|
|
870
1508
|
options?: IPieOptionsInput;
|
|
871
1509
|
}
|
|
872
1510
|
|
|
1511
|
+
/** Input pie DS containing object-form values. */
|
|
873
1512
|
export declare interface IPieChartDataset extends ICommonDataset {
|
|
1513
|
+
/** Values rendered by the chart or DS. */
|
|
874
1514
|
data: IPieDataValue[];
|
|
1515
|
+
/** Excludes this entry from the legend where supported. */
|
|
875
1516
|
hideLegend?: boolean;
|
|
876
1517
|
}
|
|
877
1518
|
|
|
1519
|
+
/** Props accepted by the PieChart React component. */
|
|
878
1520
|
export declare interface IPieChartProps {
|
|
1521
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
879
1522
|
chart: IPieChartDataInput;
|
|
1523
|
+
/** Legacy top-level field; use `chart.testId`, which is read by the component normalizer. */
|
|
880
1524
|
testId?: string | null;
|
|
881
1525
|
}
|
|
882
1526
|
|
|
1527
|
+
/** Pie labels, DS definitions and legacy unit metadata. */
|
|
883
1528
|
export declare interface IPieData {
|
|
1529
|
+
/** Labels associated with the input data. */
|
|
884
1530
|
labels?: string[];
|
|
1531
|
+
/** DS definitions in rendering order. */
|
|
885
1532
|
datasets?: IPieChartDataset[];
|
|
1533
|
+
/** Legacy X-unit metadata on the input data object. */
|
|
886
1534
|
xUnit?: string;
|
|
1535
|
+
/** Legacy Y-unit metadata on the input data object. */
|
|
887
1536
|
yUnit?: string;
|
|
888
1537
|
}
|
|
889
1538
|
|
|
1539
|
+
/** Object-form pie value with optional display styling and related labels. */
|
|
890
1540
|
export declare interface IPieDataValue extends ICommonDataValue {
|
|
1541
|
+
/** Display text associated with this element. */
|
|
891
1542
|
label: string;
|
|
1543
|
+
/** Outline width in canvas pixels. */
|
|
892
1544
|
borderWidth: string | number;
|
|
1545
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
893
1546
|
value: number;
|
|
1547
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
894
1548
|
backgroundColor?: string | string[];
|
|
1549
|
+
/** Canvas colour used for the element outline. */
|
|
895
1550
|
borderColor?: string;
|
|
1551
|
+
/** Labels associated with the input data. */
|
|
896
1552
|
labels: string[];
|
|
897
1553
|
}
|
|
898
1554
|
|
|
1555
|
+
/** PieChart alias for generated legend label metadata. */
|
|
899
1556
|
export declare type IPieGeneratedLabel = IChartGeneratedLabel;
|
|
900
1557
|
|
|
1558
|
+
/** Pie geometry and data-label rendering options. */
|
|
901
1559
|
export declare interface IPieGraph {
|
|
1560
|
+
/** Draws labels on data elements. */
|
|
902
1561
|
showDataLabels?: boolean;
|
|
1562
|
+
/** Enables stacked rendering where supported. */
|
|
903
1563
|
stacked?: boolean;
|
|
1564
|
+
/** Inner radius of the pie: a pixel value or percentage string. Defaults to 0. */
|
|
904
1565
|
cutout?: number | string;
|
|
905
1566
|
}
|
|
906
1567
|
|
|
1568
|
+
/** PieChart legend configuration and DS-based visibility filtering. */
|
|
907
1569
|
export declare interface IPieLegend extends ICommonLegend {
|
|
1570
|
+
/** Filters legend items using `hideLegend` on the DS at the corresponding item index. */
|
|
908
1571
|
useDataset?: boolean;
|
|
909
1572
|
}
|
|
910
1573
|
|
|
1574
|
+
/** PieChart alias for legend visibility metadata. */
|
|
911
1575
|
export declare type IPieLegendItemFilter = IChartLegendItemFilter;
|
|
912
1576
|
|
|
1577
|
+
/** PieChart-specific options layered over the common chart options. */
|
|
913
1578
|
export declare interface IPieOptions extends ICommonOptions {
|
|
1579
|
+
/** Geometry, grid and data-label rendering options. */
|
|
914
1580
|
graph?: IPieGraph;
|
|
1581
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
915
1582
|
legend?: IPieLegend;
|
|
1583
|
+
/** Compatibility field; pie charts do not render Cartesian axes. */
|
|
916
1584
|
axes?: unknown;
|
|
917
1585
|
[key: string]: unknown;
|
|
918
1586
|
}
|
|
919
1587
|
|
|
1588
|
+
/**
|
|
1589
|
+
* Partial PieChart options accepted at the component boundary.
|
|
1590
|
+
* Only settings supported by the pie normalizer affect rendering.
|
|
1591
|
+
*/
|
|
920
1592
|
export declare type IPieOptionsInput = Omit<DeepPartial<IPieOptions>, 'title' | 'graph' | 'legend' | 'chartStyling' | 'tooltip' | 'chartOptions' | 'interactions'> & {
|
|
921
1593
|
[key: string]: unknown;
|
|
1594
|
+
/** Chart title; an array represents multiple lines. */
|
|
922
1595
|
title?: unknown;
|
|
1596
|
+
/** Geometry, grid and data-label rendering options. */
|
|
923
1597
|
graph?: DeepPartial<IPieGraph>;
|
|
1598
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
924
1599
|
legend?: Omit<DeepPartial<IPieLegend>, 'position' | 'align'> & {
|
|
1600
|
+
/** Visual placement of this element; does not select LineChart tooltip axes. */
|
|
925
1601
|
position?: string;
|
|
1602
|
+
/** Alignment within the available layout space. */
|
|
926
1603
|
align?: string;
|
|
927
1604
|
[key: string]: unknown;
|
|
928
1605
|
};
|
|
1606
|
+
/** Chart sizing and visual layout settings. */
|
|
929
1607
|
chartStyling?: DeepPartial<ICommonStyling> & {
|
|
930
1608
|
[key: string]: unknown;
|
|
931
1609
|
};
|
|
1610
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
932
1611
|
tooltip?: DeepPartial<ICommonTooltip>;
|
|
1612
|
+
/** Initial interaction and rendering controls. */
|
|
933
1613
|
chartOptions?: DeepPartial<ICommonChartOptions>;
|
|
1614
|
+
/** Callbacks for legend and pointer interactions. */
|
|
934
1615
|
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
935
1616
|
[key: string]: unknown;
|
|
936
1617
|
};
|
|
937
1618
|
};
|
|
938
1619
|
|
|
1620
|
+
/** PieChart alias for data-label plugin settings. */
|
|
939
1621
|
export declare type IPiesDataLabelsOptions = IChartDataLabelsOptions;
|
|
940
1622
|
|
|
1623
|
+
/** Ordered horizontal and vertical ScatterChart axis collections. */
|
|
941
1624
|
export declare interface IScatterAxes {
|
|
1625
|
+
/** Horizontal axis definitions in order. */
|
|
942
1626
|
x: ICommonAxis<'top' | 'bottom'>[];
|
|
1627
|
+
/** Vertical axis definitions in order. */
|
|
943
1628
|
y: ICommonAxis<'left' | 'right'>[];
|
|
944
1629
|
[key: string]: ICommonAxis[];
|
|
945
1630
|
}
|
|
946
1631
|
|
|
1632
|
+
/** Normalized ScatterChart input structure. */
|
|
947
1633
|
export declare interface IScatterChartData extends ICommonData {
|
|
1634
|
+
/** Values rendered by the chart or DS. */
|
|
948
1635
|
data: IScatterData;
|
|
1636
|
+
/** Configuration for this chart or generated element. */
|
|
949
1637
|
options: IScatterOptions;
|
|
950
1638
|
}
|
|
951
1639
|
|
|
1640
|
+
/** Consumer-facing ScatterChart configuration with optional datasets and options. */
|
|
952
1641
|
export declare interface IScatterChartDataInput extends Omit<IScatterChartData, 'data' | 'options'> {
|
|
1642
|
+
/** Values rendered by the chart or DS. */
|
|
953
1643
|
data?: Omit<DeepPartial<IScatterChartData['data']>, 'datasets'> & {
|
|
1644
|
+
/** DS definitions in rendering order. */
|
|
954
1645
|
datasets?: Array<DeepPartial<IScatterChartDataset> | object | null>;
|
|
955
1646
|
};
|
|
1647
|
+
/** Configuration for this chart or generated element. */
|
|
956
1648
|
options?: IScatterOptionsInput;
|
|
957
1649
|
}
|
|
958
1650
|
|
|
1651
|
+
/** Input scatter DS and its legend visibility. */
|
|
959
1652
|
export declare interface IScatterChartDataset extends ICommonDataset {
|
|
1653
|
+
/** Values rendered by the chart or DS. */
|
|
960
1654
|
data: IScatterDataValue[];
|
|
1655
|
+
/** Excludes this entry from the legend where supported. */
|
|
961
1656
|
hideLegend?: boolean;
|
|
962
1657
|
}
|
|
963
1658
|
|
|
1659
|
+
/** Props accepted by the ScatterChart React component. */
|
|
964
1660
|
export declare interface IScatterChartProps {
|
|
1661
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
965
1662
|
chart: IScatterChartDataInput;
|
|
1663
|
+
/** Legacy top-level field; use `chart.testId`, which is read by the component normalizer. */
|
|
966
1664
|
testId?: string | null;
|
|
967
1665
|
}
|
|
968
1666
|
|
|
1667
|
+
/** Scatter labels, DS definitions and legacy unit metadata. */
|
|
969
1668
|
export declare interface IScatterData {
|
|
1669
|
+
/** Labels associated with the input data. */
|
|
970
1670
|
labels?: string[];
|
|
1671
|
+
/** DS definitions in rendering order. */
|
|
971
1672
|
datasets?: IScatterChartDataset[];
|
|
1673
|
+
/** Legacy X-unit metadata on the input data object. */
|
|
972
1674
|
xUnit?: string;
|
|
1675
|
+
/** Legacy Y-unit metadata on the input data object. */
|
|
973
1676
|
yUnit?: string;
|
|
974
1677
|
}
|
|
975
1678
|
|
|
1679
|
+
/** ScatterChart alias for data-label plugin settings. */
|
|
976
1680
|
export declare type IScatterDataLabelsOptions = IChartDataLabelsOptions;
|
|
977
1681
|
|
|
1682
|
+
/** A scatter point with an optional display label. */
|
|
978
1683
|
export declare interface IScatterDataValue extends ICommonDataValue {
|
|
1684
|
+
/** Display text associated with this element. */
|
|
979
1685
|
label?: string;
|
|
980
1686
|
}
|
|
981
1687
|
|
|
1688
|
+
/** ScatterChart alias for generated legend label metadata. */
|
|
982
1689
|
export declare type IScatterGeneratedLabel = IChartGeneratedLabel;
|
|
983
1690
|
|
|
1691
|
+
/** ScatterChart grid and data-label rendering options. */
|
|
984
1692
|
export declare interface IScatterGraph {
|
|
1693
|
+
/** Draws intermediate grid lines between the main ticks. */
|
|
985
1694
|
showMinorGridlines?: boolean;
|
|
1695
|
+
/** Draws labels on data elements. */
|
|
986
1696
|
showDataLabels?: boolean;
|
|
987
1697
|
}
|
|
988
1698
|
|
|
1699
|
+
/** ScatterChart legend configuration and compatibility flags. */
|
|
989
1700
|
export declare interface IScatterLegend extends ICommonLegend {
|
|
1701
|
+
/** Compatibility flag retained by the normalizer; currently does not change ScatterChart legend rendering. */
|
|
990
1702
|
useDataset?: boolean;
|
|
991
1703
|
}
|
|
992
1704
|
|
|
1705
|
+
/** ScatterChart alias for legend visibility metadata. */
|
|
993
1706
|
export declare type IScatterLegendItemFilter = IChartLegendItemFilter;
|
|
994
1707
|
|
|
1708
|
+
/** ScatterChart options layered over common Cartesian settings. */
|
|
995
1709
|
export declare interface IScatterOptions extends ICommonOptions {
|
|
1710
|
+
/** Geometry, grid and data-label rendering options. */
|
|
996
1711
|
graph?: IScatterGraph;
|
|
1712
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
997
1713
|
legend?: IScatterLegend;
|
|
1714
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
998
1715
|
axes?: IScatterAxes;
|
|
1716
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
999
1717
|
scales?: ICommonScales;
|
|
1718
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
1000
1719
|
additionalAxesOptions?: ICommonAdditionalAxesOptions;
|
|
1720
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
1001
1721
|
direction?: ChartDirection;
|
|
1002
1722
|
}
|
|
1003
1723
|
|
|
1724
|
+
/**
|
|
1725
|
+
* Partial ScatterChart options accepted at the component boundary.
|
|
1726
|
+
* Unknown fields are accepted for compatibility, not guaranteed to be forwarded.
|
|
1727
|
+
*/
|
|
1004
1728
|
export declare type IScatterOptionsInput = Omit<DeepPartial<IScatterOptions>, 'title' | 'direction' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'annotations' | 'scales'> & {
|
|
1005
1729
|
[key: string]: unknown;
|
|
1730
|
+
/** Chart title; an array represents multiple lines. */
|
|
1006
1731
|
title?: unknown;
|
|
1732
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
1007
1733
|
direction?: string;
|
|
1734
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
1008
1735
|
axes?: {
|
|
1736
|
+
/** Horizontal axis definitions in order. */
|
|
1009
1737
|
x?: ILooseScatterAxis[];
|
|
1738
|
+
/** Vertical axis definitions in order. */
|
|
1010
1739
|
y?: ILooseScatterAxis[];
|
|
1011
1740
|
[key: string]: ILooseScatterAxis[] | undefined;
|
|
1012
1741
|
};
|
|
1742
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
1013
1743
|
scales?: Record<string, unknown>;
|
|
1744
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
1014
1745
|
legend?: Omit<DeepPartial<IScatterLegend>, 'position' | 'align'> & {
|
|
1746
|
+
/** Visual placement of this element; does not select LineChart tooltip axes. */
|
|
1015
1747
|
position?: string;
|
|
1748
|
+
/** Alignment within the available layout space. */
|
|
1016
1749
|
align?: string;
|
|
1017
1750
|
[key: string]: unknown;
|
|
1018
1751
|
};
|
|
1752
|
+
/** Chart sizing and visual layout settings. */
|
|
1019
1753
|
chartStyling?: {
|
|
1020
1754
|
[key: string]: unknown;
|
|
1021
1755
|
};
|
|
1756
|
+
/** Callbacks for legend and pointer interactions. */
|
|
1022
1757
|
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
1758
|
+
/** Compatibility interaction input; configure zoom through `chartOptions.enableZoom`. */
|
|
1023
1759
|
enableZoom?: boolean;
|
|
1760
|
+
/** Compatibility interaction input; configure pan through `chartOptions.enablePan`. */
|
|
1024
1761
|
enablePan?: boolean;
|
|
1025
1762
|
[key: string]: unknown;
|
|
1026
1763
|
};
|
|
1764
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
1027
1765
|
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
1766
|
+
/** Annotation definitions in drawing order. */
|
|
1028
1767
|
annotationsData?: ILooseScatterAnnotation[];
|
|
1029
1768
|
}) | null;
|
|
1030
1769
|
};
|
|
1031
1770
|
|
|
1771
|
+
/** ScatterChart tooltip settings resolved by its default-props helper. */
|
|
1032
1772
|
export declare interface IScatterTooltip {
|
|
1773
|
+
/** Whether this feature is active. */
|
|
1033
1774
|
enabled?: boolean;
|
|
1775
|
+
/** Enables hover tooltips. Defaults to true. */
|
|
1034
1776
|
tooltips?: boolean;
|
|
1777
|
+
/** Includes the optional point label in supported tooltips. Defaults to false. */
|
|
1035
1778
|
showLabelsInTooltips: boolean;
|
|
1779
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
1036
1780
|
backgroundColor?: string;
|
|
1781
|
+
/** Whether the tooltip includes colour swatches. */
|
|
1037
1782
|
displayColors?: boolean;
|
|
1783
|
+
/** Allows scientific notation when formatting tooltip numbers. Defaults to true. */
|
|
1038
1784
|
scientificNotation?: boolean;
|
|
1039
1785
|
}
|
|
1040
1786
|
|
|
1787
|
+
/** Consumer-owned unit selector configuration. Selecting a unit does not itself convert input data. */
|
|
1041
1788
|
export declare interface IUnitOptions {
|
|
1789
|
+
/** Available unit identifiers shown in the selector. */
|
|
1042
1790
|
options: string[];
|
|
1791
|
+
/** Currently selected unit identifier. */
|
|
1043
1792
|
selectedUnit: string;
|
|
1793
|
+
/** Notifies the consumer when another unit is selected; the consumer owns the selection. */
|
|
1044
1794
|
setSelectedUnit: (value: string) => void;
|
|
1045
1795
|
}
|
|
1046
1796
|
|
|
1797
|
+
/** Keyboard modifier identifiers used by chart interactions. */
|
|
1047
1798
|
export declare enum Key {
|
|
1048
1799
|
Shift = "Shift"
|
|
1049
1800
|
}
|
|
1050
1801
|
|
|
1802
|
+
/**
|
|
1803
|
+
* Renders an interactive line chart with multiple axes, annotations, a legend and chart controls.
|
|
1804
|
+
*
|
|
1805
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1806
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1807
|
+
*
|
|
1808
|
+
* @remarks
|
|
1809
|
+
* Defaults: bottom X axis, left Y axis, visible lines and points, bottom-left legend, and zoom enabled.
|
|
1810
|
+
* Pan, data labels, minor grid lines and annotations are disabled. No fixed width or height is assigned.
|
|
1811
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1812
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1813
|
+
*
|
|
1814
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#linechart
|
|
1815
|
+
*
|
|
1816
|
+
* @param props - Chart data and options, plus optional header, subheader and table content.
|
|
1817
|
+
* @returns The chart canvas and its associated UI.
|
|
1818
|
+
* @example
|
|
1819
|
+
* ```tsx
|
|
1820
|
+
* <LineChart chart={{
|
|
1821
|
+
* data: {
|
|
1822
|
+
* datasets: [{
|
|
1823
|
+
* label: 'DS A',
|
|
1824
|
+
* data: [{ x: 0, y: 10 }, { x: 1, y: 20 }, { x: 2, y: 15 }],
|
|
1825
|
+
* }],
|
|
1826
|
+
* },
|
|
1827
|
+
* options: {
|
|
1828
|
+
* axes: {
|
|
1829
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
1830
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
1831
|
+
* },
|
|
1832
|
+
* chartStyling: { height: 320 },
|
|
1833
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
1834
|
+
* graph: { lineTension: 0.01, showDataLabels: false },
|
|
1835
|
+
* chartOptions: { showLine: true, showPoints: true },
|
|
1836
|
+
* },
|
|
1837
|
+
* }} />
|
|
1838
|
+
* ```
|
|
1839
|
+
*/
|
|
1051
1840
|
export declare const LineChart: (props: ILineChartProps) => JSX.Element;
|
|
1052
1841
|
|
|
1842
|
+
/** Orientation of a line marker. */
|
|
1053
1843
|
export declare enum LineMarkerDirection {
|
|
1054
1844
|
Vertical = "vertical",
|
|
1055
1845
|
Horizontal = "horizontal"
|
|
1056
1846
|
}
|
|
1057
1847
|
|
|
1848
|
+
/** Label placement relative to a line marker. */
|
|
1058
1849
|
export declare enum LineMarkerLabelPosition {
|
|
1059
1850
|
Left = "left",
|
|
1060
1851
|
Right = "right",
|
|
@@ -1063,17 +1854,20 @@ export declare enum LineMarkerLabelPosition {
|
|
|
1063
1854
|
OnLine = "onLine"
|
|
1064
1855
|
}
|
|
1065
1856
|
|
|
1857
|
+
/** Left/right attachment side for line markers. */
|
|
1066
1858
|
export declare enum LineMarkerSide {
|
|
1067
1859
|
Left = "left",
|
|
1068
1860
|
Right = "right"
|
|
1069
1861
|
}
|
|
1070
1862
|
|
|
1863
|
+
/** Horizontal alignment of marker label text. */
|
|
1071
1864
|
export declare enum LineMarkerTextAlign {
|
|
1072
1865
|
Left = "left",
|
|
1073
1866
|
Right = "right",
|
|
1074
1867
|
Center = "center"
|
|
1075
1868
|
}
|
|
1076
1869
|
|
|
1870
|
+
/** Interaction mode identifiers; availability depends on the chart controls. */
|
|
1077
1871
|
export declare enum PanZoomMode {
|
|
1078
1872
|
X = "x",
|
|
1079
1873
|
Y = "y",
|
|
@@ -1081,8 +1875,44 @@ export declare enum PanZoomMode {
|
|
|
1081
1875
|
Z = "z"
|
|
1082
1876
|
}
|
|
1083
1877
|
|
|
1878
|
+
/**
|
|
1879
|
+
* Renders pie segments with optional data labels, a legend and an inner cutout.
|
|
1880
|
+
*
|
|
1881
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1882
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1883
|
+
*
|
|
1884
|
+
* @remarks
|
|
1885
|
+
* Defaults: a full pie (cutout 0), a bottom legend, and no fixed width or height.
|
|
1886
|
+
* Data labels, stacking, zoom and pan are disabled. Pie charts do not have Cartesian axes.
|
|
1887
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1888
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1889
|
+
*
|
|
1890
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#piechart
|
|
1891
|
+
*
|
|
1892
|
+
* @param props - Chart data and options.
|
|
1893
|
+
* @returns The chart canvas and its associated UI.
|
|
1894
|
+
* @example
|
|
1895
|
+
* ```tsx
|
|
1896
|
+
* <PieChart chart={{
|
|
1897
|
+
* data: {
|
|
1898
|
+
* labels: ['A', 'B', 'C'],
|
|
1899
|
+
* datasets: [{
|
|
1900
|
+
* label: 'DS A',
|
|
1901
|
+
* data: [10, 20, 15],
|
|
1902
|
+
* backgroundColor: ['#3366cc', '#dc3912', '#ff9900'],
|
|
1903
|
+
* }],
|
|
1904
|
+
* },
|
|
1905
|
+
* options: {
|
|
1906
|
+
* chartStyling: { height: 320 },
|
|
1907
|
+
* legend: { display: true, position: 'bottom' },
|
|
1908
|
+
* graph: { cutout: 0, showDataLabels: false },
|
|
1909
|
+
* },
|
|
1910
|
+
* }} />
|
|
1911
|
+
* ```
|
|
1912
|
+
*/
|
|
1084
1913
|
export declare const PieChart: (props: IPieChartProps) => JSX.Element;
|
|
1085
1914
|
|
|
1915
|
+
/** Point marker shapes compatible with Chart.js. */
|
|
1086
1916
|
export declare enum PointStyle {
|
|
1087
1917
|
Circle = "circle",
|
|
1088
1918
|
Square = "rect",
|
|
@@ -1090,10 +1920,12 @@ export declare enum PointStyle {
|
|
|
1090
1920
|
Triangle = "triangle"
|
|
1091
1921
|
}
|
|
1092
1922
|
|
|
1923
|
+
/** Legacy point classification identifiers. */
|
|
1093
1924
|
export declare enum PointType {
|
|
1094
1925
|
Casing = "casing"
|
|
1095
1926
|
}
|
|
1096
1927
|
|
|
1928
|
+
/** Legend/layout positions. Individual options accept only the positions relevant to their layout. */
|
|
1097
1929
|
export declare enum Position {
|
|
1098
1930
|
Bottom = "bottom",
|
|
1099
1931
|
Top = "top",
|
|
@@ -1105,6 +1937,7 @@ export declare enum Position {
|
|
|
1105
1937
|
BottomRight = "bottom-right"
|
|
1106
1938
|
}
|
|
1107
1939
|
|
|
1940
|
+
/** Chart.js scale-family identifiers. */
|
|
1108
1941
|
export declare enum ScaleType {
|
|
1109
1942
|
Category = "category",
|
|
1110
1943
|
Linear = "linear",
|
|
@@ -1113,123 +1946,259 @@ export declare enum ScaleType {
|
|
|
1113
1946
|
TimeSeries = "timeseries"
|
|
1114
1947
|
}
|
|
1115
1948
|
|
|
1949
|
+
/**
|
|
1950
|
+
* Renders Cartesian points with a legend, optional annotations and a background gradient.
|
|
1951
|
+
*
|
|
1952
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1953
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1954
|
+
*
|
|
1955
|
+
* @remarks
|
|
1956
|
+
* Defaults: automatic width and height, a bottom-left legend, zero included in automatic scale bounds,
|
|
1957
|
+
* and annotations enabled. Zoom, pan, data labels, minor grid lines and the background gradient are disabled.
|
|
1958
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1959
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1960
|
+
*
|
|
1961
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#scatterchart
|
|
1962
|
+
*
|
|
1963
|
+
* @param props - Chart data and options.
|
|
1964
|
+
* @returns The chart canvas and its associated UI.
|
|
1965
|
+
* @example
|
|
1966
|
+
* ```tsx
|
|
1967
|
+
* <ScatterChart chart={{
|
|
1968
|
+
* data: {
|
|
1969
|
+
* datasets: [{
|
|
1970
|
+
* label: 'DS A',
|
|
1971
|
+
* data: [{ x: 1, y: 10 }, { x: 2, y: 20 }, { x: 3, y: 15 }],
|
|
1972
|
+
* }],
|
|
1973
|
+
* },
|
|
1974
|
+
* options: {
|
|
1975
|
+
* axes: {
|
|
1976
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
1977
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
1978
|
+
* },
|
|
1979
|
+
* chartStyling: { height: 320 },
|
|
1980
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
1981
|
+
* graph: { showDataLabels: false, showMinorGridlines: false },
|
|
1982
|
+
* },
|
|
1983
|
+
* }} />
|
|
1984
|
+
* ```
|
|
1985
|
+
*/
|
|
1116
1986
|
export declare const ScatterChart: (props: IScatterChartProps) => JSX.Element;
|
|
1117
1987
|
|
|
1988
|
+
/** Allowed positions for a Cartesian axis. */
|
|
1118
1989
|
export declare type TAxisPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
1119
1990
|
|
|
1991
|
+
/** Chart.js instance types used by the library's Cartesian chart helpers. */
|
|
1120
1992
|
export declare type TChart = Chart<'bar', ICommonDataValue[]> | Chart<'line', ICommonDataValue[]> | Chart<'scatter', ICommonDataValue[]>;
|
|
1121
1993
|
|
|
1994
|
+
/** Generated BarChart DS collection. */
|
|
1122
1995
|
export declare type TGenerateBarChartDatasets = IGenerateBarChartDataset[];
|
|
1123
1996
|
|
|
1997
|
+
/** Generated LineChart DS collection. */
|
|
1124
1998
|
export declare type TGeneratedLineChartDatasets = IGeneratedLineChartDataset[];
|
|
1125
1999
|
|
|
2000
|
+
/** Generated PieChart DS collection. */
|
|
1126
2001
|
export declare type TGeneratedPieChartDatasets = IGeneratedPieChartDataset[];
|
|
1127
2002
|
|
|
2003
|
+
/** Generated ScatterChart DS collection. */
|
|
1128
2004
|
export declare type TGeneratedScatterChartDatasets = IGeneratedScatterChartDataset[];
|
|
1129
2005
|
|
|
2006
|
+
/** Orientation accepted by marker items. */
|
|
1130
2007
|
export declare type TLineMarkerDirection = LineMarkerDirection;
|
|
1131
2008
|
|
|
2009
|
+
/**
|
|
2010
|
+
* One marker with optional endpoints, ticks and labels.
|
|
2011
|
+
* Item settings override the shared {@link TLineMarkersOptions} values.
|
|
2012
|
+
*/
|
|
1132
2013
|
export declare type TLineMarkerItem = {
|
|
2014
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
1133
2015
|
id?: string;
|
|
2016
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
1134
2017
|
direction?: TLineMarkerDirection;
|
|
2018
|
+
/** Horizontal Chart.js scale ID used to resolve annotation coordinates. */
|
|
1135
2019
|
xScaleID?: string;
|
|
2020
|
+
/** Vertical Chart.js scale ID used to resolve annotation coordinates. */
|
|
1136
2021
|
yScaleID?: string;
|
|
2022
|
+
/** X coordinate in scale units. */
|
|
1137
2023
|
xValue?: number;
|
|
2024
|
+
/** Y coordinate in scale units. */
|
|
1138
2025
|
yValue?: number;
|
|
2026
|
+
/** Vertical start coordinate in scale units. */
|
|
1139
2027
|
yStartValue?: number;
|
|
2028
|
+
/** Vertical end coordinate in scale units. */
|
|
1140
2029
|
yEndValue?: number;
|
|
2030
|
+
/** Horizontal start coordinate in scale units. */
|
|
1141
2031
|
xStartValue?: number;
|
|
2032
|
+
/** Horizontal end coordinate in scale units. */
|
|
1142
2033
|
xEndValue?: number;
|
|
2034
|
+
/** Explicit marker length in pixels instead of a span derived from axis values. */
|
|
1143
2035
|
lengthPx?: number;
|
|
2036
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
1144
2037
|
value?: number;
|
|
2038
|
+
/** Display text associated with this element. */
|
|
1145
2039
|
label?: string | string[];
|
|
2040
|
+
/** Canvas font specification used for the text. */
|
|
1146
2041
|
font?: string;
|
|
2042
|
+
/** Pixel offset between the label and its associated geometry. */
|
|
1147
2043
|
labelOffsetPx?: number;
|
|
2044
|
+
/** Attaches marker geometry to a chart edge. */
|
|
1148
2045
|
stickToEdge?: boolean;
|
|
2046
|
+
/** Aligns marker geometry to the shared group anchor. */
|
|
1149
2047
|
stickToGroup?: boolean;
|
|
2048
|
+
/** Chart edge used for attached markers. */
|
|
1150
2049
|
stickSide?: TStickSide;
|
|
2050
|
+
/** Additional pixel offset from the shared marker group anchor. */
|
|
1151
2051
|
groupOffsetPx?: number;
|
|
2052
|
+
/** Reverses the relevant scale or marker direction. */
|
|
1152
2053
|
reverse?: boolean;
|
|
2054
|
+
/** Canvas/CSS colour used by this element. */
|
|
1153
2055
|
color?: string;
|
|
2056
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
1154
2057
|
opacity?: number;
|
|
2058
|
+
/** Stroke width in canvas pixels. */
|
|
1155
2059
|
lineWidth?: number;
|
|
2060
|
+
/** Alternating marker dash and gap lengths in pixels. */
|
|
1156
2061
|
lineDash?: number[];
|
|
2062
|
+
/** Tick and label configuration for the marker start. */
|
|
1157
2063
|
startTick?: TLineMarkerTick;
|
|
2064
|
+
/** Tick and label configuration for the marker end. */
|
|
1158
2065
|
endTick?: TLineMarkerTick;
|
|
2066
|
+
/** Additional ticks or branches attached to this marker. */
|
|
1159
2067
|
extras?: TMarkerExtraItem[];
|
|
2068
|
+
/** Whether this element is visible. */
|
|
1160
2069
|
display?: boolean;
|
|
1161
2070
|
};
|
|
1162
2071
|
|
|
2072
|
+
/** Placement accepted by marker tick labels. */
|
|
1163
2073
|
export declare type TLineMarkerLabelPosition = LineMarkerLabelPosition;
|
|
1164
2074
|
|
|
2075
|
+
/**
|
|
2076
|
+
* Shared marker defaults and marker items.
|
|
2077
|
+
* Configure through `options.annotations.lineMarkersAnnotation`.
|
|
2078
|
+
*/
|
|
1165
2079
|
export declare type TLineMarkersOptions = {
|
|
2080
|
+
/** Whether this feature is active. */
|
|
1166
2081
|
enabled?: boolean;
|
|
2082
|
+
/** Spacing between grouped marker items in pixels. */
|
|
1167
2083
|
itemGapPx?: number;
|
|
2084
|
+
/** Gap between edge-attached markers and the chart boundary, in pixels. */
|
|
1168
2085
|
edgePaddingPx?: number;
|
|
2086
|
+
/** Default length of horizontal marker lines in pixels. */
|
|
1169
2087
|
horizontalLineLengthPx?: number;
|
|
2088
|
+
/** Default orientation for marker items. */
|
|
1170
2089
|
lineDirection?: TLineMarkerDirection;
|
|
2090
|
+
/** Vertical clearance used when resolving marker label overlaps, in pixels. */
|
|
1171
2091
|
labelCollisionPx?: number;
|
|
2092
|
+
/** Horizontal distance used to cluster potentially overlapping marker labels, in pixels. */
|
|
1172
2093
|
labelCollisionClusterXPx?: number;
|
|
2094
|
+
/** Adjusts marker label placement to reduce overlaps. */
|
|
1173
2095
|
enableLabelCollisionResolver?: boolean;
|
|
2096
|
+
/** Attaches marker geometry to a chart edge. */
|
|
1174
2097
|
stickToEdge?: boolean;
|
|
2098
|
+
/** Aligns marker geometry to the shared group anchor. */
|
|
1175
2099
|
stickToGroup?: boolean;
|
|
2100
|
+
/** Chart edge used for attached markers. */
|
|
1176
2101
|
stickSide?: TStickSide;
|
|
2102
|
+
/** Reverses the relevant scale or marker direction. */
|
|
1177
2103
|
reverse?: boolean;
|
|
2104
|
+
/** X coordinate in scale units. */
|
|
1178
2105
|
xValue?: number;
|
|
2106
|
+
/** Y coordinate in scale units. */
|
|
1179
2107
|
yValue?: number;
|
|
2108
|
+
/** Vertical end coordinate in scale units. */
|
|
1180
2109
|
yEndValue?: number;
|
|
2110
|
+
/** Horizontal start coordinate in scale units. */
|
|
1181
2111
|
xStartValue?: number;
|
|
2112
|
+
/** Horizontal end coordinate in scale units. */
|
|
1182
2113
|
xEndValue?: number;
|
|
2114
|
+
/** Explicit marker length in pixels instead of a span derived from axis values. */
|
|
1183
2115
|
lengthPx?: number;
|
|
2116
|
+
/** Vertical start coordinate in scale units. */
|
|
1184
2117
|
yStartValue?: number;
|
|
2118
|
+
/** Canvas/CSS colour used by this element. */
|
|
1185
2119
|
color?: string;
|
|
2120
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
1186
2121
|
opacity?: number;
|
|
2122
|
+
/** Stroke width in canvas pixels. */
|
|
1187
2123
|
lineWidth?: number;
|
|
2124
|
+
/** Alternating marker dash and gap lengths in pixels. */
|
|
1188
2125
|
lineDash?: number[];
|
|
2126
|
+
/** Tick and label configuration for the marker start. */
|
|
1189
2127
|
startTick?: TLineMarkerTick;
|
|
2128
|
+
/** Tick and label configuration for the marker end. */
|
|
1190
2129
|
endTick?: TLineMarkerTick;
|
|
2130
|
+
/** Marker definitions; item settings override the shared marker settings. */
|
|
1191
2131
|
items?: TLineMarkerItem[];
|
|
1192
2132
|
};
|
|
1193
2133
|
|
|
2134
|
+
/** Text alignment accepted by marker label helpers. */
|
|
1194
2135
|
export declare type TLineMarkerTextAlign = LineMarkerTextAlign;
|
|
1195
2136
|
|
|
2137
|
+
/** Tick styling and optional text at a marker endpoint. */
|
|
1196
2138
|
export declare type TLineMarkerTick = {
|
|
2139
|
+
/** Whether this feature is active. */
|
|
1197
2140
|
enabled?: boolean;
|
|
2141
|
+
/** Display text associated with this element. */
|
|
1198
2142
|
label?: string | string[];
|
|
2143
|
+
/** Canvas/CSS colour used by this element. */
|
|
1199
2144
|
color?: string;
|
|
2145
|
+
/** Canvas font specification used for the text. */
|
|
1200
2146
|
font?: string;
|
|
2147
|
+
/** Pixel offset between the label and its associated geometry. */
|
|
1201
2148
|
labelOffsetPx?: number;
|
|
2149
|
+
/** Label placement relative to the marker or tick. */
|
|
1202
2150
|
labelPosition?: TLineMarkerLabelPosition;
|
|
2151
|
+
/** Side on which the marker tick or branch is drawn. */
|
|
1203
2152
|
side?: TStickSide;
|
|
2153
|
+
/** Reverses the relevant scale or marker direction. */
|
|
1204
2154
|
reverse?: boolean;
|
|
2155
|
+
/** Tick size in pixels. */
|
|
1205
2156
|
sizePx?: number;
|
|
1206
2157
|
};
|
|
1207
2158
|
|
|
2159
|
+
/** Additional tick or branch attached to a line marker. */
|
|
1208
2160
|
export declare type TMarkerExtraItem = {
|
|
2161
|
+
/** Identifier used to associate this configuration with its rendered element. */
|
|
1209
2162
|
id?: string;
|
|
2163
|
+
/** Whether this element is visible. */
|
|
1210
2164
|
display?: boolean;
|
|
2165
|
+
/** Vertical Chart.js scale ID used to resolve annotation coordinates. */
|
|
1211
2166
|
yScaleID?: string;
|
|
2167
|
+
/** Y coordinate in scale units. */
|
|
1212
2168
|
yValue?: number;
|
|
2169
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
1213
2170
|
value?: number;
|
|
2171
|
+
/** Explicit marker length in pixels instead of a span derived from axis values. */
|
|
1214
2172
|
lengthPx?: number;
|
|
2173
|
+
/** Side on which the marker tick or branch is drawn. */
|
|
1215
2174
|
side?: TStickSide;
|
|
2175
|
+
/** Reverses the relevant scale or marker direction. */
|
|
1216
2176
|
reverse?: boolean;
|
|
2177
|
+
/** Canvas/CSS colour used by this element. */
|
|
1217
2178
|
color?: string;
|
|
2179
|
+
/** Opacity multiplier between 0 (transparent) and 1 (opaque). */
|
|
1218
2180
|
opacity?: number;
|
|
2181
|
+
/** Stroke width in canvas pixels. */
|
|
1219
2182
|
lineWidth?: number;
|
|
2183
|
+
/** Alternating marker dash and gap lengths in pixels. */
|
|
1220
2184
|
lineDash?: number[];
|
|
2185
|
+
/** Tick and label settings for this extra marker branch. */
|
|
1221
2186
|
tick?: TLineMarkerTick;
|
|
1222
2187
|
};
|
|
1223
2188
|
|
|
2189
|
+
/** Legacy tooltip label keys. */
|
|
1224
2190
|
export declare enum TooltipLabel {
|
|
1225
2191
|
Y = "yLabel",
|
|
1226
2192
|
X = "xLabel"
|
|
1227
2193
|
}
|
|
1228
2194
|
|
|
2195
|
+
/** Primitive configuration values excluding undefined. */
|
|
1229
2196
|
export declare type TPrimitive = string | number | boolean | null;
|
|
1230
2197
|
|
|
2198
|
+
/** Attachment side accepted by marker options. */
|
|
1231
2199
|
export declare type TStickSide = LineMarkerSide;
|
|
1232
2200
|
|
|
2201
|
+
/** Placeholder for a callback parameter whose runtime value is intentionally unspecified. */
|
|
1233
2202
|
export declare type UnusedParameter = unknown;
|
|
1234
2203
|
|
|
1235
2204
|
export { }
|
|
@@ -1237,25 +2206,25 @@ export { }
|
|
|
1237
2206
|
|
|
1238
2207
|
declare module 'chart.js' {
|
|
1239
2208
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1240
|
-
|
|
2209
|
+
lineMarkersPlugin?: {
|
|
2210
|
+
enabled?: boolean;
|
|
2211
|
+
} | TLineMarkersOptions;
|
|
1241
2212
|
}
|
|
1242
2213
|
}
|
|
1243
2214
|
|
|
1244
2215
|
|
|
1245
2216
|
declare module 'chart.js' {
|
|
1246
2217
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1247
|
-
|
|
1248
|
-
enableCalloutAnnotation?: boolean;
|
|
1249
|
-
};
|
|
2218
|
+
annotationDraggerPlugin?: AnnotationDraggerPluginOptions;
|
|
1250
2219
|
}
|
|
1251
2220
|
}
|
|
1252
2221
|
|
|
1253
2222
|
|
|
1254
2223
|
declare module 'chart.js' {
|
|
1255
2224
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
}
|
|
2225
|
+
calloutConnectorPlugin?: {
|
|
2226
|
+
enableCalloutAnnotation?: boolean;
|
|
2227
|
+
};
|
|
1259
2228
|
}
|
|
1260
2229
|
}
|
|
1261
2230
|
|