| 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; |