-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.datasetController.d.ts
More file actions
251 lines (251 loc) · 7.18 KB
/
core.datasetController.d.ts
File metadata and controls
251 lines (251 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
export default class DatasetController {
/**
* @type {any}
*/
static defaults: any;
/**
* Element type used to generate a meta dataset (e.g. Chart.element.LineElement).
*/
static datasetElementType: any;
/**
* Element type used to generate a meta data (e.g. Chart.element.PointElement).
*/
static dataElementType: any;
/**
* @param {Chart} chart
* @param {number} datasetIndex
*/
constructor(chart: Chart, datasetIndex: number);
chart: import("./core.controller.js").default;
_ctx: any;
index: number;
_cachedDataOpts: {};
_cachedMeta: any;
_type: any;
options: any;
/** @type {boolean | object} */
_parsing: boolean | object;
_data: any;
_objectData: any;
_sharedOptions: any;
_drawStart: any;
_drawCount: any;
enableOptionSharing: boolean;
supportsDecimation: boolean;
$context: any;
_syncList: any[];
datasetElementType: any;
dataElementType: any;
initialize(): void;
updateIndex(datasetIndex: any): void;
linkScales(): void;
getDataset(): any;
getMeta(): any;
/**
* @param {string} scaleID
* @return {Scale}
*/
getScaleForId(scaleID: string): Scale;
/**
* @private
*/
private _getOtherScale;
reset(): void;
/**
* @private
*/
private _destroy;
/**
* @private
*/
private _dataCheck;
addElements(): void;
buildOrUpdateElements(resetNewElements: any): void;
/**
* Merges user-supplied and default dataset-level options
* @private
*/
private configure;
/**
* @param {number} start
* @param {number} count
*/
parse(start: number, count: number): void;
/**
* Parse array of primitive values
* @param {object} meta - dataset meta
* @param {array} data - data array. Example [1,3,4]
* @param {number} start - start index
* @param {number} count - number of items to parse
* @returns {object} parsed item - item containing index and a parsed value
* for each scale id.
* Example: {xScale0: 0, yScale0: 1}
* @protected
*/
protected parsePrimitiveData(meta: object, data: any[], start: number, count: number): object;
/**
* Parse array of arrays
* @param {object} meta - dataset meta
* @param {array} data - data array. Example [[1,2],[3,4]]
* @param {number} start - start index
* @param {number} count - number of items to parse
* @returns {object} parsed item - item containing index and a parsed value
* for each scale id.
* Example: {x: 0, y: 1}
* @protected
*/
protected parseArrayData(meta: object, data: any[], start: number, count: number): object;
/**
* Parse array of objects
* @param {object} meta - dataset meta
* @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]
* @param {number} start - start index
* @param {number} count - number of items to parse
* @returns {object} parsed item - item containing index and a parsed value
* for each scale id. _custom is optional
* Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}
* @protected
*/
protected parseObjectData(meta: object, data: any[], start: number, count: number): object;
/**
* @protected
*/
protected getParsed(index: any): any;
/**
* @protected
*/
protected getDataElement(index: any): any;
/**
* @protected
*/
protected applyStack(scale: any, parsed: any, mode: any): any;
/**
* @protected
*/
protected updateRangeFromParsed(range: any, scale: any, parsed: any, stack: any): void;
/**
* @protected
*/
protected getMinMax(scale: any, canStack: any): {
min: number;
max: number;
};
getAllParsedValues(scale: any): number[];
/**
* @return {number|boolean}
* @protected
*/
protected getMaxOverflow(): number | boolean;
/**
* @protected
*/
protected getLabelAndValue(index: any): {
label: string;
value: string;
};
/**
* @private
*/
private _update;
/**
* @param {string} mode
*/
update(mode: string): void;
draw(): void;
/**
* Returns a set of predefined style properties that should be used to represent the dataset
* or the data if the index is specified
* @param {number} index - data index
* @param {boolean} [active] - true if hover
* @return {object} style object
*/
getStyle(index: number, active?: boolean): object;
/**
* @protected
*/
protected getContext(index: any, active: any, mode: any): any;
/**
* @param {string} [mode]
* @protected
*/
protected resolveDatasetElementOptions(mode?: string): any;
/**
* @param {number} index
* @param {string} [mode]
* @protected
*/
protected resolveDataElementOptions(index: number, mode?: string): any;
/**
* @private
*/
private _resolveElementOptions;
/**
* @private
*/
private _resolveAnimations;
/**
* Utility for getting the options object shared between elements
* @protected
*/
protected getSharedOptions(options: any): any;
/**
* Utility for determining if `options` should be included in the updated properties
* @protected
*/
protected includeOptions(mode: any, sharedOptions: any): boolean;
/**
* @todo v4, rename to getSharedOptions and remove excess functions
*/
_getSharedOptions(start: any, mode: any): {
sharedOptions: any;
includeOptions: boolean;
};
/**
* Utility for updating an element with new properties, using animations when appropriate.
* @protected
*/
protected updateElement(element: any, index: any, properties: any, mode: any): void;
/**
* Utility to animate the shared options, that are potentially affecting multiple elements.
* @protected
*/
protected updateSharedOptions(sharedOptions: any, mode: any, newOptions: any): void;
/**
* @private
*/
private _setStyle;
removeHoverStyle(element: any, datasetIndex: any, index: any): void;
setHoverStyle(element: any, datasetIndex: any, index: any): void;
/**
* @private
*/
private _removeDatasetHoverStyle;
/**
* @private
*/
private _setDatasetHoverStyle;
/**
* @private
*/
private _resyncElements;
/**
* @private
*/
private _insertElements;
updateElements(element: any, start: any, count: any, mode: any): void;
/**
* @private
*/
private _removeElements;
/**
* @private
*/
private _sync;
_onDataPush(...args: any[]): void;
_onDataPop(): void;
_onDataShift(): void;
_onDataSplice(start: any, count: any, ...args: any[]): void;
_onDataUnshift(...args: any[]): void;
}
export type Chart = import('./core.controller.js').default;
export type Scale = import('./core.scale.js').default;