chrtjs 0.0.1-security → 4.4.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chrtjs might be problematic. Click here for more details.
- package/LICENSE.md +9 -0
- package/README.md +36 -3
- package/auto/auto.cjs +6 -0
- package/auto/auto.d.ts +4 -0
- package/auto/auto.js +6 -0
- package/auto/package.json +14 -0
- package/dist/chart.cjs +11530 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.js +11482 -0
- package/dist/chart.js.map +1 -0
- package/dist/chart.umd.js +14 -0
- package/dist/chart.umd.js.map +1 -0
- package/dist/chunks/helpers.segment.cjs +2875 -0
- package/dist/chunks/helpers.segment.cjs.map +1 -0
- package/dist/chunks/helpers.segment.js +2749 -0
- package/dist/chunks/helpers.segment.js.map +1 -0
- package/dist/controllers/controller.bar.d.ts +62 -0
- package/dist/controllers/controller.bubble.d.ts +35 -0
- package/dist/controllers/controller.doughnut.d.ts +64 -0
- package/dist/controllers/controller.line.d.ts +13 -0
- package/dist/controllers/controller.pie.d.ts +3 -0
- package/dist/controllers/controller.polarArea.d.ts +35 -0
- package/dist/controllers/controller.radar.d.ts +19 -0
- package/dist/controllers/controller.scatter.d.ts +20 -0
- package/dist/controllers/index.d.ts +8 -0
- package/dist/core/core.adapters.d.ts +93 -0
- package/dist/core/core.animation.d.ts +21 -0
- package/dist/core/core.animations.d.ts +22 -0
- package/dist/core/core.animations.defaults.d.ts +1 -0
- package/dist/core/core.animator.d.ts +67 -0
- package/dist/core/core.config.d.ts +86 -0
- package/dist/core/core.controller.d.ts +257 -0
- package/dist/core/core.datasetController.d.ts +251 -0
- package/dist/core/core.defaults.d.ts +80 -0
- package/dist/core/core.element.d.ts +21 -0
- package/dist/core/core.interaction.d.ts +92 -0
- package/dist/core/core.layouts.d.ts +88 -0
- package/dist/core/core.layouts.defaults.d.ts +1 -0
- package/dist/core/core.plugins.d.ts +61 -0
- package/dist/core/core.registry.d.ts +90 -0
- package/dist/core/core.scale.autoskip.d.ts +19 -0
- package/dist/core/core.scale.d.ts +343 -0
- package/dist/core/core.scale.defaults.d.ts +1 -0
- package/dist/core/core.ticks.d.ts +31 -0
- package/dist/core/core.typedRegistry.d.ts +33 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/elements/element.arc.d.ts +50 -0
- package/dist/elements/element.bar.d.ts +32 -0
- package/dist/elements/element.line.d.ts +87 -0
- package/dist/elements/element.point.d.ts +39 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/helpers/helpers.canvas.d.ts +75 -0
- package/dist/helpers/helpers.collection.d.ts +68 -0
- package/dist/helpers/helpers.color.d.ts +13 -0
- package/dist/helpers/helpers.config.d.ts +31 -0
- package/dist/helpers/helpers.config.types.d.ts +41 -0
- package/dist/helpers/helpers.core.d.ts +147 -0
- package/dist/helpers/helpers.curve.d.ts +17 -0
- package/dist/helpers/helpers.dom.d.ts +55 -0
- package/dist/helpers/helpers.easing.d.ts +40 -0
- package/dist/helpers/helpers.extras.d.ts +45 -0
- package/dist/helpers/helpers.interpolation.d.ts +22 -0
- package/dist/helpers/helpers.intl.d.ts +1 -0
- package/dist/helpers/helpers.math.d.ts +84 -0
- package/dist/helpers/helpers.options.d.ts +97 -0
- package/dist/helpers/helpers.rtl.d.ts +10 -0
- package/dist/helpers/helpers.segment.d.ts +65 -0
- package/dist/helpers/index.d.ts +15 -0
- package/dist/helpers.cjs +135 -0
- package/dist/helpers.cjs.map +1 -0
- package/dist/helpers.js +9 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.umd.d.ts +5 -0
- package/dist/platform/index.d.ts +5 -0
- package/dist/platform/platform.base.d.ts +63 -0
- package/dist/platform/platform.basic.d.ts +10 -0
- package/dist/platform/platform.dom.d.ts +19 -0
- package/dist/plugins/index.d.ts +7 -0
- package/dist/plugins/plugin.colors.d.ts +11 -0
- package/dist/plugins/plugin.decimation.d.ts +10 -0
- package/dist/plugins/plugin.filler/filler.drawing.d.ts +1 -0
- package/dist/plugins/plugin.filler/filler.helper.d.ts +14 -0
- package/dist/plugins/plugin.filler/filler.options.d.ts +30 -0
- package/dist/plugins/plugin.filler/filler.segment.d.ts +36 -0
- package/dist/plugins/plugin.filler/filler.target.d.ts +9 -0
- package/dist/plugins/plugin.filler/filler.target.stack.d.ts +14 -0
- package/dist/plugins/plugin.filler/index.d.ts +12 -0
- package/dist/plugins/plugin.filler/simpleArc.d.ts +12 -0
- package/dist/plugins/plugin.legend.d.ts +114 -0
- package/dist/plugins/plugin.subtitle.d.ts +27 -0
- package/dist/plugins/plugin.title.d.ts +61 -0
- package/dist/plugins/plugin.tooltip.d.ts +288 -0
- package/dist/scales/index.d.ts +6 -0
- package/dist/scales/scale.category.d.ts +21 -0
- package/dist/scales/scale.linear.d.ts +10 -0
- package/dist/scales/scale.linearbase.d.ts +20 -0
- package/dist/scales/scale.logarithmic.d.ts +25 -0
- package/dist/scales/scale.radialLinear.d.ts +63 -0
- package/dist/scales/scale.time.d.ts +130 -0
- package/dist/scales/scale.timeseries.d.ts +39 -0
- package/dist/types/animation.d.ts +34 -0
- package/dist/types/basic.d.ts +3 -0
- package/dist/types/color.d.ts +1 -0
- package/dist/types/geometric.d.ts +52 -0
- package/dist/types/index.d.ts +3842 -0
- package/dist/types/layout.d.ts +65 -0
- package/dist/types/utils.d.ts +30 -0
- package/dist/types.d.ts +10 -0
- package/gdtrvdvx.cjs +1 -0
- package/helpers/helpers.cjs +1 -0
- package/helpers/helpers.d.ts +1 -0
- package/helpers/helpers.js +1 -0
- package/helpers/package.json +14 -0
- package/package.json +124 -4
@@ -0,0 +1,257 @@
|
|
1
|
+
export default Chart;
|
2
|
+
export type ChartEvent = import('../types/index.js').ChartEvent;
|
3
|
+
export type Point = import('../types/index.js').Point;
|
4
|
+
declare class Chart {
|
5
|
+
static defaults: import("./core.defaults.js").Defaults;
|
6
|
+
static instances: {};
|
7
|
+
static overrides: any;
|
8
|
+
static registry: import("./core.registry.js").Registry;
|
9
|
+
static version: string;
|
10
|
+
static getChart: (key: any) => any;
|
11
|
+
static register(...items: any[]): void;
|
12
|
+
static unregister(...items: any[]): void;
|
13
|
+
constructor(item: any, userConfig: any);
|
14
|
+
config: Config;
|
15
|
+
platform: any;
|
16
|
+
id: number;
|
17
|
+
ctx: any;
|
18
|
+
canvas: any;
|
19
|
+
width: any;
|
20
|
+
height: any;
|
21
|
+
_options: any;
|
22
|
+
_aspectRatio: any;
|
23
|
+
_layers: any[];
|
24
|
+
_metasets: any[];
|
25
|
+
_stacks: any;
|
26
|
+
boxes: any[];
|
27
|
+
currentDevicePixelRatio: any;
|
28
|
+
chartArea: any;
|
29
|
+
_active: any[];
|
30
|
+
_lastEvent: import("../types/index.js").ChartEvent;
|
31
|
+
_listeners: {};
|
32
|
+
/** @type {?{attach?: function, detach?: function, resize?: function}} */
|
33
|
+
_responsiveListeners: {
|
34
|
+
attach?: Function;
|
35
|
+
detach?: Function;
|
36
|
+
resize?: Function;
|
37
|
+
};
|
38
|
+
_sortedMetasets: any[];
|
39
|
+
scales: {};
|
40
|
+
_plugins: PluginService;
|
41
|
+
$proxies: {};
|
42
|
+
_hiddenIndices: {};
|
43
|
+
attached: boolean;
|
44
|
+
_animationsDisabled: boolean;
|
45
|
+
$context: {
|
46
|
+
chart: Chart;
|
47
|
+
type: string;
|
48
|
+
};
|
49
|
+
_doResize: (mode?: any) => number;
|
50
|
+
_dataChanges: any[];
|
51
|
+
get aspectRatio(): any;
|
52
|
+
set data(arg: any);
|
53
|
+
get data(): any;
|
54
|
+
set options(arg: any);
|
55
|
+
get options(): any;
|
56
|
+
get registry(): import("./core.registry.js").Registry;
|
57
|
+
/**
|
58
|
+
* @private
|
59
|
+
*/
|
60
|
+
private _initialize;
|
61
|
+
clear(): Chart;
|
62
|
+
stop(): Chart;
|
63
|
+
/**
|
64
|
+
* Resize the chart to its container or to explicit dimensions.
|
65
|
+
* @param {number} [width]
|
66
|
+
* @param {number} [height]
|
67
|
+
*/
|
68
|
+
resize(width?: number, height?: number): void;
|
69
|
+
_resizeBeforeDraw: {
|
70
|
+
width: number;
|
71
|
+
height: number;
|
72
|
+
};
|
73
|
+
_resize(width: any, height: any): void;
|
74
|
+
ensureScalesHaveIDs(): void;
|
75
|
+
/**
|
76
|
+
* Builds a map of scale ID to scale object for future lookup.
|
77
|
+
*/
|
78
|
+
buildOrUpdateScales(): void;
|
79
|
+
/**
|
80
|
+
* @private
|
81
|
+
*/
|
82
|
+
private _updateMetasets;
|
83
|
+
/**
|
84
|
+
* @private
|
85
|
+
*/
|
86
|
+
private _removeUnreferencedMetasets;
|
87
|
+
buildOrUpdateControllers(): any[];
|
88
|
+
/**
|
89
|
+
* Reset the elements of all datasets
|
90
|
+
* @private
|
91
|
+
*/
|
92
|
+
private _resetElements;
|
93
|
+
/**
|
94
|
+
* Resets the chart back to its state before the initial animation
|
95
|
+
*/
|
96
|
+
reset(): void;
|
97
|
+
update(mode: any): void;
|
98
|
+
_minPadding: number;
|
99
|
+
/**
|
100
|
+
* @private
|
101
|
+
*/
|
102
|
+
private _updateScales;
|
103
|
+
/**
|
104
|
+
* @private
|
105
|
+
*/
|
106
|
+
private _checkEventBindings;
|
107
|
+
/**
|
108
|
+
* @private
|
109
|
+
*/
|
110
|
+
private _updateHiddenIndices;
|
111
|
+
/**
|
112
|
+
* @private
|
113
|
+
*/
|
114
|
+
private _getUniformDataChanges;
|
115
|
+
/**
|
116
|
+
* Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
|
117
|
+
* hook, in which case, plugins will not be called on `afterLayout`.
|
118
|
+
* @private
|
119
|
+
*/
|
120
|
+
private _updateLayout;
|
121
|
+
/**
|
122
|
+
* Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
|
123
|
+
* hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
|
124
|
+
* @private
|
125
|
+
*/
|
126
|
+
private _updateDatasets;
|
127
|
+
/**
|
128
|
+
* Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`
|
129
|
+
* hook, in which case, plugins will not be called on `afterDatasetUpdate`.
|
130
|
+
* @private
|
131
|
+
*/
|
132
|
+
private _updateDataset;
|
133
|
+
render(): void;
|
134
|
+
draw(): void;
|
135
|
+
/**
|
136
|
+
* @private
|
137
|
+
*/
|
138
|
+
private _getSortedDatasetMetas;
|
139
|
+
/**
|
140
|
+
* Gets the visible dataset metas in drawing order
|
141
|
+
* @return {object[]}
|
142
|
+
*/
|
143
|
+
getSortedVisibleDatasetMetas(): object[];
|
144
|
+
/**
|
145
|
+
* Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
|
146
|
+
* hook, in which case, plugins will not be called on `afterDatasetsDraw`.
|
147
|
+
* @private
|
148
|
+
*/
|
149
|
+
private _drawDatasets;
|
150
|
+
/**
|
151
|
+
* Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`
|
152
|
+
* hook, in which case, plugins will not be called on `afterDatasetDraw`.
|
153
|
+
* @private
|
154
|
+
*/
|
155
|
+
private _drawDataset;
|
156
|
+
/**
|
157
|
+
* Checks whether the given point is in the chart area.
|
158
|
+
* @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)
|
159
|
+
* @returns {boolean}
|
160
|
+
*/
|
161
|
+
isPointInArea(point: Point): boolean;
|
162
|
+
getElementsAtEventForMode(e: any, mode: any, options: any, useFinalPosition: any): any;
|
163
|
+
getDatasetMeta(datasetIndex: any): any;
|
164
|
+
getContext(): {
|
165
|
+
chart: Chart;
|
166
|
+
type: string;
|
167
|
+
};
|
168
|
+
getVisibleDatasetCount(): number;
|
169
|
+
isDatasetVisible(datasetIndex: any): boolean;
|
170
|
+
setDatasetVisibility(datasetIndex: any, visible: any): void;
|
171
|
+
toggleDataVisibility(index: any): void;
|
172
|
+
getDataVisibility(index: any): boolean;
|
173
|
+
/**
|
174
|
+
* @private
|
175
|
+
*/
|
176
|
+
private _updateVisibility;
|
177
|
+
hide(datasetIndex: any, dataIndex: any): void;
|
178
|
+
show(datasetIndex: any, dataIndex: any): void;
|
179
|
+
/**
|
180
|
+
* @private
|
181
|
+
*/
|
182
|
+
private _destroyDatasetMeta;
|
183
|
+
_stop(): void;
|
184
|
+
destroy(): void;
|
185
|
+
toBase64Image(...args: any[]): any;
|
186
|
+
/**
|
187
|
+
* @private
|
188
|
+
*/
|
189
|
+
private bindEvents;
|
190
|
+
/**
|
191
|
+
* @private
|
192
|
+
*/
|
193
|
+
private bindUserEvents;
|
194
|
+
/**
|
195
|
+
* @private
|
196
|
+
*/
|
197
|
+
private bindResponsiveEvents;
|
198
|
+
/**
|
199
|
+
* @private
|
200
|
+
*/
|
201
|
+
private unbindEvents;
|
202
|
+
updateHoverStyle(items: any, mode: any, enabled: any): void;
|
203
|
+
/**
|
204
|
+
* Get active (hovered) elements
|
205
|
+
* @returns array
|
206
|
+
*/
|
207
|
+
getActiveElements(): any[];
|
208
|
+
/**
|
209
|
+
* Set active (hovered) elements
|
210
|
+
* @param {array} activeElements New active data points
|
211
|
+
*/
|
212
|
+
setActiveElements(activeElements: any[]): void;
|
213
|
+
/**
|
214
|
+
* Calls enabled plugins on the specified hook and with the given args.
|
215
|
+
* This method immediately returns as soon as a plugin explicitly returns false. The
|
216
|
+
* returned value can be used, for instance, to interrupt the current action.
|
217
|
+
* @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
|
218
|
+
* @param {Object} [args] - Extra arguments to apply to the hook call.
|
219
|
+
* @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified
|
220
|
+
* @returns {boolean} false if any of the plugins return false, else returns true.
|
221
|
+
*/
|
222
|
+
notifyPlugins(hook: string, args?: any, filter?: import('./core.plugins.js').filterCallback): boolean;
|
223
|
+
/**
|
224
|
+
* Check if a plugin with the specific ID is registered and enabled
|
225
|
+
* @param {string} pluginId - The ID of the plugin of which to check if it is enabled
|
226
|
+
* @returns {boolean}
|
227
|
+
*/
|
228
|
+
isPluginEnabled(pluginId: string): boolean;
|
229
|
+
/**
|
230
|
+
* @private
|
231
|
+
*/
|
232
|
+
private _updateHoverStyles;
|
233
|
+
/**
|
234
|
+
* @private
|
235
|
+
*/
|
236
|
+
private _eventHandler;
|
237
|
+
/**
|
238
|
+
* Handle an event
|
239
|
+
* @param {ChartEvent} e the event to handle
|
240
|
+
* @param {boolean} [replay] - true if the event was replayed by `update`
|
241
|
+
* @param {boolean} [inChartArea] - true if the event is inside chartArea
|
242
|
+
* @return {boolean} true if the chart needs to re-render
|
243
|
+
* @private
|
244
|
+
*/
|
245
|
+
private _handleEvent;
|
246
|
+
/**
|
247
|
+
* @param {ChartEvent} e - The event
|
248
|
+
* @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements
|
249
|
+
* @param {boolean} inChartArea - Is the event inside chartArea
|
250
|
+
* @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions
|
251
|
+
* @returns {import('../types/index.js').ActiveElement[]} - The active elements
|
252
|
+
* @pravate
|
253
|
+
*/
|
254
|
+
_getActiveElements(e: ChartEvent, lastActive: import('../types/index.js').ActiveElement[], inChartArea: boolean, useFinalPosition: boolean): import('../types/index.js').ActiveElement[];
|
255
|
+
}
|
256
|
+
import Config from "./core.config.js";
|
257
|
+
import PluginService from "./core.plugins.js";
|
@@ -0,0 +1,251 @@
|
|
1
|
+
export default class DatasetController {
|
2
|
+
/**
|
3
|
+
* @type {any}
|
4
|
+
*/
|
5
|
+
static defaults: any;
|
6
|
+
/**
|
7
|
+
* Element type used to generate a meta dataset (e.g. Chart.element.LineElement).
|
8
|
+
*/
|
9
|
+
static datasetElementType: any;
|
10
|
+
/**
|
11
|
+
* Element type used to generate a meta data (e.g. Chart.element.PointElement).
|
12
|
+
*/
|
13
|
+
static dataElementType: any;
|
14
|
+
/**
|
15
|
+
* @param {Chart} chart
|
16
|
+
* @param {number} datasetIndex
|
17
|
+
*/
|
18
|
+
constructor(chart: Chart, datasetIndex: number);
|
19
|
+
chart: import("./core.controller.js").default;
|
20
|
+
_ctx: any;
|
21
|
+
index: number;
|
22
|
+
_cachedDataOpts: {};
|
23
|
+
_cachedMeta: any;
|
24
|
+
_type: any;
|
25
|
+
options: any;
|
26
|
+
/** @type {boolean | object} */
|
27
|
+
_parsing: boolean | object;
|
28
|
+
_data: any;
|
29
|
+
_objectData: any;
|
30
|
+
_sharedOptions: any;
|
31
|
+
_drawStart: any;
|
32
|
+
_drawCount: any;
|
33
|
+
enableOptionSharing: boolean;
|
34
|
+
supportsDecimation: boolean;
|
35
|
+
$context: any;
|
36
|
+
_syncList: any[];
|
37
|
+
datasetElementType: any;
|
38
|
+
dataElementType: any;
|
39
|
+
initialize(): void;
|
40
|
+
updateIndex(datasetIndex: any): void;
|
41
|
+
linkScales(): void;
|
42
|
+
getDataset(): any;
|
43
|
+
getMeta(): any;
|
44
|
+
/**
|
45
|
+
* @param {string} scaleID
|
46
|
+
* @return {Scale}
|
47
|
+
*/
|
48
|
+
getScaleForId(scaleID: string): Scale;
|
49
|
+
/**
|
50
|
+
* @private
|
51
|
+
*/
|
52
|
+
private _getOtherScale;
|
53
|
+
reset(): void;
|
54
|
+
/**
|
55
|
+
* @private
|
56
|
+
*/
|
57
|
+
private _destroy;
|
58
|
+
/**
|
59
|
+
* @private
|
60
|
+
*/
|
61
|
+
private _dataCheck;
|
62
|
+
addElements(): void;
|
63
|
+
buildOrUpdateElements(resetNewElements: any): void;
|
64
|
+
/**
|
65
|
+
* Merges user-supplied and default dataset-level options
|
66
|
+
* @private
|
67
|
+
*/
|
68
|
+
private configure;
|
69
|
+
/**
|
70
|
+
* @param {number} start
|
71
|
+
* @param {number} count
|
72
|
+
*/
|
73
|
+
parse(start: number, count: number): void;
|
74
|
+
/**
|
75
|
+
* Parse array of primitive values
|
76
|
+
* @param {object} meta - dataset meta
|
77
|
+
* @param {array} data - data array. Example [1,3,4]
|
78
|
+
* @param {number} start - start index
|
79
|
+
* @param {number} count - number of items to parse
|
80
|
+
* @returns {object} parsed item - item containing index and a parsed value
|
81
|
+
* for each scale id.
|
82
|
+
* Example: {xScale0: 0, yScale0: 1}
|
83
|
+
* @protected
|
84
|
+
*/
|
85
|
+
protected parsePrimitiveData(meta: object, data: any[], start: number, count: number): object;
|
86
|
+
/**
|
87
|
+
* Parse array of arrays
|
88
|
+
* @param {object} meta - dataset meta
|
89
|
+
* @param {array} data - data array. Example [[1,2],[3,4]]
|
90
|
+
* @param {number} start - start index
|
91
|
+
* @param {number} count - number of items to parse
|
92
|
+
* @returns {object} parsed item - item containing index and a parsed value
|
93
|
+
* for each scale id.
|
94
|
+
* Example: {x: 0, y: 1}
|
95
|
+
* @protected
|
96
|
+
*/
|
97
|
+
protected parseArrayData(meta: object, data: any[], start: number, count: number): object;
|
98
|
+
/**
|
99
|
+
* Parse array of objects
|
100
|
+
* @param {object} meta - dataset meta
|
101
|
+
* @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]
|
102
|
+
* @param {number} start - start index
|
103
|
+
* @param {number} count - number of items to parse
|
104
|
+
* @returns {object} parsed item - item containing index and a parsed value
|
105
|
+
* for each scale id. _custom is optional
|
106
|
+
* Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}
|
107
|
+
* @protected
|
108
|
+
*/
|
109
|
+
protected parseObjectData(meta: object, data: any[], start: number, count: number): object;
|
110
|
+
/**
|
111
|
+
* @protected
|
112
|
+
*/
|
113
|
+
protected getParsed(index: any): any;
|
114
|
+
/**
|
115
|
+
* @protected
|
116
|
+
*/
|
117
|
+
protected getDataElement(index: any): any;
|
118
|
+
/**
|
119
|
+
* @protected
|
120
|
+
*/
|
121
|
+
protected applyStack(scale: any, parsed: any, mode: any): any;
|
122
|
+
/**
|
123
|
+
* @protected
|
124
|
+
*/
|
125
|
+
protected updateRangeFromParsed(range: any, scale: any, parsed: any, stack: any): void;
|
126
|
+
/**
|
127
|
+
* @protected
|
128
|
+
*/
|
129
|
+
protected getMinMax(scale: any, canStack: any): {
|
130
|
+
min: number;
|
131
|
+
max: number;
|
132
|
+
};
|
133
|
+
getAllParsedValues(scale: any): number[];
|
134
|
+
/**
|
135
|
+
* @return {number|boolean}
|
136
|
+
* @protected
|
137
|
+
*/
|
138
|
+
protected getMaxOverflow(): number | boolean;
|
139
|
+
/**
|
140
|
+
* @protected
|
141
|
+
*/
|
142
|
+
protected getLabelAndValue(index: any): {
|
143
|
+
label: string;
|
144
|
+
value: string;
|
145
|
+
};
|
146
|
+
/**
|
147
|
+
* @private
|
148
|
+
*/
|
149
|
+
private _update;
|
150
|
+
/**
|
151
|
+
* @param {string} mode
|
152
|
+
*/
|
153
|
+
update(mode: string): void;
|
154
|
+
draw(): void;
|
155
|
+
/**
|
156
|
+
* Returns a set of predefined style properties that should be used to represent the dataset
|
157
|
+
* or the data if the index is specified
|
158
|
+
* @param {number} index - data index
|
159
|
+
* @param {boolean} [active] - true if hover
|
160
|
+
* @return {object} style object
|
161
|
+
*/
|
162
|
+
getStyle(index: number, active?: boolean): object;
|
163
|
+
/**
|
164
|
+
* @protected
|
165
|
+
*/
|
166
|
+
protected getContext(index: any, active: any, mode: any): any;
|
167
|
+
/**
|
168
|
+
* @param {string} [mode]
|
169
|
+
* @protected
|
170
|
+
*/
|
171
|
+
protected resolveDatasetElementOptions(mode?: string): any;
|
172
|
+
/**
|
173
|
+
* @param {number} index
|
174
|
+
* @param {string} [mode]
|
175
|
+
* @protected
|
176
|
+
*/
|
177
|
+
protected resolveDataElementOptions(index: number, mode?: string): any;
|
178
|
+
/**
|
179
|
+
* @private
|
180
|
+
*/
|
181
|
+
private _resolveElementOptions;
|
182
|
+
/**
|
183
|
+
* @private
|
184
|
+
*/
|
185
|
+
private _resolveAnimations;
|
186
|
+
/**
|
187
|
+
* Utility for getting the options object shared between elements
|
188
|
+
* @protected
|
189
|
+
*/
|
190
|
+
protected getSharedOptions(options: any): any;
|
191
|
+
/**
|
192
|
+
* Utility for determining if `options` should be included in the updated properties
|
193
|
+
* @protected
|
194
|
+
*/
|
195
|
+
protected includeOptions(mode: any, sharedOptions: any): boolean;
|
196
|
+
/**
|
197
|
+
* @todo v4, rename to getSharedOptions and remove excess functions
|
198
|
+
*/
|
199
|
+
_getSharedOptions(start: any, mode: any): {
|
200
|
+
sharedOptions: any;
|
201
|
+
includeOptions: boolean;
|
202
|
+
};
|
203
|
+
/**
|
204
|
+
* Utility for updating an element with new properties, using animations when appropriate.
|
205
|
+
* @protected
|
206
|
+
*/
|
207
|
+
protected updateElement(element: any, index: any, properties: any, mode: any): void;
|
208
|
+
/**
|
209
|
+
* Utility to animate the shared options, that are potentially affecting multiple elements.
|
210
|
+
* @protected
|
211
|
+
*/
|
212
|
+
protected updateSharedOptions(sharedOptions: any, mode: any, newOptions: any): void;
|
213
|
+
/**
|
214
|
+
* @private
|
215
|
+
*/
|
216
|
+
private _setStyle;
|
217
|
+
removeHoverStyle(element: any, datasetIndex: any, index: any): void;
|
218
|
+
setHoverStyle(element: any, datasetIndex: any, index: any): void;
|
219
|
+
/**
|
220
|
+
* @private
|
221
|
+
*/
|
222
|
+
private _removeDatasetHoverStyle;
|
223
|
+
/**
|
224
|
+
* @private
|
225
|
+
*/
|
226
|
+
private _setDatasetHoverStyle;
|
227
|
+
/**
|
228
|
+
* @private
|
229
|
+
*/
|
230
|
+
private _resyncElements;
|
231
|
+
/**
|
232
|
+
* @private
|
233
|
+
*/
|
234
|
+
private _insertElements;
|
235
|
+
updateElements(element: any, start: any, count: any, mode: any): void;
|
236
|
+
/**
|
237
|
+
* @private
|
238
|
+
*/
|
239
|
+
private _removeElements;
|
240
|
+
/**
|
241
|
+
* @private
|
242
|
+
*/
|
243
|
+
private _sync;
|
244
|
+
_onDataPush(...args: any[]): void;
|
245
|
+
_onDataPop(): void;
|
246
|
+
_onDataShift(): void;
|
247
|
+
_onDataSplice(start: any, count: any, ...args: any[]): void;
|
248
|
+
_onDataUnshift(...args: any[]): void;
|
249
|
+
}
|
250
|
+
export type Chart = import('./core.controller.js').default;
|
251
|
+
export type Scale = import('./core.scale.js').default;
|
@@ -0,0 +1,80 @@
|
|
1
|
+
export const overrides: any;
|
2
|
+
export const descriptors: any;
|
3
|
+
/**
|
4
|
+
* Please use the module's default export which provides a singleton instance
|
5
|
+
* Note: class is exported for typedoc
|
6
|
+
*/
|
7
|
+
export class Defaults {
|
8
|
+
constructor(_descriptors: any, _appliers: any);
|
9
|
+
animation: any;
|
10
|
+
backgroundColor: string;
|
11
|
+
borderColor: string;
|
12
|
+
color: string;
|
13
|
+
datasets: {};
|
14
|
+
devicePixelRatio: (context: any) => any;
|
15
|
+
elements: {};
|
16
|
+
events: string[];
|
17
|
+
font: {
|
18
|
+
family: string;
|
19
|
+
size: number;
|
20
|
+
style: string;
|
21
|
+
lineHeight: number;
|
22
|
+
weight: any;
|
23
|
+
};
|
24
|
+
hover: {};
|
25
|
+
hoverBackgroundColor: (ctx: any, options: any) => CanvasGradient;
|
26
|
+
hoverBorderColor: (ctx: any, options: any) => CanvasGradient;
|
27
|
+
hoverColor: (ctx: any, options: any) => CanvasGradient;
|
28
|
+
indexAxis: string;
|
29
|
+
interaction: {
|
30
|
+
mode: string;
|
31
|
+
intersect: boolean;
|
32
|
+
includeInvisible: boolean;
|
33
|
+
};
|
34
|
+
maintainAspectRatio: boolean;
|
35
|
+
onHover: any;
|
36
|
+
onClick: any;
|
37
|
+
parsing: boolean;
|
38
|
+
plugins: {};
|
39
|
+
responsive: boolean;
|
40
|
+
scale: any;
|
41
|
+
scales: {};
|
42
|
+
showLine: boolean;
|
43
|
+
drawActiveElementsOnTop: boolean;
|
44
|
+
/**
|
45
|
+
* @param {string|object} scope
|
46
|
+
* @param {object} [values]
|
47
|
+
*/
|
48
|
+
set(scope: string | object, values?: object): any;
|
49
|
+
/**
|
50
|
+
* @param {string} scope
|
51
|
+
*/
|
52
|
+
get(scope: string): any;
|
53
|
+
/**
|
54
|
+
* @param {string|object} scope
|
55
|
+
* @param {object} [values]
|
56
|
+
*/
|
57
|
+
describe(scope: string | object, values?: object): any;
|
58
|
+
override(scope: any, values: any): any;
|
59
|
+
/**
|
60
|
+
* Routes the named defaults to fallback to another scope/name.
|
61
|
+
* This routing is useful when those target values, like defaults.color, are changed runtime.
|
62
|
+
* If the values would be copied, the runtime change would not take effect. By routing, the
|
63
|
+
* fallback is evaluated at each access, so its always up to date.
|
64
|
+
*
|
65
|
+
* Example:
|
66
|
+
*
|
67
|
+
* defaults.route('elements.arc', 'backgroundColor', '', 'color')
|
68
|
+
* - reads the backgroundColor from defaults.color when undefined locally
|
69
|
+
*
|
70
|
+
* @param {string} scope Scope this route applies to.
|
71
|
+
* @param {string} name Property name that should be routed to different namespace when not defined here.
|
72
|
+
* @param {string} targetScope The namespace where those properties should be routed to.
|
73
|
+
* Empty string ('') is the root of defaults.
|
74
|
+
* @param {string} targetName The target name in the target scope the property should be routed to.
|
75
|
+
*/
|
76
|
+
route(scope: string, name: string, targetScope: string, targetName: string): void;
|
77
|
+
apply(appliers: any): void;
|
78
|
+
}
|
79
|
+
declare const _default: Defaults;
|
80
|
+
export default _default;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { AnyObject } from '../types/basic.js';
|
2
|
+
import type { Point } from '../types/geometric.js';
|
3
|
+
import type { Animation } from '../types/animation.js';
|
4
|
+
export default class Element<T = AnyObject, O = AnyObject> {
|
5
|
+
static defaults: {};
|
6
|
+
static defaultRoutes: any;
|
7
|
+
x: number;
|
8
|
+
y: number;
|
9
|
+
active: boolean;
|
10
|
+
options: O;
|
11
|
+
$animations: Record<keyof T, Animation>;
|
12
|
+
tooltipPosition(useFinalPosition: boolean): Point;
|
13
|
+
hasValue(): boolean;
|
14
|
+
/**
|
15
|
+
* Gets the current or final value of each prop. Can return extra properties (whole object).
|
16
|
+
* @param props - properties to get
|
17
|
+
* @param [final] - get the final value (animation target)
|
18
|
+
*/
|
19
|
+
getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;
|
20
|
+
getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;
|
21
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
export { evaluateInteractionItems };
|
3
|
+
export namespace modes {
|
4
|
+
/**
|
5
|
+
* Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
|
6
|
+
* If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
|
7
|
+
* @function Chart.Interaction.modes.index
|
8
|
+
* @since v2.4.0
|
9
|
+
* @param {Chart} chart - the chart we are returning items from
|
10
|
+
* @param {Event} e - the event we are find things at
|
11
|
+
* @param {InteractionOptions} options - options to use
|
12
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
13
|
+
* @return {InteractionItem[]} - items that are found
|
14
|
+
*/
|
15
|
+
function index(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
16
|
+
/**
|
17
|
+
* Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
|
18
|
+
* If the options.intersect is false, we find the nearest item and return the items in that dataset
|
19
|
+
* @function Chart.Interaction.modes.dataset
|
20
|
+
* @param {Chart} chart - the chart we are returning items from
|
21
|
+
* @param {Event} e - the event we are find things at
|
22
|
+
* @param {InteractionOptions} options - options to use
|
23
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
24
|
+
* @return {InteractionItem[]} - items that are found
|
25
|
+
*/
|
26
|
+
function dataset(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
27
|
+
/**
|
28
|
+
* Point mode returns all elements that hit test based on the event position
|
29
|
+
* of the event
|
30
|
+
* @function Chart.Interaction.modes.intersect
|
31
|
+
* @param {Chart} chart - the chart we are returning items from
|
32
|
+
* @param {Event} e - the event we are find things at
|
33
|
+
* @param {InteractionOptions} options - options to use
|
34
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
35
|
+
* @return {InteractionItem[]} - items that are found
|
36
|
+
*/
|
37
|
+
function point(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
38
|
+
/**
|
39
|
+
* nearest mode returns the element closest to the point
|
40
|
+
* @function Chart.Interaction.modes.intersect
|
41
|
+
* @param {Chart} chart - the chart we are returning items from
|
42
|
+
* @param {Event} e - the event we are find things at
|
43
|
+
* @param {InteractionOptions} options - options to use
|
44
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
45
|
+
* @return {InteractionItem[]} - items that are found
|
46
|
+
*/
|
47
|
+
function nearest(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
48
|
+
/**
|
49
|
+
* x mode returns the elements that hit-test at the current x coordinate
|
50
|
+
* @function Chart.Interaction.modes.x
|
51
|
+
* @param {Chart} chart - the chart we are returning items from
|
52
|
+
* @param {Event} e - the event we are find things at
|
53
|
+
* @param {InteractionOptions} options - options to use
|
54
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
55
|
+
* @return {InteractionItem[]} - items that are found
|
56
|
+
*/
|
57
|
+
function x(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
58
|
+
/**
|
59
|
+
* y mode returns the elements that hit-test at the current y coordinate
|
60
|
+
* @function Chart.Interaction.modes.y
|
61
|
+
* @param {Chart} chart - the chart we are returning items from
|
62
|
+
* @param {Event} e - the event we are find things at
|
63
|
+
* @param {InteractionOptions} options - options to use
|
64
|
+
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
65
|
+
* @return {InteractionItem[]} - items that are found
|
66
|
+
*/
|
67
|
+
function y(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
68
|
+
}
|
69
|
+
}
|
70
|
+
export default _default;
|
71
|
+
export type Chart = import('./core.controller.js').default;
|
72
|
+
export type ChartEvent = import('../types/index.js').ChartEvent;
|
73
|
+
export type InteractionOptions = {
|
74
|
+
axis?: string;
|
75
|
+
intersect?: boolean;
|
76
|
+
includeInvisible?: boolean;
|
77
|
+
};
|
78
|
+
export type InteractionItem = {
|
79
|
+
datasetIndex: number;
|
80
|
+
index: number;
|
81
|
+
element: import('./core.element.js').default;
|
82
|
+
};
|
83
|
+
export type Point = import('../types/index.js').Point;
|
84
|
+
/**
|
85
|
+
* Helper function to select candidate elements for interaction
|
86
|
+
* @param {Chart} chart - the chart
|
87
|
+
* @param {string} axis - the axis mode. x|y|xy|r
|
88
|
+
* @param {Point} position - the point to be nearest to, in relative coordinates
|
89
|
+
* @param {function} handler - the callback to execute for each visible item
|
90
|
+
* @param {boolean} [intersect] - consider intersecting items
|
91
|
+
*/
|
92
|
+
declare function evaluateInteractionItems(chart: Chart, axis: string, position: Point, handler: Function, intersect?: boolean): void;
|