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