-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.controller.d.ts
More file actions
257 lines (257 loc) · 7.98 KB
/
core.controller.d.ts
File metadata and controls
257 lines (257 loc) · 7.98 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
252
253
254
255
256
257
export default Chart;
export type ChartEvent = import('../types/index.js').ChartEvent;
export type Point = import('../types/index.js').Point;
declare class Chart {
static defaults: import("./core.defaults.js").Defaults;
static instances: {};
static overrides: any;
static registry: import("./core.registry.js").Registry;
static version: string;
static getChart: (key: any) => any;
static register(...items: any[]): void;
static unregister(...items: any[]): void;
constructor(item: any, userConfig: any);
config: Config;
platform: any;
id: number;
ctx: any;
canvas: any;
width: any;
height: any;
_options: any;
_aspectRatio: any;
_layers: any[];
_metasets: any[];
_stacks: any;
boxes: any[];
currentDevicePixelRatio: any;
chartArea: any;
_active: any[];
_lastEvent: import("../types/index.js").ChartEvent;
_listeners: {};
/** @type {?{attach?: function, detach?: function, resize?: function}} */
_responsiveListeners: {
attach?: Function;
detach?: Function;
resize?: Function;
};
_sortedMetasets: any[];
scales: {};
_plugins: PluginService;
$proxies: {};
_hiddenIndices: {};
attached: boolean;
_animationsDisabled: boolean;
$context: {
chart: Chart;
type: string;
};
_doResize: (mode?: any) => number;
_dataChanges: any[];
get aspectRatio(): any;
set data(arg: any);
get data(): any;
set options(arg: any);
get options(): any;
get registry(): import("./core.registry.js").Registry;
/**
* @private
*/
private _initialize;
clear(): Chart;
stop(): Chart;
/**
* Resize the chart to its container or to explicit dimensions.
* @param {number} [width]
* @param {number} [height]
*/
resize(width?: number, height?: number): void;
_resizeBeforeDraw: {
width: number;
height: number;
};
_resize(width: any, height: any): void;
ensureScalesHaveIDs(): void;
/**
* Builds a map of scale ID to scale object for future lookup.
*/
buildOrUpdateScales(): void;
/**
* @private
*/
private _updateMetasets;
/**
* @private
*/
private _removeUnreferencedMetasets;
buildOrUpdateControllers(): any[];
/**
* Reset the elements of all datasets
* @private
*/
private _resetElements;
/**
* Resets the chart back to its state before the initial animation
*/
reset(): void;
update(mode: any): void;
_minPadding: number;
/**
* @private
*/
private _updateScales;
/**
* @private
*/
private _checkEventBindings;
/**
* @private
*/
private _updateHiddenIndices;
/**
* @private
*/
private _getUniformDataChanges;
/**
* Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
* hook, in which case, plugins will not be called on `afterLayout`.
* @private
*/
private _updateLayout;
/**
* Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
* hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
* @private
*/
private _updateDatasets;
/**
* Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`
* hook, in which case, plugins will not be called on `afterDatasetUpdate`.
* @private
*/
private _updateDataset;
render(): void;
draw(): void;
/**
* @private
*/
private _getSortedDatasetMetas;
/**
* Gets the visible dataset metas in drawing order
* @return {object[]}
*/
getSortedVisibleDatasetMetas(): object[];
/**
* Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
* hook, in which case, plugins will not be called on `afterDatasetsDraw`.
* @private
*/
private _drawDatasets;
/**
* Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`
* hook, in which case, plugins will not be called on `afterDatasetDraw`.
* @private
*/
private _drawDataset;
/**
* Checks whether the given point is in the chart area.
* @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)
* @returns {boolean}
*/
isPointInArea(point: Point): boolean;
getElementsAtEventForMode(e: any, mode: any, options: any, useFinalPosition: any): any;
getDatasetMeta(datasetIndex: any): any;
getContext(): {
chart: Chart;
type: string;
};
getVisibleDatasetCount(): number;
isDatasetVisible(datasetIndex: any): boolean;
setDatasetVisibility(datasetIndex: any, visible: any): void;
toggleDataVisibility(index: any): void;
getDataVisibility(index: any): boolean;
/**
* @private
*/
private _updateVisibility;
hide(datasetIndex: any, dataIndex: any): void;
show(datasetIndex: any, dataIndex: any): void;
/**
* @private
*/
private _destroyDatasetMeta;
_stop(): void;
destroy(): void;
toBase64Image(...args: any[]): any;
/**
* @private
*/
private bindEvents;
/**
* @private
*/
private bindUserEvents;
/**
* @private
*/
private bindResponsiveEvents;
/**
* @private
*/
private unbindEvents;
updateHoverStyle(items: any, mode: any, enabled: any): void;
/**
* Get active (hovered) elements
* @returns array
*/
getActiveElements(): any[];
/**
* Set active (hovered) elements
* @param {array} activeElements New active data points
*/
setActiveElements(activeElements: any[]): void;
/**
* Calls enabled plugins on the specified hook and with the given args.
* This method immediately returns as soon as a plugin explicitly returns false. The
* returned value can be used, for instance, to interrupt the current action.
* @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
* @param {Object} [args] - Extra arguments to apply to the hook call.
* @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified
* @returns {boolean} false if any of the plugins return false, else returns true.
*/
notifyPlugins(hook: string, args?: any, filter?: import('./core.plugins.js').filterCallback): boolean;
/**
* Check if a plugin with the specific ID is registered and enabled
* @param {string} pluginId - The ID of the plugin of which to check if it is enabled
* @returns {boolean}
*/
isPluginEnabled(pluginId: string): boolean;
/**
* @private
*/
private _updateHoverStyles;
/**
* @private
*/
private _eventHandler;
/**
* Handle an event
* @param {ChartEvent} e the event to handle
* @param {boolean} [replay] - true if the event was replayed by `update`
* @param {boolean} [inChartArea] - true if the event is inside chartArea
* @return {boolean} true if the chart needs to re-render
* @private
*/
private _handleEvent;
/**
* @param {ChartEvent} e - The event
* @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements
* @param {boolean} inChartArea - Is the envent inside chartArea
* @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions
* @returns {import('../types/index.js').ActiveElement[]} - The active elements
* @pravate
*/
_getActiveElements(e: ChartEvent, lastActive: import('../types/index.js').ActiveElement[], inChartArea: boolean, useFinalPosition: boolean): import('../types/index.js').ActiveElement[];
}
import Config from "./core.config.js";
import PluginService from "./core.plugins.js";