UNPKG

382 kBTypeScriptView Raw
1declare type VectorArray = number[];
2declare function create(x?: number, y?: number): VectorArray;
3declare function copy<T extends VectorArray>(out: T, v: VectorArray): T;
4declare function clone(v: VectorArray): VectorArray;
5declare function set<T extends VectorArray>(out: T, a: number, b: number): T;
6declare function add<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
7declare function scaleAndAdd<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray, a: number): T;
8declare function sub<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
9declare function len(v: VectorArray): number;
10declare const length: typeof len;
11declare function lenSquare(v: VectorArray): number;
12declare const lengthSquare: typeof lenSquare;
13declare function mul<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
14declare function div<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
15declare function dot(v1: VectorArray, v2: VectorArray): number;
16declare function scale<T extends VectorArray>(out: T, v: VectorArray, s: number): T;
17declare function normalize<T extends VectorArray>(out: T, v: VectorArray): T;
18declare function distance(v1: VectorArray, v2: VectorArray): number;
19declare const dist: typeof distance;
20declare function distanceSquare(v1: VectorArray, v2: VectorArray): number;
21declare const distSquare: typeof distanceSquare;
22declare function negate<T extends VectorArray>(out: T, v: VectorArray): T;
23declare function lerp<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray, t: number): T;
24declare function applyTransform<T extends VectorArray>(out: T, v: VectorArray, m: MatrixArray): T;
25declare function min<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
26declare function max<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
27
28type vector_d_VectorArray = VectorArray;
29declare const vector_d_create: typeof create;
30declare const vector_d_copy: typeof copy;
31declare const vector_d_clone: typeof clone;
32declare const vector_d_set: typeof set;
33declare const vector_d_add: typeof add;
34declare const vector_d_scaleAndAdd: typeof scaleAndAdd;
35declare const vector_d_sub: typeof sub;
36declare const vector_d_len: typeof len;
37declare const vector_d_length: typeof length;
38declare const vector_d_lenSquare: typeof lenSquare;
39declare const vector_d_lengthSquare: typeof lengthSquare;
40declare const vector_d_mul: typeof mul;
41declare const vector_d_div: typeof div;
42declare const vector_d_dot: typeof dot;
43declare const vector_d_scale: typeof scale;
44declare const vector_d_normalize: typeof normalize;
45declare const vector_d_distance: typeof distance;
46declare const vector_d_dist: typeof dist;
47declare const vector_d_distanceSquare: typeof distanceSquare;
48declare const vector_d_distSquare: typeof distSquare;
49declare const vector_d_negate: typeof negate;
50declare const vector_d_lerp: typeof lerp;
51declare const vector_d_applyTransform: typeof applyTransform;
52declare const vector_d_min: typeof min;
53declare const vector_d_max: typeof max;
54declare namespace vector_d {
55 export {
56 vector_d_VectorArray as VectorArray,
57 vector_d_create as create,
58 vector_d_copy as copy,
59 vector_d_clone as clone,
60 vector_d_set as set,
61 vector_d_add as add,
62 vector_d_scaleAndAdd as scaleAndAdd,
63 vector_d_sub as sub,
64 vector_d_len as len,
65 vector_d_length as length,
66 vector_d_lenSquare as lenSquare,
67 vector_d_lengthSquare as lengthSquare,
68 vector_d_mul as mul,
69 vector_d_div as div,
70 vector_d_dot as dot,
71 vector_d_scale as scale,
72 vector_d_normalize as normalize,
73 vector_d_distance as distance,
74 vector_d_dist as dist,
75 vector_d_distanceSquare as distanceSquare,
76 vector_d_distSquare as distSquare,
77 vector_d_negate as negate,
78 vector_d_lerp as lerp,
79 vector_d_applyTransform as applyTransform,
80 vector_d_min as min,
81 vector_d_max as max,
82 };
83}
84
85declare type MatrixArray = number[];
86declare function create$1(): MatrixArray;
87declare function identity(out: MatrixArray): MatrixArray;
88declare function copy$1(out: MatrixArray, m: MatrixArray): MatrixArray;
89declare function mul$1(out: MatrixArray, m1: MatrixArray, m2: MatrixArray): MatrixArray;
90declare function translate(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray;
91declare function rotate(out: MatrixArray, a: MatrixArray, rad: number): MatrixArray;
92declare function scale$1(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray;
93declare function invert(out: MatrixArray, a: MatrixArray): MatrixArray | null;
94declare function clone$1(a: MatrixArray): MatrixArray;
95
96type matrix_d_MatrixArray = MatrixArray;
97declare const matrix_d_identity: typeof identity;
98declare const matrix_d_translate: typeof translate;
99declare const matrix_d_rotate: typeof rotate;
100declare const matrix_d_invert: typeof invert;
101declare namespace matrix_d {
102 export {
103 matrix_d_MatrixArray as MatrixArray,
104 create$1 as create,
105 matrix_d_identity as identity,
106 copy$1 as copy,
107 mul$1 as mul,
108 matrix_d_translate as translate,
109 matrix_d_rotate as rotate,
110 scale$1 as scale,
111 matrix_d_invert as invert,
112 clone$1 as clone,
113 };
114}
115
116interface PointLike {
117 x: number;
118 y: number;
119}
120declare class Point {
121 x: number;
122 y: number;
123 constructor(x?: number, y?: number);
124 copy(other: PointLike): this;
125 clone(): Point;
126 set(x: number, y: number): this;
127 equal(other: PointLike): boolean;
128 add(other: PointLike): this;
129 scale(scalar: number): void;
130 scaleAndAdd(other: PointLike, scalar: number): void;
131 sub(other: PointLike): this;
132 dot(other: PointLike): number;
133 len(): number;
134 lenSquare(): number;
135 normalize(): this;
136 distance(other: PointLike): number;
137 distanceSquare(other: Point): number;
138 negate(): this;
139 transform(m: MatrixArray): this;
140 toArray(out: number[]): number[];
141 fromArray(input: number[]): void;
142 static set(p: PointLike, x: number, y: number): void;
143 static copy(p: PointLike, p2: PointLike): void;
144 static len(p: PointLike): number;
145 static lenSquare(p: PointLike): number;
146 static dot(p0: PointLike, p1: PointLike): number;
147 static add(out: PointLike, p0: PointLike, p1: PointLike): void;
148 static sub(out: PointLike, p0: PointLike, p1: PointLike): void;
149 static scale(out: PointLike, p0: PointLike, scalar: number): void;
150 static scaleAndAdd(out: PointLike, p0: PointLike, p1: PointLike, scalar: number): void;
151 static lerp(out: PointLike, p0: PointLike, p1: PointLike, t: number): void;
152}
153
154declare class BoundingRect {
155 x: number;
156 y: number;
157 width: number;
158 height: number;
159 constructor(x: number, y: number, width: number, height: number);
160 union(other: BoundingRect): void;
161 applyTransform(m: MatrixArray): void;
162 calculateTransform(b: RectLike): MatrixArray;
163 intersect(b: RectLike, mtv?: PointLike): boolean;
164 contain(x: number, y: number): boolean;
165 clone(): BoundingRect;
166 copy(other: RectLike): void;
167 plain(): RectLike;
168 isFinite(): boolean;
169 isZero(): boolean;
170 static create(rect: RectLike): BoundingRect;
171 static copy(target: RectLike, source: RectLike): void;
172 static applyTransform(target: RectLike, source: RectLike, m: MatrixArray): void;
173}
174declare type RectLike = {
175 x: number;
176 y: number;
177 width: number;
178 height: number;
179};
180
181declare type Dictionary<T> = {
182 [key: string]: T;
183};
184declare type ArrayLike$1<T> = {
185 [key: number]: T;
186 length: number;
187};
188declare type ImageLike = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
189declare type TextVerticalAlign = 'top' | 'middle' | 'bottom';
190declare type TextAlign = 'left' | 'center' | 'right';
191declare type BuiltinTextPosition = 'left' | 'right' | 'top' | 'bottom' | 'inside' | 'insideLeft' | 'insideRight' | 'insideTop' | 'insideBottom' | 'insideTopLeft' | 'insideTopRight' | 'insideBottomLeft' | 'insideBottomRight';
192declare type ZREventProperties = {
193 zrX: number;
194 zrY: number;
195 zrDelta: number;
196 zrEventControl: 'no_globalout' | 'only_globalout';
197 zrByTouch: boolean;
198};
199declare type ZRRawMouseEvent = MouseEvent & ZREventProperties;
200declare type ZRRawTouchEvent = TouchEvent & ZREventProperties;
201declare type ZRRawPointerEvent = TouchEvent & ZREventProperties;
202declare type ZRRawEvent = ZRRawMouseEvent | ZRRawTouchEvent | ZRRawPointerEvent;
203declare type ElementEventName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseover' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu' | 'drag' | 'dragstart' | 'dragend' | 'dragenter' | 'dragleave' | 'dragover' | 'drop' | 'globalout';
204declare type PropType<TObj, TProp extends keyof TObj> = TObj[TProp];
205declare type FunctionPropertyNames<T> = {
206 [K in keyof T]: T[K] extends Function ? K : never;
207}[keyof T];
208declare type MapToType<T extends Dictionary<any>, S> = {
209 [P in keyof T]: T[P] extends Dictionary<any> ? MapToType<T[P], S> : S;
210};
211declare type KeyOfDistributive<T> = T extends unknown ? keyof T : never;
212declare type WithThisType<Func extends (...args: any) => any, This> = (this: This, ...args: Parameters<Func>) => ReturnType<Func>;
213
214interface GradientObject {
215 id?: number;
216 type: string;
217 colorStops: GradientColorStop[];
218 global?: boolean;
219}
220interface GradientColorStop {
221 offset: number;
222 color: string;
223}
224declare class Gradient {
225 id?: number;
226 type: string;
227 colorStops: GradientColorStop[];
228 global: boolean;
229 constructor(colorStops: GradientColorStop[]);
230 addColorStop(offset: number, color: string): void;
231}
232
233declare type ImagePatternRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
234interface PatternObjectBase {
235 id?: number;
236 type?: 'pattern';
237 x?: number;
238 y?: number;
239 rotation?: number;
240 scaleX?: number;
241 scaleY?: number;
242}
243interface ImagePatternObject extends PatternObjectBase {
244 image: ImageLike | string;
245 repeat?: ImagePatternRepeat;
246}
247interface SVGPatternObject extends PatternObjectBase {
248 svgElement?: SVGElement;
249 svgWidth?: number;
250 svgHeight?: number;
251}
252declare type PatternObject = ImagePatternObject | SVGPatternObject;
253
254declare const nativeSlice: (start?: number, end?: number) => any[];
255declare function $override(name: string, fn: Function): void;
256declare function guid(): number;
257declare function logError(...args: any[]): void;
258declare function clone$2<T extends any>(source: T): T;
259declare function merge<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S, overwrite?: boolean): T & S;
260declare function merge<T extends any, S extends any>(target: T, source: S, overwrite?: boolean): T | S;
261declare function mergeAll(targetAndSources: any[], overwrite?: boolean): any;
262declare function extend<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S): T & S;
263declare function defaults<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S, overlay?: boolean): T & S;
264declare const createCanvas: () => HTMLCanvasElement;
265declare function indexOf<T>(array: T[] | readonly T[] | ArrayLike$1<T>, value: T): number;
266declare function inherits(clazz: Function, baseClazz: Function): void;
267declare function mixin<T, S>(target: T | Function, source: S | Function, override?: boolean): void;
268declare function isArrayLike(data: any): data is ArrayLike$1<any>;
269declare function each<I extends Dictionary<any> | any[] | readonly any[] | ArrayLike$1<any>, Context>(arr: I, cb: (this: Context, value: I extends (infer T)[] | readonly (infer T)[] | ArrayLike$1<infer T> ? T : I extends Dictionary<any> ? I extends Record<infer K, infer T> ? T : unknown : unknown, index?: I extends any[] | readonly any[] | ArrayLike$1<any> ? number : keyof I & string, arr?: I) => void, context?: Context): void;
270declare function map<T, R, Context>(arr: readonly T[], cb: (this: Context, val: T, index?: number, arr?: readonly T[]) => R, context?: Context): R[];
271declare function reduce<T, S, Context>(arr: readonly T[], cb: (this: Context, previousValue: S, currentValue: T, currentIndex?: number, arr?: readonly T[]) => S, memo?: S, context?: Context): S;
272declare function filter<T, Context>(arr: readonly T[], cb: (this: Context, value: T, index: number, arr: readonly T[]) => boolean, context?: Context): T[];
273declare function find<T, Context>(arr: readonly T[], cb: (this: Context, value: T, index?: number, arr?: readonly T[]) => boolean, context?: Context): T;
274declare function keys<T extends object>(obj: T): (KeyOfDistributive<T> & string)[];
275declare type Bind1<F, Ctx> = F extends (this: Ctx, ...args: infer A) => infer R ? (...args: A) => R : unknown;
276declare type Bind2<F, Ctx, T1> = F extends (this: Ctx, a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;
277declare type Bind3<F, Ctx, T1, T2> = F extends (this: Ctx, a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;
278declare type Bind4<F, Ctx, T1, T2, T3> = F extends (this: Ctx, a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;
279declare type Bind5<F, Ctx, T1, T2, T3, T4> = F extends (this: Ctx, a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;
280declare type BindFunc<Ctx> = (this: Ctx, ...arg: any[]) => any;
281interface FunctionBind {
282 <F extends BindFunc<Ctx>, Ctx>(func: F, ctx: Ctx): Bind1<F, Ctx>;
283 <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0]>(func: F, ctx: Ctx, a: T1): Bind2<F, Ctx, T1>;
284 <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1]>(func: F, ctx: Ctx, a: T1, b: T2): Bind3<F, Ctx, T1, T2>;
285 <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3): Bind4<F, Ctx, T1, T2, T3>;
286 <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2], T4 extends Parameters<F>[3]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3, d: T4): Bind5<F, Ctx, T1, T2, T3, T4>;
287}
288declare const bind: FunctionBind;
289declare type Curry1<F, T1> = F extends (a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;
290declare type Curry2<F, T1, T2> = F extends (a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;
291declare type Curry3<F, T1, T2, T3> = F extends (a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;
292declare type Curry4<F, T1, T2, T3, T4> = F extends (a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;
293declare type CurryFunc = (...arg: any[]) => any;
294declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0]>(func: F, a: T1): Curry1<F, T1>;
295declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1]>(func: F, a: T1, b: T2): Curry2<F, T1, T2>;
296declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2]>(func: F, a: T1, b: T2, c: T3): Curry3<F, T1, T2, T3>;
297declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2], T4 extends Parameters<F>[3]>(func: F, a: T1, b: T2, c: T3, d: T4): Curry4<F, T1, T2, T3, T4>;
298
299declare function isArray(value: any): value is any[];
300declare function isFunction(value: any): value is Function;
301declare function isString(value: any): value is string;
302declare function isStringSafe(value: any): value is string;
303declare function isNumber(value: any): value is number;
304declare function isObject<T = unknown>(value: T): value is (object & T);
305declare function isBuiltInObject(value: any): boolean;
306declare function isTypedArray(value: any): boolean;
307declare function isDom(value: any): value is HTMLElement;
308declare function isGradientObject(value: any): value is GradientObject;
309declare function isImagePatternObject(value: any): value is ImagePatternObject;
310declare function isRegExp(value: unknown): value is RegExp;
311declare function eqNaN(value: any): boolean;
312declare function retrieve<T>(...args: T[]): T;
313declare function retrieve2<T, R>(value0: T, value1: R): T | R;
314declare function retrieve3<T, R, W>(value0: T, value1: R, value2: W): T | R | W;
315declare type SliceParams = Parameters<typeof nativeSlice>;
316declare function slice<T>(arr: ArrayLike$1<T>, ...args: SliceParams): T[];
317declare function normalizeCssArray(val: number | number[]): number[];
318declare function assert(condition: any, message?: string): void;
319declare function trim(str: string): string;
320declare function setAsPrimitive(obj: any): void;
321declare function isPrimitive(obj: any): boolean;
322declare class HashMap<T, KEY extends string | number = string | number> {
323 data: {
324 [key in KEY]: T;
325 };
326 constructor(obj?: HashMap<T, KEY> | {
327 [key in KEY]?: T;
328 } | KEY[]);
329 get(key: KEY): T;
330 set(key: KEY, value: T): T;
331 each<Context>(cb: (this: Context, value?: T, key?: KEY) => void, context?: Context): void;
332 keys(): KEY[];
333 removeKey(key: KEY): void;
334}
335declare function createHashMap<T, KEY extends string | number = string | number>(obj?: HashMap<T, KEY> | {
336 [key in KEY]?: T;
337} | KEY[]): HashMap<T, KEY>;
338declare function concatArray<T, R>(a: ArrayLike$1<T>, b: ArrayLike$1<R>): ArrayLike$1<T | R>;
339declare function createObject<T>(proto?: object, properties?: T): T;
340declare function hasOwn(own: object, prop: string): boolean;
341declare function noop(): void;
342
343declare const util_d_curry: typeof curry;
344declare const util_d_$override: typeof $override;
345declare const util_d_guid: typeof guid;
346declare const util_d_logError: typeof logError;
347declare const util_d_merge: typeof merge;
348declare const util_d_mergeAll: typeof mergeAll;
349declare const util_d_extend: typeof extend;
350declare const util_d_defaults: typeof defaults;
351declare const util_d_createCanvas: typeof createCanvas;
352declare const util_d_indexOf: typeof indexOf;
353declare const util_d_inherits: typeof inherits;
354declare const util_d_mixin: typeof mixin;
355declare const util_d_isArrayLike: typeof isArrayLike;
356declare const util_d_each: typeof each;
357declare const util_d_map: typeof map;
358declare const util_d_reduce: typeof reduce;
359declare const util_d_filter: typeof filter;
360declare const util_d_find: typeof find;
361declare const util_d_keys: typeof keys;
362type util_d_Bind1<F, Ctx> = Bind1<F, Ctx>;
363type util_d_Bind2<F, Ctx, T1> = Bind2<F, Ctx, T1>;
364type util_d_Bind3<F, Ctx, T1, T2> = Bind3<F, Ctx, T1, T2>;
365type util_d_Bind4<F, Ctx, T1, T2, T3> = Bind4<F, Ctx, T1, T2, T3>;
366type util_d_Bind5<F, Ctx, T1, T2, T3, T4> = Bind5<F, Ctx, T1, T2, T3, T4>;
367declare const util_d_bind: typeof bind;
368type util_d_Curry1<F, T1> = Curry1<F, T1>;
369type util_d_Curry2<F, T1, T2> = Curry2<F, T1, T2>;
370type util_d_Curry3<F, T1, T2, T3> = Curry3<F, T1, T2, T3>;
371type util_d_Curry4<F, T1, T2, T3, T4> = Curry4<F, T1, T2, T3, T4>;
372declare const util_d_isArray: typeof isArray;
373declare const util_d_isFunction: typeof isFunction;
374declare const util_d_isString: typeof isString;
375declare const util_d_isStringSafe: typeof isStringSafe;
376declare const util_d_isNumber: typeof isNumber;
377declare const util_d_isObject: typeof isObject;
378declare const util_d_isBuiltInObject: typeof isBuiltInObject;
379declare const util_d_isTypedArray: typeof isTypedArray;
380declare const util_d_isDom: typeof isDom;
381declare const util_d_isGradientObject: typeof isGradientObject;
382declare const util_d_isImagePatternObject: typeof isImagePatternObject;
383declare const util_d_isRegExp: typeof isRegExp;
384declare const util_d_eqNaN: typeof eqNaN;
385declare const util_d_retrieve: typeof retrieve;
386declare const util_d_retrieve2: typeof retrieve2;
387declare const util_d_retrieve3: typeof retrieve3;
388declare const util_d_slice: typeof slice;
389declare const util_d_normalizeCssArray: typeof normalizeCssArray;
390declare const util_d_assert: typeof assert;
391declare const util_d_trim: typeof trim;
392declare const util_d_setAsPrimitive: typeof setAsPrimitive;
393declare const util_d_isPrimitive: typeof isPrimitive;
394type util_d_HashMap<T, KEY extends string | number = string | number> = HashMap<T, KEY>;
395declare const util_d_HashMap: typeof HashMap;
396declare const util_d_createHashMap: typeof createHashMap;
397declare const util_d_concatArray: typeof concatArray;
398declare const util_d_createObject: typeof createObject;
399declare const util_d_hasOwn: typeof hasOwn;
400declare const util_d_noop: typeof noop;
401declare namespace util_d {
402 export {
403 util_d_curry as curry,
404 util_d_$override as $override,
405 util_d_guid as guid,
406 util_d_logError as logError,
407 clone$2 as clone,
408 util_d_merge as merge,
409 util_d_mergeAll as mergeAll,
410 util_d_extend as extend,
411 util_d_defaults as defaults,
412 util_d_createCanvas as createCanvas,
413 util_d_indexOf as indexOf,
414 util_d_inherits as inherits,
415 util_d_mixin as mixin,
416 util_d_isArrayLike as isArrayLike,
417 util_d_each as each,
418 util_d_map as map,
419 util_d_reduce as reduce,
420 util_d_filter as filter,
421 util_d_find as find,
422 util_d_keys as keys,
423 util_d_Bind1 as Bind1,
424 util_d_Bind2 as Bind2,
425 util_d_Bind3 as Bind3,
426 util_d_Bind4 as Bind4,
427 util_d_Bind5 as Bind5,
428 util_d_bind as bind,
429 util_d_Curry1 as Curry1,
430 util_d_Curry2 as Curry2,
431 util_d_Curry3 as Curry3,
432 util_d_Curry4 as Curry4,
433 util_d_isArray as isArray,
434 util_d_isFunction as isFunction,
435 util_d_isString as isString,
436 util_d_isStringSafe as isStringSafe,
437 util_d_isNumber as isNumber,
438 util_d_isObject as isObject,
439 util_d_isBuiltInObject as isBuiltInObject,
440 util_d_isTypedArray as isTypedArray,
441 util_d_isDom as isDom,
442 util_d_isGradientObject as isGradientObject,
443 util_d_isImagePatternObject as isImagePatternObject,
444 util_d_isRegExp as isRegExp,
445 util_d_eqNaN as eqNaN,
446 util_d_retrieve as retrieve,
447 util_d_retrieve2 as retrieve2,
448 util_d_retrieve3 as retrieve3,
449 util_d_slice as slice,
450 util_d_normalizeCssArray as normalizeCssArray,
451 util_d_assert as assert,
452 util_d_trim as trim,
453 util_d_setAsPrimitive as setAsPrimitive,
454 util_d_isPrimitive as isPrimitive,
455 util_d_HashMap as HashMap,
456 util_d_createHashMap as createHashMap,
457 util_d_concatArray as concatArray,
458 util_d_createObject as createObject,
459 util_d_hasOwn as hasOwn,
460 util_d_noop as noop,
461 };
462}
463
464declare class Transformable {
465 parent: Transformable;
466 x: number;
467 y: number;
468 scaleX: number;
469 scaleY: number;
470 skewX: number;
471 skewY: number;
472 rotation: number;
473 originX: number;
474 originY: number;
475 globalScaleRatio: number;
476 transform: MatrixArray;
477 invTransform: MatrixArray;
478 getLocalTransform(m?: MatrixArray): MatrixArray;
479 setPosition(arr: number[]): void;
480 setScale(arr: number[]): void;
481 setSkew(arr: number[]): void;
482 setOrigin(arr: number[]): void;
483 needLocalTransform(): boolean;
484 updateTransform(): void;
485 private _resolveGlobalScaleRatio;
486 getComputedTransform(): MatrixArray;
487 setLocalTransform(m: VectorArray): void;
488 decomposeTransform(): void;
489 getGlobalScale(out?: VectorArray): VectorArray;
490 transformCoordToLocal(x: number, y: number): number[];
491 transformCoordToGlobal(x: number, y: number): number[];
492 getLineScale(): number;
493 copyTransform(source: Transformable): void;
494 static getLocalTransform(target: Transformable, m?: MatrixArray): MatrixArray;
495 private static initDefaultProps;
496}
497
498declare type easingFunc = (percent: number) => number;
499declare type AnimationEasing = keyof typeof easing | easingFunc | 'spline';
500declare const easing: {
501 linear(k: number): number;
502 quadraticIn(k: number): number;
503 quadraticOut(k: number): number;
504 quadraticInOut(k: number): number;
505 cubicIn(k: number): number;
506 cubicOut(k: number): number;
507 cubicInOut(k: number): number;
508 quarticIn(k: number): number;
509 quarticOut(k: number): number;
510 quarticInOut(k: number): number;
511 quinticIn(k: number): number;
512 quinticOut(k: number): number;
513 quinticInOut(k: number): number;
514 sinusoidalIn(k: number): number;
515 sinusoidalOut(k: number): number;
516 sinusoidalInOut(k: number): number;
517 exponentialIn(k: number): number;
518 exponentialOut(k: number): number;
519 exponentialInOut(k: number): number;
520 circularIn(k: number): number;
521 circularOut(k: number): number;
522 circularInOut(k: number): number;
523 elasticIn(k: number): number;
524 elasticOut(k: number): number;
525 elasticInOut(k: number): number;
526 backIn(k: number): number;
527 backOut(k: number): number;
528 backInOut(k: number): number;
529 bounceIn(k: number): number;
530 bounceOut(k: number): number;
531 bounceInOut(k: number): number;
532};
533
534declare type EventCallbackSingleParam<EvtParam = any> = EvtParam extends any ? (params: EvtParam) => boolean | void : never;
535declare type EventCallback<EvtParams = any[]> = EvtParams extends any[] ? (...args: EvtParams) => boolean | void : never;
536declare type EventQuery = string | Object;
537declare type CbThis<Ctx, Impl> = unknown extends Ctx ? Impl : Ctx;
538declare type DefaultEventDefinition = Dictionary<EventCallback<any[]>>;
539interface EventProcessor<EvtDef = DefaultEventDefinition> {
540 normalizeQuery?: (query: EventQuery) => EventQuery;
541 filter?: (eventType: keyof EvtDef, query: EventQuery) => boolean;
542 afterTrigger?: (eventType: keyof EvtDef) => void;
543}
544declare class Eventful<EvtDef extends DefaultEventDefinition = DefaultEventDefinition> {
545 private _$handlers;
546 protected _$eventProcessor: EventProcessor<EvtDef>;
547 constructor(eventProcessors?: EventProcessor<EvtDef>);
548 on<Ctx, EvtNm extends keyof EvtDef>(event: EvtNm, handler: WithThisType<EvtDef[EvtNm], CbThis<Ctx, this>>, context?: Ctx): this;
549 on<Ctx, EvtNm extends keyof EvtDef>(event: EvtNm, query: EventQuery, handler: WithThisType<EvtDef[EvtNm], CbThis<Ctx, this>>, context?: Ctx): this;
550 isSilent(eventName: keyof EvtDef): boolean;
551 off(eventType?: keyof EvtDef, handler?: Function): this;
552 trigger<EvtNm extends keyof EvtDef>(eventType: EvtNm, ...args: Parameters<EvtDef[EvtNm]>): this;
553 triggerWithContext(type: keyof EvtDef, ...args: any[]): this;
554}
555
556interface Stage {
557 update?: () => void;
558}
559declare type OnframeCallback = (deltaTime: number) => void;
560interface AnimationOption {
561 stage?: Stage;
562 onframe?: OnframeCallback;
563}
564declare class Animation extends Eventful {
565 stage: Stage;
566 onframe: OnframeCallback;
567 private _clipsHead;
568 private _clipsTail;
569 private _running;
570 private _time;
571 private _pausedTime;
572 private _pauseStart;
573 private _paused;
574 constructor(opts?: AnimationOption);
575 addClip(clip: Clip): void;
576 addAnimator(animator: Animator<any>): void;
577 removeClip(clip: Clip): void;
578 removeAnimator(animator: Animator<any>): void;
579 update(notTriggerFrameAndStageUpdate?: boolean): void;
580 _startLoop(): void;
581 start(): void;
582 stop(): void;
583 pause(): void;
584 resume(): void;
585 clear(): void;
586 isFinished(): boolean;
587 animate<T>(target: T, options: {
588 loop?: boolean;
589 }): Animator<T>;
590}
591
592declare type OnframeCallback$1 = (percent: number) => void;
593declare type ondestroyCallback = () => void;
594declare type onrestartCallback = () => void;
595interface ClipProps {
596 life?: number;
597 delay?: number;
598 loop?: boolean;
599 gap?: number;
600 easing?: AnimationEasing;
601 onframe?: OnframeCallback$1;
602 ondestroy?: ondestroyCallback;
603 onrestart?: onrestartCallback;
604}
605declare class Clip {
606 private _life;
607 private _delay;
608 private _initialized;
609 private _startTime;
610 private _pausedTime;
611 private _paused;
612 animation: Animation;
613 loop: boolean;
614 gap: number;
615 easing: AnimationEasing;
616 next: Clip;
617 prev: Clip;
618 onframe: OnframeCallback$1;
619 ondestroy: ondestroyCallback;
620 onrestart: onrestartCallback;
621 constructor(opts: ClipProps);
622 step(globalTime: number, deltaTime: number): boolean;
623 private _restart;
624 pause(): void;
625 resume(): void;
626}
627
628declare type Keyframe = {
629 time: number;
630 value: unknown;
631 percent: number;
632 additiveValue?: unknown;
633};
634declare class Track {
635 keyframes: Keyframe[];
636 maxTime: number;
637 propName: string;
638 useSpline: boolean;
639 arrDim: number;
640 isValueColor: boolean;
641 interpolable: boolean;
642 private _finished;
643 private _needsSort;
644 private _isAllValueEqual;
645 private _additiveTrack;
646 private _additiveValue;
647 private _lastFrame;
648 private _lastFramePercent;
649 constructor(propName: string);
650 isFinished(): boolean;
651 setFinished(): void;
652 needsAnimate(): boolean;
653 getAdditiveTrack(): Track;
654 addKeyframe(time: number, value: unknown): {
655 time: number;
656 value: unknown;
657 percent: number;
658 };
659 prepare(additiveTrack?: Track): void;
660 step(target: any, percent: number): void;
661 private _addToTarget;
662}
663declare type DoneCallback = () => void;
664declare type AbortCallback = () => void;
665declare type OnframeCallback$2<T> = (target: T, percent: number) => void;
666declare class Animator<T> {
667 animation?: Animation;
668 targetName?: string;
669 scope?: string;
670 __fromStateTransition?: string;
671 private _tracks;
672 private _trackKeys;
673 private _target;
674 private _loop;
675 private _delay;
676 private _maxTime;
677 private _paused;
678 private _started;
679 private _additiveAnimators;
680 private _doneCbs;
681 private _onframeCbs;
682 private _abortedCbs;
683 private _clip;
684 constructor(target: T, loop: boolean, additiveTo?: Animator<any>[]);
685 getTarget(): T;
686 changeTarget(target: T): void;
687 when(time: number, props: Dictionary<any>): this;
688 whenWithKeys(time: number, props: Dictionary<any>, propNames: string[]): this;
689 pause(): void;
690 resume(): void;
691 isPaused(): boolean;
692 private _doneCallback;
693 private _abortedCallback;
694 private _setTracksFinished;
695 private _getAdditiveTrack;
696 start(easing?: AnimationEasing, forceAnimate?: boolean): this;
697 stop(forwardToLast?: boolean): void;
698 delay(time: number): this;
699 during(cb: OnframeCallback$2<T>): this;
700 done(cb: DoneCallback): this;
701 aborted(cb: AbortCallback): this;
702 getClip(): Clip;
703 getTrack(propName: string): Track;
704 stopTracks(propNames: string[], forwardToLast?: boolean): boolean;
705 saveFinalToTarget(target: T, trackKeys?: readonly string[]): void;
706 __changeFinalValue(finalProps: Dictionary<any>, trackKeys?: readonly string[]): void;
707}
708
709interface ImageStyleProps extends CommonStyleProps {
710 image?: string | ImageLike;
711 x?: number;
712 y?: number;
713 width?: number;
714 height?: number;
715 sx?: number;
716 sy?: number;
717 sWidth?: number;
718 sHeight?: number;
719}
720interface ImageProps extends DisplayableProps {
721 style?: ImageStyleProps;
722 onload?: (image: ImageLike) => void;
723}
724declare class ZRImage extends Displayable<ImageProps> {
725 style: ImageStyleProps;
726 __image: ImageLike;
727 __imageSrc: string;
728 onload: (image: ImageLike) => void;
729 createStyle(obj?: ImageStyleProps): ImageStyleProps;
730 private _getSize;
731 getWidth(): number;
732 getHeight(): number;
733 getAnimationStyleProps(): MapToType<ImageProps, boolean>;
734 getBoundingRect(): BoundingRect;
735}
736
737interface PainterBase {
738 type: string;
739 root: HTMLElement;
740 resize(width?: number | string, height?: number | string): void;
741 refresh(): void;
742 clear(): void;
743 getType: () => string;
744 getWidth(): number;
745 getHeight(): number;
746 dispose(): void;
747 getViewportRoot: () => HTMLElement;
748 getViewportRootOffset: () => {
749 offsetLeft: number;
750 offsetTop: number;
751 };
752 refreshHover(): void;
753 pathToImage(e: Path, dpr: number): ZRImage;
754 configLayer(zlevel: number, config: Dictionary<any>): void;
755 setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void;
756}
757
758interface HandlerProxyInterface extends Eventful {
759 handler: Handler;
760 dispose: () => void;
761 setCursor: (cursorStyle?: string) => void;
762}
763
764declare function shapeCompareFunc(a: Displayable, b: Displayable): number;
765declare class Storage {
766 private _roots;
767 private _displayList;
768 private _displayListLen;
769 traverse<T>(cb: (this: T, el: Element) => void, context?: T): void;
770 getDisplayList(update?: boolean, includeIgnore?: boolean): Displayable[];
771 updateDisplayList(includeIgnore?: boolean): void;
772 private _updateAndAddDisplayable;
773 addRoot(el: Element): void;
774 delRoot(el: Element | Element[]): void;
775 delAllRoots(): void;
776 getRoots(): Element<ElementProps>[];
777 dispose(): void;
778 displayableSortFunc: typeof shapeCompareFunc;
779}
780
781declare class HoveredResult {
782 x: number;
783 y: number;
784 target: Displayable;
785 topTarget: Displayable;
786 constructor(x?: number, y?: number);
787}
788declare type HandlerName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu';
789declare class Handler extends Eventful {
790 storage: Storage;
791 painter: PainterBase;
792 painterRoot: HTMLElement;
793 proxy: HandlerProxyInterface;
794 private _hovered;
795 private _gestureMgr;
796 private _draggingMgr;
797 _downEl: Element;
798 _upEl: Element;
799 _downPoint: [number, number];
800 constructor(storage: Storage, painter: PainterBase, proxy: HandlerProxyInterface, painterRoot: HTMLElement);
801 setHandlerProxy(proxy: HandlerProxyInterface): void;
802 mousemove(event: ZRRawEvent): void;
803 mouseout(event: ZRRawEvent): void;
804 resize(): void;
805 dispatch(eventName: HandlerName, eventArgs?: any): void;
806 dispose(): void;
807 setCursorStyle(cursorStyle: string): void;
808 dispatchToElement(targetInfo: {
809 target?: Element;
810 topTarget?: Element;
811 }, eventName: ElementEventName, event: ZRRawEvent): void;
812 findHover(x: number, y: number, exclude?: Displayable): HoveredResult;
813 processGesture(event: ZRRawEvent, stage?: 'start' | 'end' | 'change'): void;
814 click: (event: ZRRawEvent) => void;
815 mousedown: (event: ZRRawEvent) => void;
816 mouseup: (event: ZRRawEvent) => void;
817 mousewheel: (event: ZRRawEvent) => void;
818 dblclick: (event: ZRRawEvent) => void;
819 contextmenu: (event: ZRRawEvent) => void;
820}
821
822interface LayerConfig {
823 clearColor?: string | GradientObject | ImagePatternObject;
824 motionBlur?: boolean;
825 lastFrameAlpha?: number;
826}
827
828interface TSpanStyleProps extends PathStyleProps {
829 x?: number;
830 y?: number;
831 text?: string;
832 font?: string;
833 textAlign?: CanvasTextAlign;
834 textBaseline?: CanvasTextBaseline;
835}
836interface TSpanProps extends DisplayableProps {
837 style?: TSpanStyleProps;
838}
839declare class TSpan extends Displayable<TSpanProps> {
840 style: TSpanStyleProps;
841 hasStroke(): boolean;
842 hasFill(): boolean;
843 createStyle(obj?: TSpanStyleProps): TSpanStyleProps;
844 setBoundingRect(rect: BoundingRect): void;
845 getBoundingRect(): BoundingRect;
846 protected static initDefaultProps: void;
847}
848
849/*!
850* ZRender, a high performance 2d drawing library.
851*
852* Copyright (c) 2013, Baidu Inc.
853* All rights reserved.
854*
855* LICENSE
856* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
857*/
858
859declare type PainterBaseCtor = {
860 new (dom: HTMLElement, storage: Storage, ...args: any[]): PainterBase;
861};
862declare class ZRender {
863 dom: HTMLElement;
864 id: number;
865 storage: Storage;
866 painter: PainterBase;
867 handler: Handler;
868 animation: Animation;
869 private _sleepAfterStill;
870 private _stillFrameAccum;
871 private _needsRefresh;
872 private _needsRefreshHover;
873 private _darkMode;
874 private _backgroundColor;
875 constructor(id: number, dom: HTMLElement, opts?: ZRenderInitOpt);
876 add(el: Element): void;
877 remove(el: Element): void;
878 configLayer(zLevel: number, config: LayerConfig): void;
879 setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void;
880 getBackgroundColor(): string | GradientObject | PatternObject;
881 setDarkMode(darkMode: boolean): void;
882 isDarkMode(): boolean;
883 refreshImmediately(fromInside?: boolean): void;
884 refresh(): void;
885 flush(): void;
886 private _flush;
887 setSleepAfterStill(stillFramesCount: number): void;
888 wakeUp(): void;
889 addHover(el: Displayable): void;
890 removeHover(el: Path | TSpan | ZRImage): void;
891 clearHover(): void;
892 refreshHover(): void;
893 refreshHoverImmediately(): void;
894 resize(opts?: {
895 width?: number | string;
896 height?: number | string;
897 }): void;
898 clearAnimation(): void;
899 getWidth(): number;
900 getHeight(): number;
901 pathToImage(e: Path, dpr: number): ZRImage;
902 setCursorStyle(cursorStyle: string): void;
903 findHover(x: number, y: number): {
904 target: Displayable;
905 topTarget: Displayable;
906 };
907 on<Ctx>(eventName: ElementEventName, eventHandler: ElementEventCallback<Ctx, ZRenderType>, context?: Ctx): this;
908 on<Ctx>(eventName: string, eventHandler: WithThisType<EventCallback<any[]>, unknown extends Ctx ? ZRenderType : Ctx>, context?: Ctx): this;
909 off(eventName?: string, eventHandler?: EventCallback): void;
910 trigger(eventName: string, event?: unknown): void;
911 clear(): void;
912 dispose(): void;
913}
914interface ZRenderInitOpt {
915 renderer?: string;
916 devicePixelRatio?: number;
917 width?: number | string;
918 height?: number | string;
919 useDirtyRect?: boolean;
920}
921declare function init(dom: HTMLElement, opts?: ZRenderInitOpt): ZRender;
922declare function dispose(zr: ZRender): void;
923declare function disposeAll(): void;
924declare function getInstance(id: number): ZRender;
925declare function registerPainter(name: string, Ctor: PainterBaseCtor): void;
926declare const version = "5.2.1";
927interface ZRenderType extends ZRender {
928}
929
930type zrender_d_ZRenderInitOpt = ZRenderInitOpt;
931declare const zrender_d_init: typeof init;
932declare const zrender_d_dispose: typeof dispose;
933declare const zrender_d_disposeAll: typeof disposeAll;
934declare const zrender_d_getInstance: typeof getInstance;
935declare const zrender_d_registerPainter: typeof registerPainter;
936declare const zrender_d_version: typeof version;
937type zrender_d_ZRenderType = ZRenderType;
938declare namespace zrender_d {
939 export {
940 zrender_d_ZRenderInitOpt as ZRenderInitOpt,
941 zrender_d_init as init,
942 zrender_d_dispose as dispose,
943 zrender_d_disposeAll as disposeAll,
944 zrender_d_getInstance as getInstance,
945 zrender_d_registerPainter as registerPainter,
946 zrender_d_version as version,
947 zrender_d_ZRenderType as ZRenderType,
948 };
949}
950
951declare class RectShape {
952 r?: number | number[];
953 x: number;
954 y: number;
955 width: number;
956 height: number;
957}
958interface RectProps extends PathProps {
959 shape?: Partial<RectShape>;
960}
961declare class Rect extends Path<RectProps> {
962 shape: RectShape;
963 constructor(opts?: RectProps);
964 getDefaultShape(): RectShape;
965 buildPath(ctx: CanvasRenderingContext2D, shape: RectShape): void;
966 isZeroArea(): boolean;
967}
968
969interface GroupProps extends ElementProps {
970}
971declare class Group extends Element<GroupProps> {
972 readonly isGroup = true;
973 private _children;
974 constructor(opts?: GroupProps);
975 childrenRef(): Element<ElementProps>[];
976 children(): Element<ElementProps>[];
977 childAt(idx: number): Element;
978 childOfName(name: string): Element;
979 childCount(): number;
980 add(child: Element): Group;
981 addBefore(child: Element, nextSibling: Element): this;
982 replace(oldChild: Element, newChild: Element): this;
983 replaceAt(child: Element, index: number): this;
984 _doAdd(child: Element): void;
985 remove(child: Element): this;
986 removeAll(): this;
987 eachChild<Context>(cb: (this: Context, el: Element, index?: number) => void, context?: Context): this;
988 traverse<T>(cb: (this: T, el: Element) => boolean | void, context?: T): this;
989 addSelfToZr(zr: ZRenderType): void;
990 removeSelfFromZr(zr: ZRenderType): void;
991 getBoundingRect(includeChildren?: Element[]): BoundingRect;
992}
993interface GroupLike extends Element {
994 childrenRef(): Element[];
995}
996
997interface TextStylePropsPart {
998 text?: string;
999 fill?: string;
1000 stroke?: string;
1001 opacity?: number;
1002 fillOpacity?: number;
1003 strokeOpacity?: number;
1004 lineWidth?: number;
1005 lineDash?: false | number[];
1006 lineDashOffset?: number;
1007 borderDash?: false | number[];
1008 borderDashOffset?: number;
1009 font?: string;
1010 textFont?: string;
1011 fontStyle?: 'normal' | 'italic' | 'oblique';
1012 fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
1013 fontFamily?: string;
1014 fontSize?: number | string;
1015 align?: TextAlign;
1016 verticalAlign?: TextVerticalAlign;
1017 lineHeight?: number;
1018 width?: number | string;
1019 height?: number;
1020 tag?: string;
1021 textShadowColor?: string;
1022 textShadowBlur?: number;
1023 textShadowOffsetX?: number;
1024 textShadowOffsetY?: number;
1025 backgroundColor?: string | {
1026 image: ImageLike | string;
1027 };
1028 padding?: number | number[];
1029 margin?: number;
1030 borderColor?: string;
1031 borderWidth?: number;
1032 borderRadius?: number | number[];
1033 shadowColor?: string;
1034 shadowBlur?: number;
1035 shadowOffsetX?: number;
1036 shadowOffsetY?: number;
1037}
1038interface TextStyleProps extends TextStylePropsPart {
1039 text?: string;
1040 x?: number;
1041 y?: number;
1042 width?: number;
1043 rich?: Dictionary<TextStylePropsPart>;
1044 overflow?: 'break' | 'breakAll' | 'truncate' | 'none';
1045 lineOverflow?: 'truncate';
1046 ellipsis?: string;
1047 placeholder?: string;
1048 truncateMinChar?: number;
1049}
1050interface TextProps extends DisplayableProps {
1051 style?: TextStyleProps;
1052 zlevel?: number;
1053 z?: number;
1054 z2?: number;
1055 culling?: boolean;
1056 cursor?: string;
1057}
1058declare type TextState = Pick<TextProps, DisplayableStatePropNames> & ElementCommonState;
1059declare type DefaultTextStyle = Pick<TextStyleProps, 'fill' | 'stroke' | 'align' | 'verticalAlign'> & {
1060 autoStroke?: boolean;
1061};
1062interface ZRText {
1063 animate(key?: '', loop?: boolean): Animator<this>;
1064 animate(key: 'style', loop?: boolean): Animator<this['style']>;
1065 getState(stateName: string): TextState;
1066 ensureState(stateName: string): TextState;
1067 states: Dictionary<TextState>;
1068 stateProxy: (stateName: string) => TextState;
1069}
1070declare class ZRText extends Displayable<TextProps> implements GroupLike {
1071 type: string;
1072 style: TextStyleProps;
1073 overlap: 'hidden' | 'show' | 'blur';
1074 innerTransformable: Transformable;
1075 private _children;
1076 private _childCursor;
1077 private _defaultStyle;
1078 constructor(opts?: TextProps);
1079 childrenRef(): (ZRImage | Rect | TSpan)[];
1080 update(): void;
1081 updateTransform(): void;
1082 getLocalTransform(m?: MatrixArray): MatrixArray;
1083 getComputedTransform(): MatrixArray;
1084 private _updateSubTexts;
1085 addSelfToZr(zr: ZRenderType): void;
1086 removeSelfFromZr(zr: ZRenderType): void;
1087 getBoundingRect(): BoundingRect;
1088 setDefaultTextStyle(defaultTextStyle: DefaultTextStyle): void;
1089 setTextContent(textContent: never): void;
1090 protected _mergeStyle(targetStyle: TextStyleProps, sourceStyle: TextStyleProps): TextStyleProps;
1091 private _mergeRich;
1092 getAnimationStyleProps(): MapToType<TextProps, boolean>;
1093 private _getOrCreateChild;
1094 private _updatePlainTexts;
1095 private _updateRichTexts;
1096 private _placeToken;
1097 private _renderBackground;
1098 static makeFont(style: TextStylePropsPart): string;
1099}
1100
1101interface TextPositionCalculationResult {
1102 x: number;
1103 y: number;
1104 align: TextAlign;
1105 verticalAlign: TextVerticalAlign;
1106}
1107
1108declare class PolylineShape {
1109 points: VectorArray[];
1110 percent?: number;
1111 smooth?: number | 'spline';
1112 smoothConstraint?: VectorArray[];
1113}
1114interface PolylineProps extends PathProps {
1115 shape?: Partial<PolylineShape>;
1116}
1117declare class Polyline extends Path<PolylineProps> {
1118 shape: PolylineShape;
1119 constructor(opts?: PolylineProps);
1120 getDefaultStyle(): {
1121 stroke: string;
1122 fill: string;
1123 };
1124 getDefaultShape(): PolylineShape;
1125 buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape): void;
1126}
1127
1128interface ElementAnimateConfig {
1129 duration?: number;
1130 delay?: number;
1131 easing?: AnimationEasing;
1132 during?: (percent: number) => void;
1133 done?: Function;
1134 aborted?: Function;
1135 scope?: string;
1136 force?: boolean;
1137 additive?: boolean;
1138 setToFinal?: boolean;
1139}
1140interface ElementTextConfig {
1141 position?: BuiltinTextPosition | (number | string)[];
1142 rotation?: number;
1143 layoutRect?: RectLike;
1144 offset?: number[];
1145 origin?: (number | string)[] | 'center';
1146 distance?: number;
1147 local?: boolean;
1148 insideFill?: string;
1149 insideStroke?: string;
1150 outsideFill?: string;
1151 outsideStroke?: string;
1152 inside?: boolean;
1153}
1154interface ElementTextGuideLineConfig {
1155 anchor?: Point;
1156 showAbove?: boolean;
1157 candidates?: ('left' | 'top' | 'right' | 'bottom')[];
1158}
1159interface ElementEvent {
1160 type: ElementEventName;
1161 event: ZRRawEvent;
1162 target: Element;
1163 topTarget: Element;
1164 cancelBubble: boolean;
1165 offsetX: number;
1166 offsetY: number;
1167 gestureEvent: string;
1168 pinchX: number;
1169 pinchY: number;
1170 pinchScale: number;
1171 wheelDelta: number;
1172 zrByTouch: boolean;
1173 which: number;
1174 stop: (this: ElementEvent) => void;
1175}
1176declare type ElementEventCallback<Ctx, Impl> = (this: CbThis$1<Ctx, Impl>, e: ElementEvent) => boolean | void;
1177declare type CbThis$1<Ctx, Impl> = unknown extends Ctx ? Impl : Ctx;
1178interface ElementEventHandlerProps {
1179 onclick: ElementEventCallback<unknown, unknown>;
1180 ondblclick: ElementEventCallback<unknown, unknown>;
1181 onmouseover: ElementEventCallback<unknown, unknown>;
1182 onmouseout: ElementEventCallback<unknown, unknown>;
1183 onmousemove: ElementEventCallback<unknown, unknown>;
1184 onmousewheel: ElementEventCallback<unknown, unknown>;
1185 onmousedown: ElementEventCallback<unknown, unknown>;
1186 onmouseup: ElementEventCallback<unknown, unknown>;
1187 oncontextmenu: ElementEventCallback<unknown, unknown>;
1188 ondrag: ElementEventCallback<unknown, unknown>;
1189 ondragstart: ElementEventCallback<unknown, unknown>;
1190 ondragend: ElementEventCallback<unknown, unknown>;
1191 ondragenter: ElementEventCallback<unknown, unknown>;
1192 ondragleave: ElementEventCallback<unknown, unknown>;
1193 ondragover: ElementEventCallback<unknown, unknown>;
1194 ondrop: ElementEventCallback<unknown, unknown>;
1195}
1196interface ElementProps extends Partial<ElementEventHandlerProps> {
1197 name?: string;
1198 ignore?: boolean;
1199 isGroup?: boolean;
1200 draggable?: boolean | 'horizontal' | 'vertical';
1201 silent?: boolean;
1202 ignoreClip?: boolean;
1203 x?: number;
1204 y?: number;
1205 scaleX?: number;
1206 scaleY?: number;
1207 originX?: number;
1208 originY?: number;
1209 rotation?: number;
1210 globalScaleRatio?: number;
1211 textConfig?: ElementTextConfig;
1212 textContent?: ZRText;
1213 clipPath?: Path;
1214 drift?: Element['drift'];
1215 extra?: Dictionary<unknown>;
1216 anid?: string;
1217}
1218declare const PRIMARY_STATES_KEYS: readonly ["x", "y", "scaleX", "scaleY", "originX", "originY", "rotation", "ignore"];
1219declare type ElementStatePropNames = (typeof PRIMARY_STATES_KEYS)[number] | 'textConfig';
1220declare type ElementState = Pick<ElementProps, ElementStatePropNames> & ElementCommonState;
1221declare type ElementCommonState = {
1222 hoverLayer?: boolean;
1223};
1224declare type ElementCalculateTextPosition = (out: TextPositionCalculationResult, style: ElementTextConfig, rect: RectLike) => TextPositionCalculationResult;
1225interface Element<Props extends ElementProps = ElementProps> extends Transformable, Eventful<{
1226 [key in ElementEventName]: (e: ElementEvent) => void | boolean;
1227} & {
1228 [key in string]: (...args: any) => void | boolean;
1229}>, ElementEventHandlerProps {
1230}
1231declare class Element<Props extends ElementProps = ElementProps> {
1232 id: number;
1233 type: string;
1234 name: string;
1235 ignore: boolean;
1236 silent: boolean;
1237 isGroup: boolean;
1238 draggable: boolean | 'horizontal' | 'vertical';
1239 dragging: boolean;
1240 parent: Group;
1241 animators: Animator<any>[];
1242 ignoreClip: boolean;
1243 __hostTarget: Element;
1244 __zr: ZRenderType;
1245 __dirty: number;
1246 __isRendered: boolean;
1247 __inHover: boolean;
1248 private _clipPath?;
1249 private _textContent?;
1250 private _textGuide?;
1251 textConfig?: ElementTextConfig;
1252 textGuideLineConfig?: ElementTextGuideLineConfig;
1253 anid: string;
1254 extra: Dictionary<unknown>;
1255 currentStates?: string[];
1256 prevStates?: string[];
1257 states: Dictionary<ElementState>;
1258 stateTransition: ElementAnimateConfig;
1259 stateProxy?: (stateName: string, targetStates?: string[]) => ElementState;
1260 protected _normalState: ElementState;
1261 private _innerTextDefaultStyle;
1262 constructor(props?: Props);
1263 protected _init(props?: Props): void;
1264 drift(dx: number, dy: number, e?: ElementEvent): void;
1265 beforeUpdate(): void;
1266 afterUpdate(): void;
1267 update(): void;
1268 updateInnerText(forceUpdate?: boolean): void;
1269 protected canBeInsideText(): boolean;
1270 protected getInsideTextFill(): string | undefined;
1271 protected getInsideTextStroke(textFill: string): string | undefined;
1272 protected getOutsideFill(): string | undefined;
1273 protected getOutsideStroke(textFill: string): string;
1274 traverse<Context>(cb: (this: Context, el: Element<Props>) => void, context?: Context): void;
1275 protected attrKV(key: string, value: unknown): void;
1276 hide(): void;
1277 show(): void;
1278 attr(keyOrObj: Props): this;
1279 attr<T extends keyof Props>(keyOrObj: T, value: Props[T]): this;
1280 saveCurrentToNormalState(toState: ElementState): void;
1281 protected _innerSaveToNormal(toState: ElementState): void;
1282 protected _savePrimaryToNormal(toState: Dictionary<any>, normalState: Dictionary<any>, primaryKeys: readonly string[]): void;
1283 hasState(): boolean;
1284 getState(name: string): ElementState;
1285 ensureState(name: string): ElementState;
1286 clearStates(noAnimation?: boolean): void;
1287 useState(stateName: string, keepCurrentStates?: boolean, noAnimation?: boolean, forceUseHoverLayer?: boolean): ElementState;
1288 useStates(states: string[], noAnimation?: boolean, forceUseHoverLayer?: boolean): void;
1289 private _updateAnimationTargets;
1290 removeState(state: string): void;
1291 replaceState(oldState: string, newState: string, forceAdd: boolean): void;
1292 toggleState(state: string, enable: boolean): void;
1293 protected _mergeStates(states: ElementState[]): ElementState;
1294 protected _applyStateObj(stateName: string, state: ElementState, normalState: ElementState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
1295 private _attachComponent;
1296 private _detachComponent;
1297 getClipPath(): Path<PathProps>;
1298 setClipPath(clipPath: Path): void;
1299 removeClipPath(): void;
1300 getTextContent(): ZRText;
1301 setTextContent(textEl: ZRText): void;
1302 setTextConfig(cfg: ElementTextConfig): void;
1303 removeTextConfig(): void;
1304 removeTextContent(): void;
1305 getTextGuideLine(): Polyline;
1306 setTextGuideLine(guideLine: Polyline): void;
1307 removeTextGuideLine(): void;
1308 markRedraw(): void;
1309 dirty(): void;
1310 private _toggleHoverLayerFlag;
1311 addSelfToZr(zr: ZRenderType): void;
1312 removeSelfFromZr(zr: ZRenderType): void;
1313 animate(key?: string, loop?: boolean): Animator<any>;
1314 addAnimator(animator: Animator<any>, key: string): void;
1315 updateDuringAnimation(key: string): void;
1316 stopAnimation(scope?: string, forwardToLast?: boolean): this;
1317 animateTo(target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
1318 animateFrom(target: Props, cfg: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
1319 protected _transitionState(stateName: string, target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
1320 getBoundingRect(): BoundingRect;
1321 getPaintRect(): BoundingRect;
1322 calculateTextPosition: ElementCalculateTextPosition;
1323 protected static initDefaultProps: void;
1324}
1325
1326interface CommonStyleProps {
1327 shadowBlur?: number;
1328 shadowOffsetX?: number;
1329 shadowOffsetY?: number;
1330 shadowColor?: string;
1331 opacity?: number;
1332 blend?: string;
1333}
1334interface DisplayableProps extends ElementProps {
1335 style?: Dictionary<any>;
1336 zlevel?: number;
1337 z?: number;
1338 z2?: number;
1339 culling?: boolean;
1340 cursor?: string;
1341 rectHover?: boolean;
1342 progressive?: boolean;
1343 incremental?: boolean;
1344 batch?: boolean;
1345 invisible?: boolean;
1346}
1347declare type DisplayableKey = keyof DisplayableProps;
1348declare type DisplayablePropertyType = PropType<DisplayableProps, DisplayableKey>;
1349declare type DisplayableStatePropNames = ElementStatePropNames | 'style' | 'z' | 'z2' | 'invisible';
1350declare type DisplayableState = Pick<DisplayableProps, DisplayableStatePropNames> & ElementCommonState;
1351interface Displayable<Props extends DisplayableProps = DisplayableProps> {
1352 animate(key?: '', loop?: boolean): Animator<this>;
1353 animate(key: 'style', loop?: boolean): Animator<this['style']>;
1354 getState(stateName: string): DisplayableState;
1355 ensureState(stateName: string): DisplayableState;
1356 states: Dictionary<DisplayableState>;
1357 stateProxy: (stateName: string) => DisplayableState;
1358}
1359declare class Displayable<Props extends DisplayableProps = DisplayableProps> extends Element<Props> {
1360 invisible: boolean;
1361 z: number;
1362 z2: number;
1363 zlevel: number;
1364 culling: boolean;
1365 cursor: string;
1366 rectHover: boolean;
1367 incremental: boolean;
1368 style: Dictionary<any>;
1369 protected _normalState: DisplayableState;
1370 protected _rect: BoundingRect;
1371 protected _paintRect: BoundingRect;
1372 protected _prevPaintRect: BoundingRect;
1373 dirtyRectTolerance: number;
1374 useHoverLayer?: boolean;
1375 __hoverStyle?: CommonStyleProps;
1376 __clipPaths?: Path[];
1377 __canvasFillGradient: CanvasGradient;
1378 __canvasStrokeGradient: CanvasGradient;
1379 __canvasFillPattern: CanvasPattern;
1380 __canvasStrokePattern: CanvasPattern;
1381 __svgEl: SVGElement;
1382 constructor(props?: Props);
1383 protected _init(props?: Props): void;
1384 beforeBrush(): void;
1385 afterBrush(): void;
1386 innerBeforeBrush(): void;
1387 innerAfterBrush(): void;
1388 shouldBePainted(viewWidth: number, viewHeight: number, considerClipPath: boolean, considerAncestors: boolean): boolean;
1389 contain(x: number, y: number): boolean;
1390 traverse<Context>(cb: (this: Context, el: this) => void, context?: Context): void;
1391 rectContain(x: number, y: number): boolean;
1392 getPaintRect(): BoundingRect;
1393 setPrevPaintRect(paintRect: BoundingRect): void;
1394 getPrevPaintRect(): BoundingRect;
1395 animateStyle(loop: boolean): Animator<this["style"]>;
1396 updateDuringAnimation(targetKey: string): void;
1397 attrKV(key: DisplayableKey, value: DisplayablePropertyType): void;
1398 setStyle(obj: Props['style']): this;
1399 setStyle<T extends keyof Props['style']>(obj: T, value: Props['style'][T]): this;
1400 dirtyStyle(notRedraw?: boolean): void;
1401 dirty(): void;
1402 styleChanged(): boolean;
1403 styleUpdated(): void;
1404 createStyle(obj?: Props['style']): Props["style"];
1405 useStyle(obj: Props['style']): void;
1406 isStyleObject(obj: Props['style']): any;
1407 protected _innerSaveToNormal(toState: DisplayableState): void;
1408 protected _applyStateObj(stateName: string, state: DisplayableState, normalState: DisplayableState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
1409 protected _mergeStates(states: DisplayableState[]): DisplayableState;
1410 protected _mergeStyle(targetStyle: CommonStyleProps, sourceStyle: CommonStyleProps): CommonStyleProps;
1411 getAnimationStyleProps(): MapToType<DisplayableProps, boolean>;
1412 protected static initDefaultProps: void;
1413}
1414
1415interface ExtendedCanvasRenderingContext2D extends CanvasRenderingContext2D {
1416 dpr?: number;
1417}
1418declare class PathProxy {
1419 dpr: number;
1420 data: number[] | Float32Array;
1421 private _version;
1422 private _saveData;
1423 private _pendingPtX;
1424 private _pendingPtY;
1425 private _pendingPtDist;
1426 private _ctx;
1427 private _xi;
1428 private _yi;
1429 private _x0;
1430 private _y0;
1431 private _len;
1432 private _pathSegLen;
1433 private _pathLen;
1434 private _ux;
1435 private _uy;
1436 private _lineDash;
1437 private _needsDash;
1438 private _dashOffset;
1439 private _dashIdx;
1440 private _dashSum;
1441 static CMD: {
1442 M: number;
1443 L: number;
1444 C: number;
1445 Q: number;
1446 A: number;
1447 Z: number;
1448 R: number;
1449 };
1450 constructor(notSaveData?: boolean);
1451 increaseVersion(): void;
1452 getVersion(): number;
1453 setScale(sx: number, sy: number, segmentIgnoreThreshold?: number): void;
1454 setDPR(dpr: number): void;
1455 setContext(ctx: ExtendedCanvasRenderingContext2D): void;
1456 getContext(): ExtendedCanvasRenderingContext2D;
1457 beginPath(): this;
1458 reset(): void;
1459 moveTo(x: number, y: number): this;
1460 lineTo(x: number, y: number): this;
1461 bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): this;
1462 quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): this;
1463 arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise?: boolean): this;
1464 arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this;
1465 rect(x: number, y: number, w: number, h: number): this;
1466 closePath(): this;
1467 fill(ctx: CanvasRenderingContext2D): void;
1468 stroke(ctx: CanvasRenderingContext2D): void;
1469 setLineDash(lineDash: number[] | false): this;
1470 setLineDashOffset(offset: number): this;
1471 len(): number;
1472 setData(data: Float32Array | number[]): void;
1473 appendPath(path: PathProxy | PathProxy[]): void;
1474 addData(cmd: number, a?: number, b?: number, c?: number, d?: number, e?: number, f?: number, g?: number, h?: number): void;
1475 private _drawPendingPt;
1476 private _expandData;
1477 private _dashedLineTo;
1478 private _dashedBezierTo;
1479 private _dashedQuadraticTo;
1480 toStatic(): void;
1481 getBoundingRect(): BoundingRect;
1482 private _calculateLength;
1483 rebuildPath(ctx: PathRebuilder, percent: number): void;
1484 clone(): PathProxy;
1485 private static initDefaultProps;
1486}
1487interface PathRebuilder {
1488 moveTo(x: number, y: number): void;
1489 lineTo(x: number, y: number): void;
1490 bezierCurveTo(x: number, y: number, x2: number, y2: number, x3: number, y3: number): void;
1491 quadraticCurveTo(x: number, y: number, x2: number, y2: number): void;
1492 arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;
1493 ellipse(cx: number, cy: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;
1494 rect(x: number, y: number, width: number, height: number): void;
1495 closePath(): void;
1496}
1497
1498interface LinearGradientObject extends GradientObject {
1499 type: 'linear';
1500 x: number;
1501 y: number;
1502 x2: number;
1503 y2: number;
1504}
1505declare class LinearGradient extends Gradient {
1506 type: 'linear';
1507 x: number;
1508 y: number;
1509 x2: number;
1510 y2: number;
1511 constructor(x: number, y: number, x2: number, y2: number, colorStops?: GradientColorStop[], globalCoord?: boolean);
1512}
1513
1514interface RadialGradientObject extends GradientObject {
1515 type: 'radial';
1516 x: number;
1517 y: number;
1518 r: number;
1519}
1520declare class RadialGradient extends Gradient {
1521 type: 'radial';
1522 x: number;
1523 y: number;
1524 r: number;
1525 constructor(x: number, y: number, r: number, colorStops?: GradientColorStop[], globalCoord?: boolean);
1526}
1527
1528interface PathStyleProps extends CommonStyleProps {
1529 fill?: string | PatternObject | LinearGradientObject | RadialGradientObject;
1530 stroke?: string | PatternObject | LinearGradientObject | RadialGradientObject;
1531 decal?: PatternObject;
1532 strokePercent?: number;
1533 strokeNoScale?: boolean;
1534 fillOpacity?: number;
1535 strokeOpacity?: number;
1536 lineDash?: false | number[] | 'solid' | 'dashed' | 'dotted';
1537 lineDashOffset?: number;
1538 lineWidth?: number;
1539 lineCap?: CanvasLineCap;
1540 lineJoin?: CanvasLineJoin;
1541 miterLimit?: number;
1542 strokeFirst?: boolean;
1543}
1544interface PathProps extends DisplayableProps {
1545 strokeContainThreshold?: number;
1546 segmentIgnoreThreshold?: number;
1547 subPixelOptimize?: boolean;
1548 style?: PathStyleProps;
1549 shape?: Dictionary<any>;
1550 autoBatch?: boolean;
1551 __value?: (string | number)[] | (string | number);
1552 buildPath?: (ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary<any>, inBatch?: boolean) => void;
1553}
1554declare type PathKey = keyof PathProps;
1555declare type PathPropertyType = PropType<PathProps, PathKey>;
1556declare type PathStatePropNames = DisplayableStatePropNames | 'shape';
1557declare type PathState = Pick<PathProps, PathStatePropNames> & {
1558 hoverLayer?: boolean;
1559};
1560interface Path<Props extends PathProps = PathProps> {
1561 animate(key?: '', loop?: boolean): Animator<this>;
1562 animate(key: 'style', loop?: boolean): Animator<this['style']>;
1563 animate(key: 'shape', loop?: boolean): Animator<this['shape']>;
1564 getState(stateName: string): PathState;
1565 ensureState(stateName: string): PathState;
1566 states: Dictionary<PathState>;
1567 stateProxy: (stateName: string) => PathState;
1568}
1569declare class Path<Props extends PathProps = PathProps> extends Displayable<Props> {
1570 path: PathProxy;
1571 strokeContainThreshold: number;
1572 segmentIgnoreThreshold: number;
1573 subPixelOptimize: boolean;
1574 style: PathStyleProps;
1575 autoBatch: boolean;
1576 private _rectWithStroke;
1577 protected _normalState: PathState;
1578 protected _decalEl: Path;
1579 shape: Dictionary<any>;
1580 constructor(opts?: Props);
1581 update(): void;
1582 getDecalElement(): Path<PathProps>;
1583 protected _init(props?: Props): void;
1584 protected getDefaultStyle(): Props['style'];
1585 protected getDefaultShape(): {};
1586 protected canBeInsideText(): boolean;
1587 protected getInsideTextFill(): "#333" | "#ccc" | "#eee";
1588 protected getInsideTextStroke(textFill?: string): string;
1589 buildPath(ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary<any>, inBatch?: boolean): void;
1590 pathUpdated(): void;
1591 getUpdatedPathProxy(inBatch?: boolean): PathProxy;
1592 createPathProxy(): void;
1593 hasStroke(): boolean;
1594 hasFill(): boolean;
1595 getBoundingRect(): BoundingRect;
1596 contain(x: number, y: number): boolean;
1597 dirtyShape(): void;
1598 dirty(): void;
1599 animateShape(loop: boolean): Animator<this["shape"]>;
1600 updateDuringAnimation(targetKey: string): void;
1601 attrKV(key: PathKey, value: PathPropertyType): void;
1602 setShape(obj: Props['shape']): this;
1603 setShape<T extends keyof Props['shape']>(obj: T, value: Props['shape'][T]): this;
1604 shapeChanged(): boolean;
1605 createStyle(obj?: Props['style']): Props["style"];
1606 protected _innerSaveToNormal(toState: PathState): void;
1607 protected _applyStateObj(stateName: string, state: PathState, normalState: PathState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
1608 protected _mergeStates(states: PathState[]): PathState;
1609 getAnimationStyleProps(): MapToType<PathProps, boolean>;
1610 isZeroArea(): boolean;
1611 static extend<Shape extends Dictionary<any>>(defaultProps: {
1612 type?: string;
1613 shape?: Shape;
1614 style?: PathStyleProps;
1615 beforeBrush?: Displayable['beforeBrush'];
1616 afterBrush?: Displayable['afterBrush'];
1617 getBoundingRect?: Displayable['getBoundingRect'];
1618 calculateTextPosition?: Element['calculateTextPosition'];
1619 buildPath(this: Path, ctx: CanvasRenderingContext2D | PathProxy, shape: Shape, inBatch?: boolean): void;
1620 init?(this: Path, opts: PathProps): void;
1621 }): {
1622 new (opts?: PathProps & {
1623 shape: Shape;
1624 }): Path;
1625 };
1626 protected static initDefaultProps: void;
1627}
1628
1629declare type SVGPathOption = Omit<PathProps, 'shape' | 'buildPath'>;
1630declare class SVGPath extends Path {
1631 applyTransform(m: MatrixArray): void;
1632}
1633declare function extendFromString(str: string, defaultOpts?: SVGPathOption): typeof SVGPath;
1634declare function mergePath(pathEls: Path[], opts: PathProps): Path<PathProps>;
1635
1636declare class CircleShape {
1637 cx: number;
1638 cy: number;
1639 r: number;
1640}
1641interface CircleProps extends PathProps {
1642 shape?: Partial<CircleShape>;
1643}
1644declare class Circle extends Path<CircleProps> {
1645 shape: CircleShape;
1646 constructor(opts?: CircleProps);
1647 getDefaultShape(): CircleShape;
1648 buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape, inBundle: boolean): void;
1649}
1650
1651declare class EllipseShape {
1652 cx: number;
1653 cy: number;
1654 rx: number;
1655 ry: number;
1656}
1657interface EllipseProps extends PathProps {
1658 shape?: Partial<EllipseShape>;
1659}
1660declare class Ellipse extends Path<EllipseProps> {
1661 shape: EllipseShape;
1662 constructor(opts?: EllipseProps);
1663 getDefaultShape(): EllipseShape;
1664 buildPath(ctx: CanvasRenderingContext2D, shape: EllipseShape): void;
1665}
1666
1667declare class SectorShape {
1668 cx: number;
1669 cy: number;
1670 r0: number;
1671 r: number;
1672 startAngle: number;
1673 endAngle: number;
1674 clockwise: boolean;
1675 cornerRadius: number;
1676 innerCornerRadius: number;
1677}
1678interface SectorProps extends PathProps {
1679 shape?: Partial<SectorShape>;
1680}
1681declare class Sector extends Path<SectorProps> {
1682 shape: SectorShape;
1683 constructor(opts?: SectorProps);
1684 getDefaultShape(): SectorShape;
1685 buildPath(ctx: CanvasRenderingContext2D, shape: SectorShape): void;
1686 isZeroArea(): boolean;
1687}
1688
1689declare class RingShape {
1690 cx: number;
1691 cy: number;
1692 r: number;
1693 r0: number;
1694}
1695interface RingProps extends PathProps {
1696 shape?: Partial<RingShape>;
1697}
1698declare class Ring extends Path<RingProps> {
1699 shape: RingShape;
1700 constructor(opts?: RingProps);
1701 getDefaultShape(): RingShape;
1702 buildPath(ctx: CanvasRenderingContext2D, shape: RingShape): void;
1703}
1704
1705declare class PolygonShape {
1706 points: VectorArray[];
1707 smooth?: number | 'spline';
1708 smoothConstraint?: VectorArray[];
1709}
1710interface PolygonProps extends PathProps {
1711 shape?: Partial<PolygonShape>;
1712}
1713declare class Polygon extends Path<PolygonProps> {
1714 shape: PolygonShape;
1715 constructor(opts?: PolygonProps);
1716 getDefaultShape(): PolygonShape;
1717 buildPath(ctx: CanvasRenderingContext2D, shape: PolygonShape): void;
1718}
1719
1720declare class LineShape {
1721 x1: number;
1722 y1: number;
1723 x2: number;
1724 y2: number;
1725 percent: number;
1726}
1727interface LineProps extends PathProps {
1728 shape?: Partial<LineShape>;
1729}
1730declare class Line extends Path<LineProps> {
1731 shape: LineShape;
1732 constructor(opts?: LineProps);
1733 getDefaultStyle(): {
1734 stroke: string;
1735 fill: string;
1736 };
1737 getDefaultShape(): LineShape;
1738 buildPath(ctx: CanvasRenderingContext2D, shape: LineShape): void;
1739 pointAt(p: number): VectorArray;
1740}
1741
1742declare class BezierCurveShape {
1743 x1: number;
1744 y1: number;
1745 x2: number;
1746 y2: number;
1747 cpx1: number;
1748 cpy1: number;
1749 cpx2?: number;
1750 cpy2?: number;
1751 percent: number;
1752}
1753interface BezierCurveProps extends PathProps {
1754 shape?: Partial<BezierCurveShape>;
1755}
1756declare class BezierCurve extends Path<BezierCurveProps> {
1757 shape: BezierCurveShape;
1758 constructor(opts?: BezierCurveProps);
1759 getDefaultStyle(): {
1760 stroke: string;
1761 fill: string;
1762 };
1763 getDefaultShape(): BezierCurveShape;
1764 buildPath(ctx: CanvasRenderingContext2D, shape: BezierCurveShape): void;
1765 pointAt(t: number): number[];
1766 tangentAt(t: number): number[];
1767}
1768
1769declare class ArcShape {
1770 cx: number;
1771 cy: number;
1772 r: number;
1773 startAngle: number;
1774 endAngle: number;
1775 clockwise?: boolean;
1776}
1777interface ArcProps extends PathProps {
1778 shape?: Partial<ArcShape>;
1779}
1780declare class Arc extends Path<ArcProps> {
1781 shape: ArcShape;
1782 constructor(opts?: ArcProps);
1783 getDefaultStyle(): {
1784 stroke: string;
1785 fill: string;
1786 };
1787 getDefaultShape(): ArcShape;
1788 buildPath(ctx: CanvasRenderingContext2D, shape: ArcShape): void;
1789}
1790
1791interface CompoundPathShape {
1792 paths: Path[];
1793}
1794declare class CompoundPath extends Path {
1795 type: string;
1796 shape: CompoundPathShape;
1797 private _updatePathDirty;
1798 beforeBrush(): void;
1799 buildPath(ctx: PathProxy | CanvasRenderingContext2D, shape: CompoundPathShape): void;
1800 afterBrush(): void;
1801 getBoundingRect(): BoundingRect;
1802}
1803
1804declare class IncrementalDisplayable extends Displayable {
1805 notClear: boolean;
1806 incremental: boolean;
1807 private _displayables;
1808 private _temporaryDisplayables;
1809 private _cursor;
1810 traverse<T>(cb: (this: T, el: this) => void, context: T): void;
1811 useStyle(): void;
1812 getCursor(): number;
1813 innerAfterBrush(): void;
1814 clearDisplaybles(): void;
1815 clearTemporalDisplayables(): void;
1816 addDisplayable(displayable: Displayable, notPersistent?: boolean): void;
1817 addDisplayables(displayables: Displayable[], notPersistent?: boolean): void;
1818 getDisplayables(): Displayable[];
1819 getTemporalDisplayables(): Displayable[];
1820 eachPendingDisplayable(cb: (displayable: Displayable) => void): void;
1821 update(): void;
1822 getBoundingRect(): BoundingRect;
1823 contain(x: number, y: number): boolean;
1824}
1825
1826declare type Constructor = new (...args: any) => any;
1827interface ClassManager {
1828 registerClass: (clz: Constructor) => Constructor;
1829 getClass: (componentMainType: ComponentMainType, subType?: ComponentSubType, throwWhenNotFound?: boolean) => Constructor;
1830 getClassesByMainType: (componentType: ComponentMainType) => Constructor[];
1831 hasClass: (componentType: ComponentFullType) => boolean;
1832 getAllClassMainTypes: () => ComponentMainType[];
1833 hasSubTypes: (componentType: ComponentFullType) => boolean;
1834}
1835
1836interface SubTypeDefaulter {
1837 (option: ComponentOption): ComponentSubType;
1838}
1839interface SubTypeDefaulterManager {
1840 registerSubTypeDefaulter: (componentType: string, defaulter: SubTypeDefaulter) => void;
1841 determineSubType: (componentType: string, option: ComponentOption) => string;
1842}
1843
1844declare type DiffKeyGetter<CTX = unknown> = (this: DataDiffer<CTX>, value: unknown, index: number) => string;
1845declare type DiffCallbackAdd = (newIndex: number) => void;
1846declare type DiffCallbackUpdate = (newIndex: number, oldIndex: number) => void;
1847declare type DiffCallbackRemove = (oldIndex: number) => void;
1848declare type DiffCallbackUpdateManyToOne = (newIndex: number, oldIndex: number[]) => void;
1849declare type DiffCallbackUpdateOneToMany = (newIndex: number[], oldIndex: number) => void;
1850declare type DiffCallbackUpdateManyToMany = (newIndex: number[], oldIndex: number[]) => void;
1851declare type DataDiffMode = 'oneToOne' | 'multiple';
1852declare class DataDiffer<CTX = unknown> {
1853 private _old;
1854 private _new;
1855 private _oldKeyGetter;
1856 private _newKeyGetter;
1857 private _add;
1858 private _update;
1859 private _updateManyToOne;
1860 private _updateOneToMany;
1861 private _updateManyToMany;
1862 private _remove;
1863 private _diffModeMultiple;
1864 readonly context: CTX;
1865 /**
1866 * @param context Can be visited by this.context in callback.
1867 */
1868 constructor(oldArr: ArrayLike$1<unknown>, newArr: ArrayLike$1<unknown>, oldKeyGetter?: DiffKeyGetter<CTX>, newKeyGetter?: DiffKeyGetter<CTX>, context?: CTX, diffMode?: DataDiffMode);
1869 /**
1870 * Callback function when add a data
1871 */
1872 add(func: DiffCallbackAdd): this;
1873 /**
1874 * Callback function when update a data
1875 */
1876 update(func: DiffCallbackUpdate): this;
1877 /**
1878 * Callback function when update a data and only work in `cbMode: 'byKey'`.
1879 */
1880 updateManyToOne(func: DiffCallbackUpdateManyToOne): this;
1881 /**
1882 * Callback function when update a data and only work in `cbMode: 'byKey'`.
1883 */
1884 updateOneToMany(func: DiffCallbackUpdateOneToMany): this;
1885 /**
1886 * Callback function when update a data and only work in `cbMode: 'byKey'`.
1887 */
1888 updateManyToMany(func: DiffCallbackUpdateManyToMany): this;
1889 /**
1890 * Callback function when remove a data
1891 */
1892 remove(func: DiffCallbackRemove): this;
1893 execute(): void;
1894 private _executeOneToOne;
1895 /**
1896 * For example, consider the case:
1897 * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],
1898 * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],
1899 * Where:
1900 * o0, o1, n0 has key 'a' (many to one)
1901 * o5, n4, n5, n6 has key 'b' (one to many)
1902 * o2, n1 has key 'c' (one to one)
1903 * n2, n3 has key 'd' (add)
1904 * o3, o4 has key 'e' (remove)
1905 * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)
1906 * Then:
1907 * (The order of the following directives are not ensured.)
1908 * this._updateManyToOne(n0, [o0, o1]);
1909 * this._updateOneToMany([n4, n5, n6], o5);
1910 * this._update(n1, o2);
1911 * this._remove(o3);
1912 * this._remove(o4);
1913 * this._remove(o6);
1914 * this._remove(o7);
1915 * this._add(n2);
1916 * this._add(n3);
1917 * this._add(n7);
1918 * this._add(n8);
1919 */
1920 private _executeMultiple;
1921 private _performRestAdd;
1922 private _initIndexMap;
1923}
1924
1925declare type PipedDataTransformOption = DataTransformOption[];
1926declare type DataTransformType = string;
1927declare type DataTransformConfig = unknown;
1928interface DataTransformOption {
1929 type: DataTransformType;
1930 config?: DataTransformConfig;
1931 print?: boolean;
1932}
1933interface ExternalDataTransform<TO extends DataTransformOption = DataTransformOption> {
1934 type: string;
1935 __isBuiltIn?: boolean;
1936 transform: (param: ExternalDataTransformParam<TO>) => ExternalDataTransformResultItem | ExternalDataTransformResultItem[];
1937}
1938interface ExternalDataTransformParam<TO extends DataTransformOption = DataTransformOption> {
1939 upstream: ExternalSource;
1940 upstreamList: ExternalSource[];
1941 config: TO['config'];
1942}
1943interface ExternalDataTransformResultItem {
1944 /**
1945 * If `data` is null/undefined, inherit upstream data.
1946 */
1947 data: OptionSourceDataArrayRows | OptionSourceDataObjectRows;
1948 /**
1949 * A `transform` can optionally return a dimensions definition.
1950 * The rule:
1951 * If this `transform result` have different dimensions from the upstream, it should return
1952 * a new dimension definition. For example, this transform inherit the upstream data totally
1953 * but add a extra dimension.
1954 * Otherwise, do not need to return that dimension definition. echarts will inherit dimension
1955 * definition from the upstream.
1956 */
1957 dimensions?: DimensionDefinitionLoose[];
1958}
1959declare type DataTransformDataItem = ExternalDataTransformResultItem['data'][number];
1960interface ExternalDimensionDefinition extends Partial<DimensionDefinition> {
1961 index: DimensionIndex;
1962}
1963/**
1964 * TODO: disable writable.
1965 * This structure will be exposed to users.
1966 */
1967declare class ExternalSource {
1968 /**
1969 * [Caveat]
1970 * This instance is to be exposed to users.
1971 * (1) DO NOT mount private members on this instance directly.
1972 * If we have to use private members, we can make them in closure or use `makeInner`.
1973 * (2) "soruce header count" is not provided to transform, because it's complicated to manage
1974 * header and dimensions definition in each transfrom. Source header are all normalized to
1975 * dimensions definitions in transforms and their downstreams.
1976 */
1977 sourceFormat: SourceFormat;
1978 getRawData(): Source['data'];
1979 getRawDataItem(dataIndex: number): DataTransformDataItem;
1980 cloneRawData(): Source['data'];
1981 /**
1982 * @return If dimension not found, return null/undefined.
1983 */
1984 getDimensionInfo(dim: DimensionLoose): ExternalDimensionDefinition;
1985 /**
1986 * dimensions defined if and only if either:
1987 * (a) dataset.dimensions are declared.
1988 * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).
1989 * If dimensions are defined, `dimensionInfoAll` is corresponding to
1990 * the defined dimensions.
1991 * Otherwise, `dimensionInfoAll` is determined by data columns.
1992 * @return Always return an array (even empty array).
1993 */
1994 cloneAllDimensionInfo(): ExternalDimensionDefinition[];
1995 count(): number;
1996 /**
1997 * Only support by dimension index.
1998 * No need to support by dimension name in transform function,
1999 * becuase transform function is not case-specific, no need to use name literally.
2000 */
2001 retrieveValue(dataIndex: number, dimIndex: DimensionIndex): OptionDataValue;
2002 retrieveValueFromItem(dataItem: DataTransformDataItem, dimIndex: DimensionIndex): OptionDataValue;
2003 convertValue(rawVal: unknown, dimInfo: ExternalDimensionDefinition): ParsedValue;
2004}
2005declare function registerExternalTransform(externalTransform: ExternalDataTransform): void;
2006
2007interface PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> extends Pick<Model<T>, 'get'> {
2008}
2009declare class PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> {
2010 getColorFromPalette(this: PaletteMixin<T>, name: string, scope?: any, requestNum?: number): ZRColor;
2011 clearColorPalette(this: PaletteMixin<T>): void;
2012}
2013
2014interface ComponentView {
2015 /**
2016 * Implement it if needed.
2017 */
2018 updateTransform?(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
2019 update: true;
2020 };
2021 /**
2022 * Pass only when return `true`.
2023 * Implement it if needed.
2024 */
2025 filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
2026 /**
2027 * Find dispatchers for highlight/downplay by name.
2028 * If this methods provided, hover link (within the same name) is enabled in component.
2029 * That is, in component, a name can correspond to multiple dispatchers.
2030 * Those dispatchers can have no common ancestor.
2031 * The highlight/downplay state change will be applied on the
2032 * dispatchers and their descendents.
2033 *
2034 * @return Must return an array but not null/undefined.
2035 */
2036 findHighDownDispatchers?(name: string): Element[];
2037 focusBlurEnabled?: boolean;
2038}
2039declare class ComponentView {
2040 readonly group: ViewRootGroup;
2041 readonly uid: string;
2042 __model: ComponentModel;
2043 __alive: boolean;
2044 __id: string;
2045 constructor();
2046 init(ecModel: GlobalModel, api: ExtensionAPI): void;
2047 render(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2048 dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
2049 updateView(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2050 updateLayout(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2051 updateVisual(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2052 /**
2053 * Hook for blur target series.
2054 * Can be used in marker for blur the markers
2055 */
2056 blurSeries(seriesModels: SeriesModel[], ecModel: GlobalModel): void;
2057 static registerClass: ClassManager['registerClass'];
2058}
2059
2060interface TaskContext {
2061 outputData?: SeriesData;
2062 data?: SeriesData;
2063 payload?: Payload;
2064 model?: SeriesModel;
2065}
2066declare type TaskResetCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskResetCallbackReturn<Ctx>;
2067declare type TaskResetCallbackReturn<Ctx extends TaskContext> = void | (TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[]) | {
2068 forceFirstProgress?: boolean;
2069 progress: TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[];
2070};
2071declare type TaskProgressCallback<Ctx extends TaskContext> = (this: Task<Ctx>, params: TaskProgressParams, context: Ctx) => void;
2072declare type TaskProgressParams = {
2073 start: number;
2074 end: number;
2075 count: number;
2076 next?: TaskDataIteratorNext;
2077};
2078declare type TaskPlanCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskPlanCallbackReturn;
2079declare type TaskPlanCallbackReturn = 'reset' | false | null | undefined;
2080declare type TaskCountCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => number;
2081declare type TaskOnDirtyCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => void;
2082declare type TaskDataIteratorNext = () => number;
2083declare type TaskDefineParam<Ctx extends TaskContext> = {
2084 reset?: TaskResetCallback<Ctx>;
2085 plan?: TaskPlanCallback<Ctx>;
2086 count?: TaskCountCallback<Ctx>;
2087 onDirty?: TaskOnDirtyCallback<Ctx>;
2088};
2089declare type PerformArgs = {
2090 step?: number;
2091 skip?: boolean;
2092 modBy?: number;
2093 modDataCount?: number;
2094};
2095declare class Task<Ctx extends TaskContext> {
2096 private _reset;
2097 private _plan;
2098 private _count;
2099 private _onDirty;
2100 private _progress;
2101 private _callingProgress;
2102 private _dirty;
2103 private _modBy;
2104 private _modDataCount;
2105 private _upstream;
2106 private _downstream;
2107 private _dueEnd;
2108 private _outputDueEnd;
2109 private _settedOutputEnd;
2110 private _dueIndex;
2111 private _disposed;
2112 __pipeline: Pipeline;
2113 __idxInPipeline: number;
2114 __block: boolean;
2115 context: Ctx;
2116 constructor(define: TaskDefineParam<Ctx>);
2117 /**
2118 * @param step Specified step.
2119 * @param skip Skip customer perform call.
2120 * @param modBy Sampling window size.
2121 * @param modDataCount Sampling count.
2122 * @return whether unfinished.
2123 */
2124 perform(performArgs?: PerformArgs): boolean;
2125 dirty(): void;
2126 private _doProgress;
2127 private _doReset;
2128 unfinished(): boolean;
2129 /**
2130 * @param downTask The downstream task.
2131 * @return The downstream task.
2132 */
2133 pipe(downTask: Task<Ctx>): void;
2134 dispose(): void;
2135 getUpstream(): Task<Ctx>;
2136 getDownstream(): Task<Ctx>;
2137 setOutputEnd(end: number): void;
2138}
2139
2140declare type GeneralTask = Task<TaskContext>;
2141declare type SeriesTask = Task<SeriesTaskContext>;
2142declare type Pipeline = {
2143 id: string;
2144 head: GeneralTask;
2145 tail: GeneralTask;
2146 threshold: number;
2147 progressiveEnabled: boolean;
2148 blockIndex: number;
2149 step: number;
2150 count: number;
2151 currentTask?: GeneralTask;
2152 context?: PipelineContext;
2153};
2154declare type PipelineContext = {
2155 progressiveRender: boolean;
2156 modDataCount: number;
2157 large: boolean;
2158};
2159declare type PerformStageTaskOpt = {
2160 block?: boolean;
2161 setDirty?: boolean;
2162 visualType?: StageHandlerInternal['visualType'];
2163 dirtyMap?: HashMap<any>;
2164};
2165interface SeriesTaskContext extends TaskContext {
2166 model?: SeriesModel;
2167 data?: SeriesData;
2168 view?: ChartView;
2169 ecModel?: GlobalModel;
2170 api?: ExtensionAPI;
2171 useClearVisual?: boolean;
2172 plan?: StageHandlerPlan;
2173 reset?: StageHandlerReset;
2174 scheduler?: Scheduler;
2175 payload?: Payload;
2176 resetDefines?: StageHandlerProgressExecutor[];
2177}
2178interface OverallTaskContext extends TaskContext {
2179 ecModel: GlobalModel;
2180 api: ExtensionAPI;
2181 overallReset: StageHandlerOverallReset;
2182 scheduler: Scheduler;
2183 payload?: Payload;
2184}
2185declare class Scheduler {
2186 readonly ecInstance: EChartsType;
2187 readonly api: ExtensionAPI;
2188 unfinished: boolean;
2189 private _dataProcessorHandlers;
2190 private _visualHandlers;
2191 private _allHandlers;
2192 private _stageTaskMap;
2193 private _pipelineMap;
2194 constructor(ecInstance: EChartsType, api: ExtensionAPI, dataProcessorHandlers: StageHandlerInternal[], visualHandlers: StageHandlerInternal[]);
2195 restoreData(ecModel: GlobalModel, payload: Payload): void;
2196 getPerformArgs(task: GeneralTask, isBlock?: boolean): {
2197 step: number;
2198 modBy: number;
2199 modDataCount: number;
2200 };
2201 getPipeline(pipelineId: string): Pipeline;
2202 /**
2203 * Current, progressive rendering starts from visual and layout.
2204 * Always detect render mode in the same stage, avoiding that incorrect
2205 * detection caused by data filtering.
2206 * Caution:
2207 * `updateStreamModes` use `seriesModel.getData()`.
2208 */
2209 updateStreamModes(seriesModel: SeriesModel<SeriesOption & SeriesLargeOptionMixin>, view: ChartView): void;
2210 restorePipelines(ecModel: GlobalModel): void;
2211 prepareStageTasks(): void;
2212 prepareView(view: ChartView, model: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
2213 performDataProcessorTasks(ecModel: GlobalModel, payload?: Payload): void;
2214 performVisualTasks(ecModel: GlobalModel, payload?: Payload, opt?: PerformStageTaskOpt): void;
2215 private _performStageTasks;
2216 performSeriesTasks(ecModel: GlobalModel): void;
2217 plan(): void;
2218 updatePayload(task: Task<SeriesTaskContext | OverallTaskContext>, payload: Payload | 'remain'): void;
2219 private _createSeriesStageTask;
2220 private _createOverallStageTask;
2221 private _pipe;
2222 static wrapStageHandler(stageHandler: StageHandler | StageHandlerOverallReset, visualType: StageHandlerInternal['visualType']): StageHandlerInternal;
2223}
2224
2225interface ChartView {
2226 /**
2227 * Rendering preparation in progressive mode.
2228 * Implement it if needed.
2229 */
2230 incrementalPrepareRender(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2231 /**
2232 * Render in progressive mode.
2233 * Implement it if needed.
2234 * @param params See taskParams in `stream/task.js`
2235 */
2236 incrementalRender(params: StageHandlerProgressParams, seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2237 /**
2238 * Update transform directly.
2239 * Implement it if needed.
2240 */
2241 updateTransform(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
2242 update: true;
2243 };
2244 /**
2245 * The view contains the given point.
2246 * Implement it if needed.
2247 */
2248 containPoint(point: number[], seriesModel: SeriesModel): boolean;
2249 /**
2250 * Pass only when return `true`.
2251 * Implement it if needed.
2252 */
2253 filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
2254}
2255declare class ChartView {
2256 type: string;
2257 readonly group: ViewRootGroup;
2258 readonly uid: string;
2259 readonly renderTask: SeriesTask;
2260 /**
2261 * Ignore label line update in global stage. Will handle it in chart itself.
2262 * Used in pie / funnel
2263 */
2264 ignoreLabelLineUpdate: boolean;
2265 __alive: boolean;
2266 __model: SeriesModel;
2267 __id: string;
2268 static protoInitialize: void;
2269 constructor();
2270 init(ecModel: GlobalModel, api: ExtensionAPI): void;
2271 render(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2272 /**
2273 * Highlight series or specified data item.
2274 */
2275 highlight(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2276 /**
2277 * Downplay series or specified data item.
2278 */
2279 downplay(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2280 /**
2281 * Remove self.
2282 */
2283 remove(ecModel: GlobalModel, api: ExtensionAPI): void;
2284 /**
2285 * Dispose self.
2286 */
2287 dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
2288 updateView(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2289 updateLayout(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2290 updateVisual(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
2291 static markUpdateMethod(payload: Payload, methodName: keyof ChartView): void;
2292 static registerClass: ClassManager['registerClass'];
2293}
2294
2295declare const availableMethods: (keyof EChartsType)[];
2296interface ExtensionAPI extends Pick<EChartsType, (typeof availableMethods)[number]> {
2297}
2298declare abstract class ExtensionAPI {
2299 constructor(ecInstance: EChartsType);
2300 abstract getCoordinateSystems(): CoordinateSystemMaster[];
2301 abstract getComponentByElement(el: Element): ComponentModel;
2302 abstract enterEmphasis(el: Element, highlightDigit?: number): void;
2303 abstract leaveEmphasis(el: Element, highlightDigit?: number): void;
2304 abstract enterSelect(el: Element): void;
2305 abstract leaveSelect(el: Element): void;
2306 abstract enterBlur(el: Element): void;
2307 abstract leaveBlur(el: Element): void;
2308 abstract getViewOfComponentModel(componentModel: ComponentModel): ComponentView;
2309 abstract getViewOfSeriesModel(seriesModel: SeriesModel): ChartView;
2310 abstract getModel(): GlobalModel;
2311}
2312
2313declare const AXIS_TYPES: {
2314 readonly value: 1;
2315 readonly category: 1;
2316 readonly time: 1;
2317 readonly log: 1;
2318};
2319declare type OptionAxisType = keyof typeof AXIS_TYPES;
2320interface AxisBaseOptionCommon extends ComponentOption, AnimationOptionMixin {
2321 type?: OptionAxisType;
2322 show?: boolean;
2323 inverse?: boolean;
2324 name?: string;
2325 nameLocation?: 'start' | 'middle' | 'end';
2326 nameRotate?: number;
2327 nameTruncate?: {
2328 maxWidth?: number;
2329 ellipsis?: string;
2330 placeholder?: string;
2331 };
2332 nameTextStyle?: AxisNameTextStyleOption;
2333 nameGap?: number;
2334 silent?: boolean;
2335 triggerEvent?: boolean;
2336 tooltip?: {
2337 show?: boolean;
2338 };
2339 axisLabel?: AxisLabelBaseOption;
2340 axisPointer?: CommonAxisPointerOption;
2341 axisLine?: AxisLineOption;
2342 axisTick?: AxisTickOption;
2343 minorTick?: MinorTickOption;
2344 splitLine?: SplitLineOption;
2345 minorSplitLine?: MinorSplitLineOption;
2346 splitArea?: SplitAreaOption;
2347 /**
2348 * Min value of the axis. can be:
2349 * + ScaleDataValue
2350 * + 'dataMin': use the min value in data.
2351 * + null/undefined: auto decide min value (consider pretty look and boundaryGap).
2352 */
2353 min?: ScaleDataValue | 'dataMin' | ((extent: {
2354 min: number;
2355 max: number;
2356 }) => ScaleDataValue);
2357 /**
2358 * Max value of the axis. can be:
2359 * + ScaleDataValue
2360 * + 'dataMax': use the max value in data.
2361 * + null/undefined: auto decide max value (consider pretty look and boundaryGap).
2362 */
2363 max?: ScaleDataValue | 'dataMax' | ((extent: {
2364 min: number;
2365 max: number;
2366 }) => ScaleDataValue);
2367 scale?: boolean;
2368}
2369interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon {
2370 boundaryGap?: [number | string, number | string];
2371 /**
2372 * AxisTick and axisLabel and splitLine are caculated based on splitNumber.
2373 */
2374 splitNumber?: number;
2375 /**
2376 * Interval specifies the span of the ticks is mandatorily.
2377 */
2378 interval?: number;
2379 /**
2380 * Specify min interval when auto calculate tick interval.
2381 */
2382 minInterval?: number;
2383 /**
2384 * Specify max interval when auto calculate tick interval.
2385 */
2386 maxInterval?: number;
2387}
2388interface CategoryAxisBaseOption extends AxisBaseOptionCommon {
2389 type?: 'category';
2390 boundaryGap?: boolean;
2391 axisLabel?: AxisLabelOption<'category'> & {
2392 interval?: 'auto' | number | ((index: number, value: string) => boolean);
2393 };
2394 data?: (OrdinalRawValue | {
2395 value: OrdinalRawValue;
2396 textStyle?: TextCommonOption;
2397 })[];
2398 deduplication?: boolean;
2399 axisTick?: AxisBaseOptionCommon['axisTick'] & {
2400 alignWithLabel?: boolean;
2401 interval?: 'auto' | number | ((index: number, value: string) => boolean);
2402 };
2403}
2404interface ValueAxisBaseOption extends NumericAxisBaseOptionCommon {
2405 type?: 'value';
2406 axisLabel?: AxisLabelOption<'value'>;
2407}
2408interface LogAxisBaseOption extends NumericAxisBaseOptionCommon {
2409 type?: 'log';
2410 axisLabel?: AxisLabelOption<'log'>;
2411 logBase?: number;
2412}
2413interface TimeAxisBaseOption extends NumericAxisBaseOptionCommon {
2414 type?: 'time';
2415 axisLabel?: AxisLabelOption<'time'>;
2416}
2417interface AxisNameTextStyleOption extends TextCommonOption {
2418 rich?: Dictionary<TextCommonOption>;
2419}
2420interface AxisLineOption {
2421 show?: boolean | 'auto';
2422 onZero?: boolean;
2423 onZeroAxisIndex?: number;
2424 symbol?: string | [string, string];
2425 symbolSize?: number[];
2426 symbolOffset?: string | number | (string | number)[];
2427 lineStyle?: LineStyleOption;
2428}
2429interface AxisTickOption {
2430 show?: boolean | 'auto';
2431 inside?: boolean;
2432 length?: number;
2433 lineStyle?: LineStyleOption;
2434}
2435declare type AxisLabelValueFormatter = (value: number, index: number) => string;
2436declare type AxisLabelCategoryFormatter = (value: string, index: number) => string;
2437declare type TimeAxisLabelUnitFormatter = AxisLabelValueFormatter | string[] | string;
2438declare type TimeAxisLabelFormatterOption = string | ((value: number, index: number, extra: {
2439 level: number;
2440}) => string) | {
2441 year?: TimeAxisLabelUnitFormatter;
2442 month?: TimeAxisLabelUnitFormatter;
2443 week?: TimeAxisLabelUnitFormatter;
2444 day?: TimeAxisLabelUnitFormatter;
2445 hour?: TimeAxisLabelUnitFormatter;
2446 minute?: TimeAxisLabelUnitFormatter;
2447 second?: TimeAxisLabelUnitFormatter;
2448 millisecond?: TimeAxisLabelUnitFormatter;
2449 inherit?: boolean;
2450};
2451declare type LabelFormatters = {
2452 value: AxisLabelValueFormatter | string;
2453 log: AxisLabelValueFormatter | string;
2454 category: AxisLabelCategoryFormatter | string;
2455 time: TimeAxisLabelFormatterOption;
2456};
2457interface AxisLabelBaseOption extends Omit<TextCommonOption, 'color'> {
2458 show?: boolean;
2459 inside?: boolean;
2460 rotate?: number;
2461 showMinLabel?: boolean;
2462 showMaxLabel?: boolean;
2463 margin?: number;
2464 rich?: Dictionary<TextCommonOption>;
2465 /**
2466 * If hide overlapping labels.
2467 */
2468 hideOverlap?: boolean;
2469 color?: ColorString | ((value?: string | number, index?: number) => ColorString);
2470}
2471interface AxisLabelOption<TType extends OptionAxisType> extends AxisLabelBaseOption {
2472 formatter?: LabelFormatters[TType];
2473}
2474interface MinorTickOption {
2475 show?: boolean;
2476 splitNumber?: number;
2477 length?: number;
2478 lineStyle?: LineStyleOption;
2479}
2480interface SplitLineOption {
2481 show?: boolean;
2482 interval?: 'auto' | number | ((index: number, value: string) => boolean);
2483 lineStyle?: LineStyleOption<ZRColor | ZRColor[]>;
2484}
2485interface MinorSplitLineOption {
2486 show?: boolean;
2487 lineStyle?: LineStyleOption;
2488}
2489interface SplitAreaOption {
2490 show?: boolean;
2491 interval?: 'auto' | number | ((index: number, value: string) => boolean);
2492 areaStyle?: AreaStyleOption<ZRColor[]>;
2493}
2494declare type AxisBaseOption = ValueAxisBaseOption | LogAxisBaseOption | CategoryAxisBaseOption | TimeAxisBaseOption | AxisBaseOptionCommon;
2495
2496interface AxisModelCommonMixin<Opt extends AxisBaseOption> extends Pick<Model<Opt>, 'option'> {
2497 axis: Axis;
2498}
2499declare class AxisModelCommonMixin<Opt extends AxisBaseOption> {
2500 getNeedCrossZero(): boolean;
2501 /**
2502 * Should be implemented by each axis model if necessary.
2503 * @return coordinate system model
2504 */
2505 getCoordSysModel(): CoordinateSystemHostModel;
2506}
2507
2508declare class OrdinalMeta {
2509 readonly categories: OrdinalRawValue[];
2510 private _needCollect;
2511 private _deduplication;
2512 private _map;
2513 readonly uid: number;
2514 constructor(opt: {
2515 categories?: OrdinalRawValue[];
2516 needCollect?: boolean;
2517 deduplication?: boolean;
2518 });
2519 static createByAxisModel(axisModel: Model): OrdinalMeta;
2520 getOrdinal(category: OrdinalRawValue): OrdinalNumber;
2521 /**
2522 * @return The ordinal. If not found, return NaN.
2523 */
2524 parseAndCollect(category: OrdinalRawValue | OrdinalNumber): OrdinalNumber;
2525 private _getOrCreateMap;
2526}
2527
2528declare const extensionRegisters: {
2529 registerPreprocessor: typeof registerPreprocessor;
2530 registerProcessor: typeof registerProcessor;
2531 registerPostInit: typeof registerPostInit;
2532 registerPostUpdate: typeof registerPostUpdate;
2533 registerUpdateLifecycle: typeof registerUpdateLifecycle;
2534 registerAction: typeof registerAction;
2535 registerCoordinateSystem: typeof registerCoordinateSystem;
2536 registerLayout: typeof registerLayout;
2537 registerVisual: typeof registerVisual;
2538 registerTransform: typeof registerExternalTransform;
2539 registerLoading: typeof registerLoading;
2540 registerMap: typeof registerMap;
2541 PRIORITY: {
2542 PROCESSOR: {
2543 FILTER: number;
2544 SERIES_FILTER: number;
2545 STATISTIC: number;
2546 };
2547 VISUAL: {
2548 LAYOUT: number;
2549 PROGRESSIVE_LAYOUT: number;
2550 GLOBAL: number;
2551 CHART: number;
2552 POST_CHART_LAYOUT: number;
2553 COMPONENT: number;
2554 BRUSH: number;
2555 CHART_ITEM: number;
2556 ARIA: number;
2557 DECAL: number;
2558 };
2559 };
2560 ComponentModel: typeof ComponentModel;
2561 ComponentView: typeof ComponentView;
2562 SeriesModel: typeof SeriesModel;
2563 ChartView: typeof ChartView;
2564 registerComponentModel(ComponentModelClass: Constructor): void;
2565 registerComponentView(ComponentViewClass: typeof ComponentView): void;
2566 registerSeriesModel(SeriesModelClass: Constructor): void;
2567 registerChartView(ChartViewClass: typeof ChartView): void;
2568 registerSubTypeDefaulter(componentType: string, defaulter: SubTypeDefaulter): void;
2569 registerPainter(painterType: string, PainterCtor: Parameters<typeof registerPainter>[1]): void;
2570};
2571declare type EChartsExtensionInstallRegisters = typeof extensionRegisters;
2572declare type EChartsExtensionInstaller = (ec: EChartsExtensionInstallRegisters) => void;
2573interface EChartsExtension {
2574 install: EChartsExtensionInstaller;
2575}
2576declare function use(ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]): void;
2577
2578interface AxisModelExtendedInCreator {
2579 getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data'];
2580 getOrdinalMeta(): OrdinalMeta;
2581}
2582
2583/**
2584 * Base Axis Model for xAxis, yAxis, angleAxis, radiusAxis. singleAxis
2585 */
2586
2587interface AxisBaseModel<T extends AxisBaseOptionCommon = AxisBaseOptionCommon> extends ComponentModel<T>, AxisModelCommonMixin<T>, AxisModelExtendedInCreator {
2588 axis: Axis;
2589}
2590
2591declare function createAxisLabels(axis: Axis): {
2592 labels: {
2593 level?: number;
2594 formattedLabel: string;
2595 rawLabel: string;
2596 tickValue: number;
2597 }[];
2598 labelCategoryInterval?: number;
2599};
2600/**
2601 * Calculate interval for category axis ticks and labels.
2602 * To get precise result, at least one of `getRotate` and `isHorizontal`
2603 * should be implemented in axis.
2604 */
2605declare function calculateCategoryInterval(axis: Axis): number;
2606
2607interface ScaleRawExtentResult {
2608 readonly min: number;
2609 readonly max: number;
2610 readonly minFixed: boolean;
2611 readonly maxFixed: boolean;
2612 readonly isBlank: boolean;
2613}
2614declare class ScaleRawExtentInfo {
2615 private _needCrossZero;
2616 private _isOrdinal;
2617 private _axisDataLen;
2618 private _boundaryGapInner;
2619 private _modelMinRaw;
2620 private _modelMaxRaw;
2621 private _modelMinNum;
2622 private _modelMaxNum;
2623 private _dataMin;
2624 private _dataMax;
2625 private _determinedMin;
2626 private _determinedMax;
2627 readonly frozen: boolean;
2628 constructor(scale: Scale, model: AxisBaseModel, originalExtent: number[]);
2629 /**
2630 * Parameters depending on ouside (like model, user callback)
2631 * are prepared and fixed here.
2632 */
2633 private _prepareParams;
2634 /**
2635 * Calculate extent by prepared parameters.
2636 * This method has no external dependency and can be called duplicatedly,
2637 * getting the same result.
2638 * If parameters changed, should call this method to recalcuate.
2639 */
2640 calculate(): ScaleRawExtentResult;
2641 modifyDataMinMax(minMaxName: 'min' | 'max', val: number): void;
2642 setDeterminedMinMax(minMaxName: 'min' | 'max', val: number): void;
2643 freeze(): void;
2644}
2645
2646declare abstract class Scale<SETTING extends Dictionary<unknown> = Dictionary<unknown>> {
2647 type: string;
2648 private _setting;
2649 protected _extent: [number, number];
2650 private _isBlank;
2651 readonly rawExtentInfo: ScaleRawExtentInfo;
2652 constructor(setting?: SETTING);
2653 getSetting<KEY extends keyof SETTING>(name: KEY): SETTING[KEY];
2654 /**
2655 * Parse input val to valid inner number.
2656 * Notice: This would be a trap here, If the implementation
2657 * of this method depends on extent, and this method is used
2658 * before extent set (like in dataZoom), it would be wrong.
2659 * Nevertheless, parse does not depend on extent generally.
2660 */
2661 abstract parse(val: OptionDataValue): number;
2662 /**
2663 * Whether contain the given value.
2664 */
2665 abstract contain(val: ScaleDataValue): boolean;
2666 /**
2667 * Normalize value to linear [0, 1], return 0.5 if extent span is 0.
2668 */
2669 abstract normalize(val: ScaleDataValue): number;
2670 /**
2671 * Scale normalized value to extent.
2672 */
2673 abstract scale(val: number): number;
2674 /**
2675 * Set extent from data
2676 */
2677 unionExtent(other: [number, number]): void;
2678 /**
2679 * Set extent from data
2680 */
2681 unionExtentFromData(data: SeriesData, dim: DimensionName | DimensionLoose): void;
2682 /**
2683 * Get extent
2684 *
2685 * Extent is always in increase order.
2686 */
2687 getExtent(): [number, number];
2688 /**
2689 * Set extent
2690 */
2691 setExtent(start: number, end: number): void;
2692 /**
2693 * If value is in extent range
2694 */
2695 isInExtentRange(value: number): boolean;
2696 /**
2697 * When axis extent depends on data and no data exists,
2698 * axis ticks should not be drawn, which is named 'blank'.
2699 */
2700 isBlank(): boolean;
2701 /**
2702 * When axis extent depends on data and no data exists,
2703 * axis ticks should not be drawn, which is named 'blank'.
2704 */
2705 setBlank(isBlank: boolean): void;
2706 /**
2707 * Update interval and extent of intervals for nice ticks
2708 *
2709 * @param splitNumber Approximated tick numbers. Optional.
2710 * The implementation of `niceTicks` should decide tick numbers
2711 * whether `splitNumber` is given.
2712 * @param minInterval Optional.
2713 * @param maxInterval Optional.
2714 */
2715 abstract niceTicks(splitNumber?: number, minInterval?: number, maxInterval?: number): void;
2716 abstract niceExtent(opt?: {
2717 splitNumber?: number;
2718 fixMin?: boolean;
2719 fixMax?: boolean;
2720 minInterval?: number;
2721 maxInterval?: number;
2722 }): void;
2723 /**
2724 * @return label of the tick.
2725 */
2726 abstract getLabel(tick: ScaleTick): string;
2727 abstract getTicks(expandToNicedExtent?: boolean): ScaleTick[];
2728 abstract getMinorTicks(splitNumber: number): number[][];
2729 static registerClass: ClassManager['registerClass'];
2730 static getClass: ClassManager['getClass'];
2731}
2732
2733interface TickCoord {
2734 coord: number;
2735 tickValue?: ScaleTick['value'];
2736}
2737/**
2738 * Base class of Axis.
2739 */
2740declare class Axis {
2741 /**
2742 * Axis type
2743 * - 'category'
2744 * - 'value'
2745 * - 'time'
2746 * - 'log'
2747 */
2748 type: OptionAxisType;
2749 readonly dim: DimensionName;
2750 scale: Scale;
2751 private _extent;
2752 model: AxisBaseModel;
2753 onBand: CategoryAxisBaseOption['boundaryGap'];
2754 inverse: AxisBaseOption['inverse'];
2755 constructor(dim: DimensionName, scale: Scale, extent: [number, number]);
2756 /**
2757 * If axis extent contain given coord
2758 */
2759 contain(coord: number): boolean;
2760 /**
2761 * If axis extent contain given data
2762 */
2763 containData(data: ScaleDataValue): boolean;
2764 /**
2765 * Get coord extent.
2766 */
2767 getExtent(): [number, number];
2768 /**
2769 * Get precision used for formatting
2770 */
2771 getPixelPrecision(dataExtent?: [number, number]): number;
2772 /**
2773 * Set coord extent
2774 */
2775 setExtent(start: number, end: number): void;
2776 /**
2777 * Convert data to coord. Data is the rank if it has an ordinal scale
2778 */
2779 dataToCoord(data: ScaleDataValue, clamp?: boolean): number;
2780 /**
2781 * Convert coord to data. Data is the rank if it has an ordinal scale
2782 */
2783 coordToData(coord: number, clamp?: boolean): number;
2784 /**
2785 * Convert pixel point to data in axis
2786 */
2787 pointToData(point: number[], clamp?: boolean): number;
2788 /**
2789 * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
2790 * `axis.getTicksCoords` considers `onBand`, which is used by
2791 * `boundaryGap:true` of category axis and splitLine and splitArea.
2792 * @param opt.tickModel default: axis.model.getModel('axisTick')
2793 * @param opt.clamp If `true`, the first and the last
2794 * tick must be at the axis end points. Otherwise, clip ticks
2795 * that outside the axis extent.
2796 */
2797 getTicksCoords(opt?: {
2798 tickModel?: Model;
2799 clamp?: boolean;
2800 }): TickCoord[];
2801 getMinorTicksCoords(): TickCoord[][];
2802 getViewLabels(): ReturnType<typeof createAxisLabels>['labels'];
2803 getLabelModel(): Model<AxisBaseOption['axisLabel']>;
2804 /**
2805 * Notice here we only get the default tick model. For splitLine
2806 * or splitArea, we should pass the splitLineModel or splitAreaModel
2807 * manually when calling `getTicksCoords`.
2808 * In GL, this method may be overrided to:
2809 * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
2810 */
2811 getTickModel(): Model;
2812 /**
2813 * Get width of band
2814 */
2815 getBandWidth(): number;
2816 /**
2817 * Get axis rotate, by degree.
2818 */
2819 getRotate: () => number;
2820 /**
2821 * Only be called in category axis.
2822 * Can be overrided, consider other axes like in 3D.
2823 * @return Auto interval for cateogry axis tick and label
2824 */
2825 calculateCategoryInterval(): ReturnType<typeof calculateCategoryInterval>;
2826}
2827
2828interface BaseBarSeriesOption<StateOption, ExtraStateOption = DefaultStatesMixin> extends SeriesOption<StateOption, ExtraStateOption>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin {
2829 /**
2830 * Min height of bar
2831 */
2832 barMinHeight?: number;
2833 /**
2834 * Min angle of bar. Avaiable on polar coordinate system
2835 */
2836 barMinAngle?: number;
2837 /**
2838 * Max width of bar. Default to be 1 on cartesian coordinate system. Otherwise it's null
2839 */
2840 barMaxWidth?: number;
2841 barMinWidth?: number;
2842 /**
2843 * Bar width. Will be calculated automatically.
2844 * Can be pixel width or percent string.
2845 */
2846 barWidth?: number | string;
2847 /**
2848 * Gap between each bar inside category. Default to be 30%. Can be an aboslute pixel value
2849 */
2850 barGap?: string | number;
2851 /**
2852 * Gap between each category. Default to be 20%. can be an absolute pixel value.
2853 */
2854 barCategoryGap?: string | number;
2855 large?: boolean;
2856 largeThreshold?: number;
2857}
2858
2859interface LayoutRect extends BoundingRect {
2860 margin: number[];
2861}
2862/**
2863 * Parse position info.
2864 */
2865declare function getLayoutRect(positionInfo: BoxLayoutOptionMixin & {
2866 aspect?: number;
2867}, containerRect: {
2868 width: number;
2869 height: number;
2870}, margin?: number | number[]): LayoutRect;
2871
2872interface GridOption extends ComponentOption, BoxLayoutOptionMixin, ShadowOptionMixin {
2873 mainType?: 'grid';
2874 show?: boolean;
2875 containLabel?: boolean;
2876 backgroundColor?: ZRColor;
2877 borderWidth?: number;
2878 borderColor?: ZRColor;
2879 tooltip?: any;
2880}
2881
2882declare type CartesianAxisPosition = 'top' | 'bottom' | 'left' | 'right';
2883declare type CartesianAxisOption = AxisBaseOption & {
2884 gridIndex?: number;
2885 gridId?: string;
2886 position?: CartesianAxisPosition;
2887 offset?: number;
2888 categorySortInfo?: OrdinalSortInfo;
2889};
2890declare type XAXisOption = CartesianAxisOption & {
2891 mainType?: 'xAxis';
2892};
2893declare type YAXisOption = CartesianAxisOption & {
2894 mainType?: 'yAxis';
2895};
2896
2897declare type AngleAxisOption = AxisBaseOption & {
2898 mainType?: 'angleAxis';
2899 /**
2900 * Index of host polar component
2901 */
2902 polarIndex?: number;
2903 /**
2904 * Id of host polar component
2905 */
2906 polarId?: string;
2907 startAngle?: number;
2908 clockwise?: boolean;
2909 axisLabel?: AxisBaseOption['axisLabel'];
2910};
2911declare type RadiusAxisOption = AxisBaseOption & {
2912 mainType?: 'radiusAxis';
2913 /**
2914 * Index of host polar component
2915 */
2916 polarIndex?: number;
2917 /**
2918 * Id of host polar component
2919 */
2920 polarId?: string;
2921};
2922
2923interface PolarOption extends ComponentOption, CircleLayoutOptionMixin {
2924 mainType?: 'polar';
2925}
2926
2927/**
2928 * BrushController not only used in "brush component",
2929 * but also used in "tooltip DataZoom", and other possible
2930 * futher brush behavior related scenarios.
2931 * So `BrushController` should not depends on "brush component model".
2932 */
2933declare type BrushType = 'polygon' | 'rect' | 'lineX' | 'lineY';
2934/**
2935 * Only for drawing (after enabledBrush).
2936 * 'line', 'rect', 'polygon' or false
2937 * If passing false/null/undefined, disable brush.
2938 * If passing 'auto', determined by panel.defaultBrushType
2939 */
2940declare type BrushTypeUncertain = BrushType | false | 'auto';
2941declare type BrushMode = 'single' | 'multiple';
2942declare type BrushDimensionMinMax = number[];
2943declare type BrushAreaRange = BrushDimensionMinMax | BrushDimensionMinMax[];
2944interface BrushCoverConfig {
2945 brushType: BrushType;
2946 id?: string;
2947 range?: BrushAreaRange;
2948 panelId?: string;
2949 brushMode?: BrushMode;
2950 brushStyle?: Pick<PathStyleProps, BrushStyleKey>;
2951 transformable?: boolean;
2952 removeOnClick?: boolean;
2953 z?: number;
2954}
2955declare type BrushStyleKey = 'fill' | 'stroke' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor';
2956
2957declare class Region {
2958 readonly name: string;
2959 readonly type: 'geoJSON' | 'geoSVG';
2960 constructor(name: string);
2961 /**
2962 * Get center point in data unit. That is,
2963 * for GeoJSONRegion, the unit is lat/lng,
2964 * for GeoSVGRegion, the unit is SVG local coord.
2965 */
2966 getCenter(): number[];
2967}
2968declare class GeoJSONRegion extends Region {
2969 readonly type = "geoJSON";
2970 readonly geometries: {
2971 type: 'polygon';
2972 exterior: number[][];
2973 interiors?: number[][][];
2974 }[];
2975 private _center;
2976 properties: GeoJSON['features'][0]['properties'];
2977 private _rect;
2978 constructor(name: string, geometries: GeoJSONRegion['geometries'], cp: GeoJSON['features'][0]['properties']['cp']);
2979 getBoundingRect(): BoundingRect;
2980 contain(coord: number[]): boolean;
2981 transformTo(x: number, y: number, width: number, height: number): void;
2982 cloneShallow(name: string): GeoJSONRegion;
2983 getCenter(): number[];
2984 setCenter(center: number[]): void;
2985}
2986
2987interface InnerTruncateOption {
2988 maxIteration?: number;
2989 minChar?: number;
2990 placeholder?: string;
2991 maxIterations?: number;
2992}
2993declare function truncateText(text: string, containerWidth: number, font: string, ellipsis: string, options: InnerTruncateOption): string;
2994
2995declare type TextStyleProps$1 = ZRText['style'];
2996declare function getTextRect(text: TextStyleProps$1['text'], font?: TextStyleProps$1['font'], align?: TextStyleProps$1['align'], verticalAlign?: TextStyleProps$1['verticalAlign'], padding?: TextStyleProps$1['padding'], rich?: TextStyleProps$1['rich'], truncate?: boolean, lineHeight?: number): BoundingRect;
2997
2998/**
2999 * Add a comma each three digit.
3000 */
3001declare function addCommas(x: string | number): string;
3002declare function toCamelCase(str: string, upperCaseFirst?: boolean): string;
3003declare const normalizeCssArray$1: typeof normalizeCssArray;
3004declare function encodeHTML(source: string): string;
3005interface TplFormatterParam extends Dictionary<any> {
3006 $vars: string[];
3007}
3008/**
3009 * Template formatter
3010 * @param {Array.<Object>|Object} paramsList
3011 */
3012declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string;
3013interface RichTextTooltipMarker {
3014 renderMode: TooltipRenderMode;
3015 content: string;
3016 style: Dictionary<unknown>;
3017}
3018declare type TooltipMarker = string | RichTextTooltipMarker;
3019declare type TooltipMarkerType = 'item' | 'subItem';
3020interface GetTooltipMarkerOpt {
3021 color?: ColorString;
3022 extraCssText?: string;
3023 type?: TooltipMarkerType;
3024 renderMode?: TooltipRenderMode;
3025 markerId?: string;
3026}
3027declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;
3028declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;
3029/**
3030 * @deprecated Use `time/format` instead.
3031 * ISO Date format
3032 * @param {string} tpl
3033 * @param {number} value
3034 * @param {boolean} [isUTC=false] Default in local time.
3035 * see `module:echarts/scale/Time`
3036 * and `module:echarts/util/number#parseDate`.
3037 * @inner
3038 */
3039declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string;
3040/**
3041 * Capital first
3042 * @param {string} str
3043 * @return {string}
3044 */
3045declare function capitalFirst(str: string): string;
3046
3047interface MapperParamAxisInfo {
3048 axisIndex: number;
3049 axisName: string;
3050 axisId: string;
3051 axisDim: string;
3052}
3053interface AxisPointerLink {
3054 xAxisIndex?: number[] | 'all';
3055 yAxisIndex?: number[] | 'all';
3056 xAxisId?: string[];
3057 yAxisId?: string[];
3058 xAxisName?: string[] | string;
3059 yAxisName?: string[] | string;
3060 radiusAxisIndex?: number[] | 'all';
3061 angleAxisIndex?: number[] | 'all';
3062 radiusAxisId?: string[];
3063 angleAxisId?: string[];
3064 radiusAxisName?: string[] | string;
3065 angleAxisName?: string[] | string;
3066 singleAxisIndex?: number[] | 'all';
3067 singleAxisId?: string[];
3068 singleAxisName?: string[] | string;
3069 mapper?(sourceVal: ScaleDataValue, sourceAxisInfo: MapperParamAxisInfo, targetAxisInfo: MapperParamAxisInfo): CommonAxisPointerOption['value'];
3070}
3071interface AxisPointerOption extends ComponentOption, Omit<CommonAxisPointerOption, 'type'> {
3072 mainType?: 'axisPointer';
3073 type?: 'line' | 'shadow' | 'cross' | 'none';
3074 link?: AxisPointerLink[];
3075}
3076
3077declare type TopLevelFormatterParams = CallbackDataParams | CallbackDataParams[];
3078interface TooltipOption extends CommonTooltipOption<TopLevelFormatterParams>, ComponentOption {
3079 mainType?: 'tooltip';
3080 axisPointer?: AxisPointerOption & {
3081 axis?: 'auto' | 'x' | 'y' | 'angle' | 'radius';
3082 crossStyle?: LineStyleOption & {
3083 textStyle?: LabelOption;
3084 };
3085 };
3086 /**
3087 * If show popup content
3088 */
3089 showContent?: boolean;
3090 /**
3091 * Trigger only works on coordinate system.
3092 */
3093 trigger?: 'item' | 'axis' | 'none';
3094 displayMode?: 'single' | 'multipleByCoordSys';
3095 /**
3096 * 'auto': use html by default, and use non-html if `document` is not defined
3097 * 'html': use html for tooltip
3098 * 'richText': use canvas, svg, and etc. for tooltip
3099 */
3100 renderMode?: 'auto' | TooltipRenderMode;
3101 /**
3102 * If append popup dom to document.body
3103 * Only available when renderMode is html
3104 */
3105 appendToBody?: boolean;
3106 /**
3107 * specified class name of tooltip dom
3108 * Only available when renderMode is html
3109 */
3110 className?: string;
3111 order?: TooltipOrderMode;
3112}
3113
3114/**
3115 * This is an abstract layer to insulate the upper usage of tooltip content
3116 * from the different backends according to different `renderMode` ('html' or 'richText').
3117 * With the help of the abstract layer, it does not need to consider how to create and
3118 * assemble html or richText snippets when making tooltip content.
3119 *
3120 * @usage
3121 *
3122 * ```ts
3123 * class XxxSeriesModel {
3124 * formatTooltip(
3125 * dataIndex: number,
3126 * multipleSeries: boolean,
3127 * dataType: string
3128 * ) {
3129 * ...
3130 * return createTooltipMarkup('section', {
3131 * header: header,
3132 * blocks: [
3133 * createTooltipMarkup('nameValue', {
3134 * name: name,
3135 * value: value,
3136 * noValue: value == null
3137 * })
3138 * ]
3139 * });
3140 * }
3141 * }
3142 * ```
3143 */
3144declare type TooltipMarkupBlockFragment = TooltipMarkupSection | TooltipMarkupNameValueBlock;
3145interface TooltipMarkupBlock {
3146 sortParam?: unknown;
3147 __gapLevelBetweenSubBlocks?: number;
3148}
3149interface TooltipMarkupSection extends TooltipMarkupBlock {
3150 type: 'section';
3151 header?: unknown;
3152 noHeader?: boolean;
3153 blocks?: TooltipMarkupBlockFragment[];
3154 sortBlocks?: boolean;
3155}
3156interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock {
3157 type: 'nameValue';
3158 markerType?: TooltipMarkerType;
3159 markerColor?: ColorString;
3160 name?: string;
3161 value?: unknown | unknown[];
3162 valueType?: DimensionType | DimensionType[];
3163 noName?: boolean;
3164 noValue?: boolean;
3165}
3166
3167declare type ECSymbol = Path & {
3168 __isEmptyBrush?: boolean;
3169 setColor: (color: ZRColor, innerColor?: ZRColor) => void;
3170 getColor: () => ZRColor;
3171};
3172/**
3173 * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
3174 */
3175declare function createSymbol(symbolType: string, x: number, y: number, w: number, h: number, color?: ZRColor, keepAspect?: boolean): ECSymbol;
3176
3177declare type ItemStyleKeys = 'fill' | 'stroke' | 'decal' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
3178declare type ItemStyleProps = Pick<PathStyleProps, ItemStyleKeys>;
3179declare class ItemStyleMixin {
3180 getItemStyle(this: Model, excludes?: readonly (keyof ItemStyleOption)[], includes?: readonly (keyof ItemStyleOption)[]): ItemStyleProps;
3181}
3182
3183declare type LineStyleKeys = 'lineWidth' | 'stroke' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
3184declare type LineStyleProps = Pick<PathStyleProps, LineStyleKeys>;
3185declare class LineStyleMixin {
3186 getLineStyle(this: Model, excludes?: readonly (keyof LineStyleOption)[]): LineStyleProps;
3187}
3188
3189declare type SelectorType = 'all' | 'inverse';
3190interface LegendSelectorButtonOption {
3191 type?: SelectorType;
3192 title?: string;
3193}
3194/**
3195 * T: the type to be extended
3196 * ET: extended type for keys of T
3197 * ST: special type for T to be extended
3198 */
3199declare type ExtendPropertyType<T, ET, ST extends {
3200 [key in keyof T]: any;
3201}> = {
3202 [key in keyof T]: key extends keyof ST ? T[key] | ET | ST[key] : T[key] | ET;
3203};
3204interface LegendItemStyleOption extends ExtendPropertyType<ItemStyleOption, 'inherit', {
3205 borderWidth: 'auto';
3206}> {
3207}
3208interface LegendLineStyleOption extends ExtendPropertyType<LineStyleOption, 'inherit', {
3209 width: 'auto';
3210}> {
3211 inactiveColor?: ColorString;
3212 inactiveWidth?: number;
3213}
3214interface LegendStyleOption {
3215 /**
3216 * Icon of the legend items.
3217 * @default 'roundRect'
3218 */
3219 icon?: string;
3220 /**
3221 * Color when legend item is not selected
3222 */
3223 inactiveColor?: ColorString;
3224 /**
3225 * Border color when legend item is not selected
3226 */
3227 inactiveBorderColor?: ColorString;
3228 /**
3229 * Border color when legend item is not selected
3230 */
3231 inactiveBorderWidth?: number | 'auto';
3232 /**
3233 * Legend label formatter
3234 */
3235 formatter?: string | ((name: string) => string);
3236 itemStyle?: LegendItemStyleOption;
3237 lineStyle?: LegendLineStyleOption;
3238 textStyle?: LabelOption;
3239 symbolRotate?: number | 'inherit';
3240 /**
3241 * @deprecated
3242 */
3243 symbolKeepAspect?: boolean;
3244}
3245interface DataItem extends LegendStyleOption {
3246 name?: string;
3247 icon?: string;
3248 textStyle?: LabelOption;
3249 tooltip?: unknown;
3250}
3251interface LegendTooltipFormatterParams {
3252 componentType: 'legend';
3253 legendIndex: number;
3254 name: string;
3255 $vars: ['name'];
3256}
3257interface LegendIconParams {
3258 itemWidth: number;
3259 itemHeight: number;
3260 /**
3261 * symbolType is from legend.icon, legend.data.icon, or series visual
3262 */
3263 icon: string;
3264 iconRotate: number | 'inherit';
3265 symbolKeepAspect: boolean;
3266 itemStyle: PathStyleProps;
3267 lineStyle: LineStyleProps;
3268}
3269interface LegendOption extends ComponentOption, LegendStyleOption, BoxLayoutOptionMixin, BorderOptionMixin {
3270 mainType?: 'legend';
3271 show?: boolean;
3272 orient?: LayoutOrient;
3273 align?: 'auto' | 'left' | 'right';
3274 backgroundColor?: ColorString;
3275 /**
3276 * Border radius of background rect
3277 * @default 0
3278 */
3279 borderRadius?: number | number[];
3280 /**
3281 * Padding between legend item and border.
3282 * Support to be a single number or an array.
3283 * @default 5
3284 */
3285 padding?: number | number[];
3286 /**
3287 * Gap between each legend item.
3288 * @default 10
3289 */
3290 itemGap?: number;
3291 /**
3292 * Width of legend symbol
3293 */
3294 itemWidth?: number;
3295 /**
3296 * Height of legend symbol
3297 */
3298 itemHeight?: number;
3299 selectedMode?: boolean | 'single' | 'multiple';
3300 /**
3301 * selected map of each item. Default to be selected if item is not in the map
3302 */
3303 selected?: Dictionary<boolean>;
3304 /**
3305 * Buttons for all select or inverse select.
3306 * @example
3307 * selector: [{type: 'all or inverse', title: xxx}]
3308 * selector: true
3309 * selector: ['all', 'inverse']
3310 */
3311 selector?: (LegendSelectorButtonOption | SelectorType)[] | boolean;
3312 selectorLabel?: LabelOption;
3313 emphasis?: {
3314 selectorLabel?: LabelOption;
3315 };
3316 /**
3317 * Position of selector buttons.
3318 */
3319 selectorPosition?: 'auto' | 'start' | 'end';
3320 /**
3321 * Gap between each selector button
3322 */
3323 selectorItemGap?: number;
3324 /**
3325 * Gap between selector buttons group and legend main items.
3326 */
3327 selectorButtonGap?: number;
3328 data?: (string | DataItem)[];
3329 /**
3330 * Tooltip option
3331 */
3332 tooltip?: CommonTooltipOption<LegendTooltipFormatterParams>;
3333}
3334
3335interface MapStateOption<TCbParams = never> {
3336 itemStyle?: GeoItemStyleOption<TCbParams>;
3337 label?: SeriesLabelOption;
3338}
3339interface MapDataItemOption extends MapStateOption, StatesOptionMixin<MapStateOption, StatesMixinBase>, OptionDataItemObject<OptionDataValueNumeric> {
3340 cursor?: string;
3341}
3342declare type MapValueCalculationType = 'sum' | 'average' | 'min' | 'max';
3343interface MapSeriesOption extends SeriesOption<MapStateOption<CallbackDataParams>, StatesMixinBase>, MapStateOption<CallbackDataParams>, GeoCommonOptionMixin, SeriesOnGeoOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
3344 type?: 'map';
3345 coordinateSystem?: string;
3346 silent?: boolean;
3347 markLine?: any;
3348 markPoint?: any;
3349 markArea?: any;
3350 mapValueCalculation?: MapValueCalculationType;
3351 showLegendSymbol?: boolean;
3352 geoCoord?: Dictionary<number[]>;
3353 data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | MapDataItemOption)[];
3354 nameProperty?: string;
3355}
3356
3357interface GeoItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
3358 areaColor?: ZRColor;
3359}
3360interface GeoLabelOption extends LabelOption {
3361 formatter?: string | ((params: GeoLabelFormatterDataParams) => string);
3362}
3363interface GeoStateOption {
3364 itemStyle?: GeoItemStyleOption;
3365 label?: GeoLabelOption;
3366}
3367interface GeoLabelFormatterDataParams {
3368 name: string;
3369 status: DisplayState;
3370}
3371interface RegoinOption extends GeoStateOption, StatesOptionMixin<GeoStateOption, StatesMixinBase> {
3372 name?: string;
3373 selected?: boolean;
3374 tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
3375}
3376interface GeoTooltipFormatterParams {
3377 componentType: 'geo';
3378 geoIndex: number;
3379 name: string;
3380 $vars: ['name'];
3381}
3382interface GeoCommonOptionMixin extends RoamOptionMixin {
3383 map: string;
3384 aspectScale?: number;
3385 layoutCenter?: (number | string)[];
3386 layoutSize?: number | string;
3387 boundingCoords?: number[][];
3388 nameMap?: NameMap;
3389 nameProperty?: string;
3390}
3391interface GeoOption extends ComponentOption, BoxLayoutOptionMixin, AnimationOptionMixin, GeoCommonOptionMixin, StatesOptionMixin<GeoStateOption, StatesMixinBase>, GeoStateOption {
3392 mainType?: 'geo';
3393 show?: boolean;
3394 silent?: boolean;
3395 regions?: RegoinOption[];
3396 stateAnimation?: AnimationOptionMixin;
3397 selectedMode?: 'single' | 'multiple' | boolean;
3398 selectedMap?: Dictionary<boolean>;
3399 tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
3400}
3401
3402/**
3403 * The input to define brush areas.
3404 * (1) Can be created by user when calling dispatchAction.
3405 * (2) Can be created by `BrushController`
3406 * for brush behavior. area params are picked from `cover.__brushOptoin`.
3407 * In `BrushController`, "covers" are create or updated for each "area".
3408 */
3409interface BrushAreaParam extends ModelFinderObject {
3410 brushType: BrushCoverConfig['brushType'];
3411 id?: BrushCoverConfig['id'];
3412 range?: BrushCoverConfig['range'];
3413 panelId?: BrushCoverConfig['panelId'];
3414 coordRange?: BrushAreaRange;
3415 coordRanges?: BrushAreaRange[];
3416 __rangeOffset?: {
3417 offset: BrushDimensionMinMax[] | BrushDimensionMinMax;
3418 xyMinMax: BrushDimensionMinMax[];
3419 };
3420}
3421/**
3422 * Generated by `brushModel.setAreas`, which merges
3423 * `area: BrushAreaParam` and `brushModel.option: BrushOption`.
3424 * See `generateBrushOption`.
3425 */
3426interface BrushAreaParamInternal extends BrushAreaParam {
3427 brushMode: BrushMode;
3428 brushStyle: BrushCoverConfig['brushStyle'];
3429 transformable: BrushCoverConfig['transformable'];
3430 removeOnClick: BrushCoverConfig['removeOnClick'];
3431 z: BrushCoverConfig['z'];
3432 __rangeOffset?: {
3433 offset: BrushDimensionMinMax | BrushDimensionMinMax[];
3434 xyMinMax: BrushDimensionMinMax[];
3435 };
3436}
3437declare type BrushToolboxIconType = BrushType | 'keep' | 'clear';
3438interface BrushOption extends ComponentOption, ModelFinderObject {
3439 mainType?: 'brush';
3440 toolbox?: BrushToolboxIconType[];
3441 brushLink?: number[] | 'all' | 'none';
3442 throttleType?: 'fixRate' | 'debounce';
3443 throttleDelay?: number;
3444 inBrush?: VisualOptionFixed;
3445 outOfBrush?: VisualOptionFixed;
3446 brushType?: BrushTypeUncertain;
3447 brushStyle?: {
3448 borderWidth?: number;
3449 color?: ZRColor;
3450 borderColor?: ZRColor;
3451 };
3452 transformable?: boolean;
3453 brushMode?: BrushMode;
3454 removeOnClick?: boolean;
3455}
3456
3457interface BrushSelectableArea extends BrushAreaParamInternal {
3458 boundingRect: BoundingRect;
3459 selectors: BrushCommonSelectorsForSeries;
3460}
3461/**
3462 * This methods are corresponding to `BrushSelectorOnBrushType`,
3463 * but `area: BrushSelectableArea` is binded to each method.
3464 */
3465interface BrushCommonSelectorsForSeries {
3466 point(itemLayout: number[]): boolean;
3467 rect(itemLayout: RectLike): boolean;
3468}
3469
3470declare type PolarBarLabelPosition = SeriesLabelOption['position'] | 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';
3471declare type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'> & {
3472 position?: PolarBarLabelPosition | 'outside';
3473};
3474interface BarStateOption<TCbParams = never> {
3475 itemStyle?: BarItemStyleOption<TCbParams>;
3476 label?: BarSeriesLabelOption;
3477}
3478interface BarStatesMixin {
3479 emphasis?: DefaultStatesMixinEmpasis;
3480}
3481interface BarItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
3482 borderRadius?: number | number[];
3483}
3484interface BarDataItemOption extends BarStateOption, StatesOptionMixin<BarStateOption, BarStatesMixin>, OptionDataItemObject<OptionDataValue> {
3485 cursor?: string;
3486}
3487interface BarSeriesOption extends BaseBarSeriesOption<BarStateOption<CallbackDataParams>, BarStatesMixin>, BarStateOption<CallbackDataParams>, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SeriesEncodeOptionMixin {
3488 type?: 'bar';
3489 coordinateSystem?: 'cartesian2d' | 'polar';
3490 clip?: boolean;
3491 /**
3492 * If use caps on two sides of bars
3493 * Only available on tangential polar bar
3494 */
3495 roundCap?: boolean;
3496 showBackground?: boolean;
3497 backgroundStyle?: ItemStyleOption & {
3498 borderRadius?: number | number[];
3499 };
3500 data?: (BarDataItemOption | OptionDataValue | OptionDataValue[])[];
3501 realtimeSort?: boolean;
3502}
3503
3504/**
3505 * {
3506 * [coordSysId]: {
3507 * [stackId]: {bandWidth, offset, width}
3508 * }
3509 * }
3510 */
3511declare type BarWidthAndOffset = Dictionary<Dictionary<{
3512 bandWidth: number;
3513 offset: number;
3514 offsetCenter: number;
3515 width: number;
3516}>>;
3517interface BarGridLayoutOptionForCustomSeries {
3518 count: number;
3519 barWidth?: number | string;
3520 barMaxWidth?: number | string;
3521 barMinWidth?: number | string;
3522 barGap?: number | string;
3523 barCategoryGap?: number | string;
3524}
3525declare type BarGridLayoutResult = BarWidthAndOffset[string][string][];
3526
3527declare type CustomExtraElementInfo = Dictionary<unknown>;
3528declare const TRANSFORM_PROPS: {
3529 readonly x: 1;
3530 readonly y: 1;
3531 readonly scaleX: 1;
3532 readonly scaleY: 1;
3533 readonly originX: 1;
3534 readonly originY: 1;
3535 readonly rotation: 1;
3536};
3537declare type TransformProp = keyof typeof TRANSFORM_PROPS;
3538declare const STYLE_VISUAL_TYPE: {
3539 readonly color: "fill";
3540 readonly borderColor: "stroke";
3541};
3542declare type StyleVisualProps = keyof typeof STYLE_VISUAL_TYPE;
3543declare const NON_STYLE_VISUAL_PROPS: {
3544 readonly symbol: 1;
3545 readonly symbolSize: 1;
3546 readonly symbolKeepAspect: 1;
3547 readonly legendIcon: 1;
3548 readonly visualMeta: 1;
3549 readonly liftZ: 1;
3550 readonly decal: 1;
3551};
3552declare type NonStyleVisualProps = keyof typeof NON_STYLE_VISUAL_PROPS;
3553declare type TransitionAnyOption = {
3554 transition?: TransitionAnyProps;
3555 enterFrom?: Dictionary<unknown>;
3556 leaveTo?: Dictionary<unknown>;
3557};
3558declare type TransitionAnyProps = string | string[];
3559declare type TransitionTransformOption = {
3560 transition?: ElementRootTransitionProp | ElementRootTransitionProp[];
3561 enterFrom?: Dictionary<unknown>;
3562 leaveTo?: Dictionary<unknown>;
3563};
3564declare type ElementRootTransitionProp = TransformProp | 'shape' | 'extra' | 'style';
3565declare type ShapeMorphingOption = {
3566 /**
3567 * If do shape morphing animation when type is changed.
3568 * Only available on path.
3569 */
3570 morph?: boolean;
3571};
3572interface CustomBaseDuringAPI {
3573 setTransform(key: TransformProp, val: number): this;
3574 getTransform(key: TransformProp): number;
3575 setExtra(key: string, val: unknown): this;
3576 getExtra(key: string): unknown;
3577}
3578interface CustomDuringAPI<StyleOpt extends any = any, ShapeOpt extends any = any> extends CustomBaseDuringAPI {
3579 setShape<T extends keyof ShapeOpt>(key: T, val: ShapeOpt[T]): this;
3580 getShape<T extends keyof ShapeOpt>(key: T): ShapeOpt[T];
3581 setStyle<T extends keyof StyleOpt>(key: T, val: StyleOpt[T]): this;
3582 getStyle<T extends keyof StyleOpt>(key: T): StyleOpt[T];
3583}
3584interface CustomBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig'>>, TransitionTransformOption {
3585 type: string;
3586 id?: string;
3587 name?: string;
3588 info?: CustomExtraElementInfo;
3589 textContent?: CustomTextOption | false;
3590 clipPath?: CustomBaseZRPathOption | false;
3591 extra?: Dictionary<unknown> & TransitionAnyOption;
3592 during?(params: CustomBaseDuringAPI): void;
3593}
3594interface CustomDisplayableOption extends CustomBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible'>> {
3595 style?: ZRStyleProps & TransitionAnyOption;
3596 during?(params: CustomDuringAPI): void;
3597 /**
3598 * @deprecated
3599 */
3600 styleEmphasis?: ZRStyleProps | false;
3601 emphasis?: CustomDisplayableOptionOnState;
3602 blur?: CustomDisplayableOptionOnState;
3603 select?: CustomDisplayableOptionOnState;
3604}
3605interface CustomDisplayableOptionOnState extends Partial<Pick<Displayable, TransformProp | 'textConfig' | 'z2'>> {
3606 style?: (ZRStyleProps & TransitionAnyOption) | false;
3607 during?(params: CustomDuringAPI): void;
3608}
3609interface CustomGroupOption extends CustomBaseElementOption {
3610 type: 'group';
3611 width?: number;
3612 height?: number;
3613 diffChildrenByName?: boolean;
3614 children: CustomElementOption[];
3615 $mergeChildren?: false | 'byName' | 'byIndex';
3616}
3617interface CustomBaseZRPathOption<T extends PathProps['shape'] = PathProps['shape']> extends CustomDisplayableOption, ShapeMorphingOption {
3618 autoBatch?: boolean;
3619 shape?: T & TransitionAnyOption;
3620 style?: PathProps['style'];
3621 during?(params: CustomDuringAPI<PathStyleProps, T>): void;
3622}
3623interface BuiltinShapes {
3624 circle: Partial<Circle['shape']>;
3625 rect: Partial<Rect['shape']>;
3626 sector: Partial<Sector['shape']>;
3627 polygon: Partial<Polygon['shape']>;
3628 polyline: Partial<Polyline['shape']>;
3629 line: Partial<Line['shape']>;
3630 arc: Partial<Arc['shape']>;
3631 bezierCurve: Partial<BezierCurve['shape']>;
3632 ring: Partial<Ring['shape']>;
3633 ellipse: Partial<Ellipse['shape']>;
3634 compoundPath: Partial<CompoundPath['shape']>;
3635}
3636interface CustomSVGPathShapeOption {
3637 pathData?: string;
3638 d?: string;
3639 layout?: 'center' | 'cover';
3640 x?: number;
3641 y?: number;
3642 width?: number;
3643 height?: number;
3644}
3645interface CustomSVGPathOption extends CustomBaseZRPathOption<CustomSVGPathShapeOption> {
3646 type: 'path';
3647}
3648interface CustomBuitinPathOption<T extends keyof BuiltinShapes> extends CustomBaseZRPathOption<BuiltinShapes[T]> {
3649 type: T;
3650}
3651declare type CreateCustomBuitinPathOption<T extends keyof BuiltinShapes> = T extends any ? CustomBuitinPathOption<T> : never;
3652declare type CustomPathOption = CreateCustomBuitinPathOption<keyof BuiltinShapes> | CustomSVGPathOption;
3653interface CustomImageOptionOnState extends CustomDisplayableOptionOnState {
3654 style?: ImageStyleProps & TransitionAnyOption;
3655}
3656interface CustomImageOption extends CustomDisplayableOption {
3657 type: 'image';
3658 style?: ImageStyleProps & TransitionAnyOption;
3659 emphasis?: CustomImageOptionOnState;
3660 blur?: CustomImageOptionOnState;
3661 select?: CustomImageOptionOnState;
3662}
3663interface CustomTextOptionOnState extends CustomDisplayableOptionOnState {
3664 style?: TextStyleProps & TransitionAnyOption;
3665}
3666interface CustomTextOption extends CustomDisplayableOption {
3667 type: 'text';
3668 style?: TextStyleProps & TransitionAnyOption;
3669 emphasis?: CustomTextOptionOnState;
3670 blur?: CustomTextOptionOnState;
3671 select?: CustomTextOptionOnState;
3672}
3673declare type CustomElementOption = CustomPathOption | CustomImageOption | CustomTextOption | CustomGroupOption;
3674declare type CustomRootElementOption = CustomElementOption & {
3675 focus?: 'none' | 'self' | 'series' | ArrayLike<number>;
3676 blurScope?: BlurScope;
3677};
3678interface CustomSeriesRenderItemAPI extends CustomSeriesRenderItemCoordinateSystemAPI {
3679 getWidth(): number;
3680 getHeight(): number;
3681 getZr(): ZRenderType;
3682 getDevicePixelRatio(): number;
3683 value(dim: DimensionLoose, dataIndexInside?: number): ParsedValue;
3684 ordinalRawValue(dim: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue;
3685 /**
3686 * @deprecated
3687 */
3688 style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
3689 /**
3690 * @deprecated
3691 */
3692 styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
3693 visual<VT extends NonStyleVisualProps | StyleVisualProps>(visualType: VT, dataIndexInside?: number): VT extends NonStyleVisualProps ? DefaultDataVisual[VT] : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]] : void;
3694 barLayout(opt: BarGridLayoutOptionForCustomSeries): BarGridLayoutResult;
3695 currentSeriesIndices(): number[];
3696 font(opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>): string;
3697}
3698interface CustomSeriesRenderItemParamsCoordSys {
3699 type: string;
3700}
3701interface CustomSeriesRenderItemCoordinateSystemAPI {
3702 coord(data: OptionDataValue | OptionDataValue[], clamp?: boolean): number[];
3703 size?(dataSize: OptionDataValue | OptionDataValue[], dataItem?: OptionDataValue | OptionDataValue[]): number | number[];
3704}
3705declare type WrapEncodeDefRet = Dictionary<number[]>;
3706interface CustomSeriesRenderItemParams {
3707 context: Dictionary<unknown>;
3708 dataIndex: number;
3709 seriesId: string;
3710 seriesName: string;
3711 seriesIndex: number;
3712 coordSys: CustomSeriesRenderItemParamsCoordSys;
3713 encode: WrapEncodeDefRet;
3714 dataIndexInside: number;
3715 dataInsideLength: number;
3716 actionType?: string;
3717}
3718declare type CustomSeriesRenderItemReturn = CustomRootElementOption | undefined | null;
3719declare type CustomSeriesRenderItem = (params: CustomSeriesRenderItemParams, api: CustomSeriesRenderItemAPI) => CustomSeriesRenderItemReturn;
3720interface CustomSeriesOption extends SeriesOption<unknown>, // don't support StateOption in custom series.
3721SeriesEncodeOptionMixin, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnSingleOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin {
3722 type?: 'custom';
3723 coordinateSystem?: string | 'none';
3724 renderItem?: CustomSeriesRenderItem;
3725 /**
3726 * @deprecated
3727 */
3728 itemStyle?: ItemStyleOption;
3729 /**
3730 * @deprecated
3731 */
3732 label?: LabelOption;
3733 /**
3734 * @deprecated
3735 */
3736 emphasis?: {
3737 /**
3738 * @deprecated
3739 */
3740 itemStyle?: ItemStyleOption;
3741 /**
3742 * @deprecated
3743 */
3744 label?: LabelOption;
3745 };
3746 clip?: boolean;
3747}
3748declare type PrepareCustomInfo = (coordSys: CoordinateSystem) => {
3749 coordSys: CustomSeriesRenderItemParamsCoordSys;
3750 api: CustomSeriesRenderItemCoordinateSystemAPI;
3751};
3752
3753interface CoordinateSystemCreator {
3754 create: (ecModel: GlobalModel, api: ExtensionAPI) => CoordinateSystemMaster[];
3755 dimensions?: DimensionName[];
3756 getDimensionsInfo?: () => DimensionDefinitionLoose[];
3757}
3758/**
3759 * The instance get from `CoordinateSystemManger` is `CoordinateSystemMaster`.
3760 */
3761interface CoordinateSystemMaster {
3762 dimensions: DimensionName[];
3763 model?: ComponentModel;
3764 update?: (ecModel: GlobalModel, api: ExtensionAPI) => void;
3765 convertToPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[];
3766 convertFromPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[]): number | number[];
3767 containPoint(point: number[]): boolean;
3768 getAxes?: () => Axis[];
3769 axisPointerEnabled?: boolean;
3770 getTooltipAxes?: (dim: DimensionName | 'auto') => {
3771 baseAxes: Axis[];
3772 otherAxes: Axis[];
3773 };
3774 /**
3775 * Get layout rect or coordinate system
3776 */
3777 getRect?: () => RectLike;
3778}
3779/**
3780 * For example: cartesian is CoordinateSystem.
3781 * series.coordinateSystem is CoordinateSystem.
3782 */
3783interface CoordinateSystem {
3784 type: string;
3785 /**
3786 * Master of coordinate system. For example:
3787 * Grid is master of cartesian.
3788 */
3789 master?: CoordinateSystemMaster;
3790 dimensions: DimensionName[];
3791 model?: ComponentModel;
3792 /**
3793 * @param data
3794 * @param reserved Defined by the coordinate system itself
3795 * @param out
3796 * @return {Array.<number>} point Point in global pixel coordinate system.
3797 */
3798 dataToPoint(data: ScaleDataValue | ScaleDataValue[], reserved?: any, out?: number[]): number[];
3799 /**
3800 * Some coord sys (like Parallel) might do not have `pointToData`,
3801 * or the meaning of this kind of features is not clear yet.
3802 * @param point point Point in global pixel coordinate system.
3803 * @param clamp Clamp range
3804 * @return data
3805 */
3806 pointToData?(point: number[], clamp?: boolean): number | number[];
3807 containPoint(point: number[]): boolean;
3808 getAxis?: (dim?: DimensionName) => Axis;
3809 getBaseAxis?: () => Axis;
3810 getOtherAxis?: (baseAxis: Axis) => Axis;
3811 clampData?: (data: ScaleDataValue[], out?: number[]) => number[];
3812 getRoamTransform?: () => MatrixArray;
3813 getArea?: () => CoordinateSystemClipArea;
3814 getBoundingRect?: () => BoundingRect;
3815 getAxesByScale?: (scaleType: string) => Axis[];
3816 prepareCustoms?: PrepareCustomInfo;
3817}
3818/**
3819 * Like GridModel, PolarModel, ...
3820 */
3821interface CoordinateSystemHostModel extends ComponentModel {
3822 coordinateSystem?: CoordinateSystemMaster;
3823}
3824/**
3825 * Clip area will be returned by getArea of CoordinateSystem.
3826 * It is used to clip the graphic elements with the contain methods.
3827 */
3828interface CoordinateSystemClipArea {
3829 contain(x: number, y: number): boolean;
3830}
3831
3832/**
3833 * LegendVisualProvider is an bridge that pick encoded color from data and
3834 * provide to the legend component.
3835 */
3836declare class LegendVisualProvider {
3837 private _getDataWithEncodedVisual;
3838 private _getRawData;
3839 constructor(getDataWithEncodedVisual: () => SeriesData, getRawData: () => SeriesData);
3840 getAllNames(): string[];
3841 containName(name: string): boolean;
3842 indexOfName(name: string): number;
3843 getItemVisual(dataIndex: number, key: string): any;
3844}
3845
3846declare function makeStyleMapper(properties: readonly string[][], ignoreParent?: boolean): (model: Model, excludes?: readonly string[], includes?: readonly string[]) => PathStyleProps;
3847
3848declare const SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled";
3849interface SeriesModel {
3850 /**
3851 * Convinient for override in extended class.
3852 * Implement it if needed.
3853 */
3854 preventIncremental(): boolean;
3855 /**
3856 * See tooltip.
3857 * Implement it if needed.
3858 * @return Point of tooltip. null/undefined can be returned.
3859 */
3860 getTooltipPosition(dataIndex: number): number[];
3861 /**
3862 * Get data indices for show tooltip content. See tooltip.
3863 * Implement it if needed.
3864 */
3865 getAxisTooltipData(dim: DimensionName[], value: ScaleDataValue, baseAxis: Axis): {
3866 dataIndices: number[];
3867 nestestValue: any;
3868 };
3869 /**
3870 * Get position for marker
3871 */
3872 getMarkerPosition(value: ScaleDataValue[]): number[];
3873 /**
3874 * Get legend icon symbol according to each series type
3875 */
3876 getLegendIcon(opt: LegendIconParams): ECSymbol | Group;
3877 /**
3878 * See `component/brush/selector.js`
3879 * Defined the brush selector for this series.
3880 */
3881 brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean;
3882 enableAriaDecal(): void;
3883}
3884declare class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentModel<Opt> {
3885 type: string;
3886 defaultOption: SeriesOption;
3887 seriesIndex: number;
3888 coordinateSystem: CoordinateSystem;
3889 dataTask: SeriesTask;
3890 pipelineContext: PipelineContext;
3891 legendVisualProvider: LegendVisualProvider;
3892 visualStyleAccessPath: string;
3893 visualDrawType: 'fill' | 'stroke';
3894 visualStyleMapper: ReturnType<typeof makeStyleMapper>;
3895 ignoreStyleOnData: boolean;
3896 hasSymbolVisual: boolean;
3897 defaultSymbol: string;
3898 legendIcon: string;
3899 [SERIES_UNIVERSAL_TRANSITION_PROP]: boolean;
3900 private _selectedDataIndicesMap;
3901 readonly preventUsingHoverLayer: boolean;
3902 static protoInitialize: void;
3903 init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
3904 /**
3905 * Util for merge default and theme to option
3906 */
3907 mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
3908 mergeOption(newSeriesOption: Opt, ecModel: GlobalModel): void;
3909 fillDataTextStyle(data: ArrayLike<any>): void;
3910 /**
3911 * Init a data structure from data related option in series
3912 * Must be overriden.
3913 */
3914 getInitialData(option: Opt, ecModel: GlobalModel): SeriesData;
3915 /**
3916 * Append data to list
3917 */
3918 appendData(params: {
3919 data: ArrayLike<any>;
3920 }): void;
3921 /**
3922 * Consider some method like `filter`, `map` need make new data,
3923 * We should make sure that `seriesModel.getData()` get correct
3924 * data in the stream procedure. So we fetch data from upstream
3925 * each time `task.perform` called.
3926 */
3927 getData(dataType?: SeriesDataType): SeriesData<this>;
3928 getAllData(): ({
3929 data: SeriesData;
3930 type?: SeriesDataType;
3931 })[];
3932 setData(data: SeriesData): void;
3933 getEncode(): HashMap<OptionEncodeValue, string>;
3934 getSourceManager(): SourceManager;
3935 getSource(): Source;
3936 /**
3937 * Get data before processed
3938 */
3939 getRawData(): SeriesData;
3940 getColorBy(): ColorBy;
3941 isColorBySeries(): boolean;
3942 /**
3943 * Get base axis if has coordinate system and has axis.
3944 * By default use coordSys.getBaseAxis();
3945 * Can be overrided for some chart.
3946 * @return {type} description
3947 */
3948 getBaseAxis(): Axis;
3949 /**
3950 * Default tooltip formatter
3951 *
3952 * @param dataIndex
3953 * @param multipleSeries
3954 * @param dataType
3955 * @param renderMode valid values: 'html'(by default) and 'richText'.
3956 * 'html' is used for rendering tooltip in extra DOM form, and the result
3957 * string is used as DOM HTML content.
3958 * 'richText' is used for rendering tooltip in rich text form, for those where
3959 * DOM operation is not supported.
3960 * @return formatted tooltip with `html` and `markers`
3961 * Notice: The override method can also return string
3962 */
3963 formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: SeriesDataType): ReturnType<DataFormatMixin['formatTooltip']>;
3964 isAnimationEnabled(): boolean;
3965 restoreData(): void;
3966 getColorFromPalette(name: string, scope: any, requestColorNum?: number): ZRColor;
3967 /**
3968 * Use `data.mapDimensionsAll(coordDim)` instead.
3969 * @deprecated
3970 */
3971 coordDimToDataDim(coordDim: DimensionName): DimensionName[];
3972 /**
3973 * Get progressive rendering count each step
3974 */
3975 getProgressive(): number | false;
3976 /**
3977 * Get progressive rendering count each step
3978 */
3979 getProgressiveThreshold(): number;
3980 select(innerDataIndices: number[], dataType?: SeriesDataType): void;
3981 unselect(innerDataIndices: number[], dataType?: SeriesDataType): void;
3982 toggleSelect(innerDataIndices: number[], dataType?: SeriesDataType): void;
3983 getSelectedDataIndices(): number[];
3984 isSelected(dataIndex: number, dataType?: SeriesDataType): boolean;
3985 isUniversalTransitionEnabled(): boolean;
3986 private _innerSelect;
3987 private _initSelectedMapFromData;
3988 static registerClass(clz: Constructor): Constructor;
3989}
3990interface SeriesModel<Opt extends SeriesOption = SeriesOption> extends DataFormatMixin, PaletteMixin<Opt>, DataHost {
3991 /**
3992 * Get dimension to render shadow in dataZoom component
3993 */
3994 getShadowDim?(): string;
3995}
3996
3997/**
3998 * Multi dimensional data store
3999 */
4000declare const dataCtors: {
4001 readonly float: ArrayConstructor | Float64ArrayConstructor;
4002 readonly int: ArrayConstructor | Int32ArrayConstructor;
4003 readonly ordinal: ArrayConstructor;
4004 readonly number: ArrayConstructor;
4005 readonly time: ArrayConstructor | Float64ArrayConstructor;
4006};
4007declare type DataStoreDimensionType = keyof typeof dataCtors;
4008declare type EachCb = (...args: any) => void;
4009declare type FilterCb = (...args: any) => boolean;
4010declare type MapCb = (...args: any) => ParsedValue | ParsedValue[];
4011declare type DimValueGetter = (this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: DimensionIndex) => ParsedValue;
4012interface DataStoreDimensionDefine {
4013 /**
4014 * Default to be float.
4015 */
4016 type?: DataStoreDimensionType;
4017 /**
4018 * Only used in SOURCE_FORMAT_OBJECT_ROWS and SOURCE_FORMAT_KEYED_COLUMNS to retrieve value
4019 * by "object property".
4020 * For example, in `[{bb: 124, aa: 543}, ...]`, "aa" and "bb" is "object property".
4021 *
4022 * Deliberately name it as "property" rather than "name" to prevent it from been used in
4023 * SOURCE_FORMAT_ARRAY_ROWS, becuase if it comes from series, it probably
4024 * can not be shared by different series.
4025 */
4026 property?: string;
4027 /**
4028 * When using category axis.
4029 * Category strings will be collected and stored in ordinalMeta.categories.
4030 * And store will store the index of categories.
4031 */
4032 ordinalMeta?: OrdinalMeta;
4033 /**
4034 * Offset for ordinal parsing and collect
4035 */
4036 ordinalOffset?: number;
4037}
4038/**
4039 * Basically, DataStore API keep immutable.
4040 */
4041declare class DataStore {
4042 private _chunks;
4043 private _provider;
4044 private _rawExtent;
4045 private _extent;
4046 private _indices;
4047 private _count;
4048 private _rawCount;
4049 private _dimensions;
4050 private _dimValueGetter;
4051 private _calcDimNameToIdx;
4052 defaultDimValueGetter: DimValueGetter;
4053 /**
4054 * Initialize from data
4055 */
4056 initData(provider: DataProvider, inputDimensions: DataStoreDimensionDefine[], dimValueGetter?: DimValueGetter): void;
4057 getProvider(): DataProvider;
4058 /**
4059 * Caution: even when a `source` instance owned by a series, the created data store
4060 * may still be shared by different sereis (the source hash does not use all `source`
4061 * props, see `sourceManager`). In this case, the `source` props that are not used in
4062 * hash (like `source.dimensionDefine`) probably only belongs to a certain series and
4063 * thus should not be fetch here.
4064 */
4065 getSource(): Source;
4066 /**
4067 * @caution Only used in dataStack.
4068 */
4069 ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex;
4070 collectOrdinalMeta(dimIdx: number, ordinalMeta: OrdinalMeta): void;
4071 getOrdinalMeta(dimIdx: number): OrdinalMeta;
4072 getDimensionProperty(dimIndex: DimensionIndex): DataStoreDimensionDefine['property'];
4073 /**
4074 * Caution: Can be only called on raw data (before `this._indices` created).
4075 */
4076 appendData(data: ArrayLike<any>): number[];
4077 appendValues(values: any[][], minFillLen?: number): {
4078 start: number;
4079 end: number;
4080 };
4081 private _initDataFromProvider;
4082 count(): number;
4083 /**
4084 * Get value. Return NaN if idx is out of range.
4085 */
4086 get(dim: DimensionIndex, idx: number): ParsedValue;
4087 getValues(idx: number): ParsedValue[];
4088 getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[];
4089 /**
4090 * @param dim concrete dim
4091 */
4092 getByRawIndex(dim: DimensionIndex, rawIdx: number): ParsedValue;
4093 /**
4094 * Get sum of data in one dimension
4095 */
4096 getSum(dim: DimensionIndex): number;
4097 /**
4098 * Get median of data in one dimension
4099 */
4100 getMedian(dim: DimensionIndex): number;
4101 /**
4102 * Retreive the index with given raw data index
4103 */
4104 indexOfRawIndex(rawIndex: number): number;
4105 /**
4106 * Retreive the index of nearest value
4107 * @param dim
4108 * @param value
4109 * @param [maxDistance=Infinity]
4110 * @return If and only if multiple indices has
4111 * the same value, they are put to the result.
4112 */
4113 indicesOfNearest(dim: DimensionIndex, value: number, maxDistance?: number): number[];
4114 getIndices(): ArrayLike<number>;
4115 /**
4116 * Data filter.
4117 */
4118 filter(dims: DimensionIndex[], cb: FilterCb): DataStore;
4119 /**
4120 * Select data in range. (For optimization of filter)
4121 * (Manually inline code, support 5 million data filtering in data zoom.)
4122 */
4123 selectRange(range: {
4124 [dimIdx: number]: [number, number];
4125 }): DataStore;
4126 /**
4127 * Data mapping to a new List with given dimensions
4128 */
4129 map(dims: DimensionIndex[], cb: MapCb): DataStore;
4130 /**
4131 * @caution Danger!! Only used in dataStack.
4132 */
4133 modify(dims: DimensionIndex[], cb: MapCb): void;
4134 private _updateDims;
4135 /**
4136 * Large data down sampling using largest-triangle-three-buckets
4137 * @param {string} valueDimension
4138 * @param {number} targetCount
4139 */
4140 lttbDownSample(valueDimension: DimensionIndex, rate: number): DataStore;
4141 /**
4142 * Large data down sampling on given dimension
4143 * @param sampleIndex Sample index for name and id
4144 */
4145 downSample(dimension: DimensionIndex, rate: number, sampleValue: (frameValues: ArrayLike<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike<ParsedValue>, value: ParsedValueNumeric) => number): DataStore;
4146 /**
4147 * Data iteration
4148 * @param ctx default this
4149 * @example
4150 * list.each('x', function (x, idx) {});
4151 * list.each(['x', 'y'], function (x, y, idx) {});
4152 * list.each(function (idx) {})
4153 */
4154 each(dims: DimensionIndex[], cb: EachCb): void;
4155 /**
4156 * Get extent of data in one dimension
4157 */
4158 getDataExtent(dim: DimensionIndex): [number, number];
4159 /**
4160 * Get raw data index.
4161 * Do not initialize.
4162 * Default `getRawIndex`. And it can be changed.
4163 */
4164 getRawIndex: (idx: number) => number;
4165 /**
4166 * Get raw data item
4167 */
4168 getRawDataItem(idx: number): OptionDataItem;
4169 /**
4170 * Clone shallow.
4171 *
4172 * @param clonedDims Determine which dims to clone. Will share the data if not specified.
4173 */
4174 clone(clonedDims?: DimensionIndex[], ignoreIndices?: boolean): DataStore;
4175 private _copyCommonProps;
4176 private _cloneIndices;
4177 private _getRawIdxIdentity;
4178 private _getRawIdx;
4179 private _updateGetRawIdx;
4180 private static internalField;
4181}
4182
4183declare class SeriesDimensionDefine {
4184 /**
4185 * Dimension type. The enumerable values are the key of
4186 * Optional.
4187 */
4188 type?: DimensionType;
4189 /**
4190 * Dimension name.
4191 * Mandatory.
4192 */
4193 name: string;
4194 /**
4195 * The origin name in dimsDef, see source helper.
4196 * If displayName given, the tooltip will displayed vertically.
4197 * Optional.
4198 */
4199 displayName?: string;
4200 tooltip?: boolean;
4201 /**
4202 * This dimension maps to the the dimension in dataStore by `storeDimIndex`.
4203 * Notice the facts:
4204 * 1. When there are too many dimensions in data store, seriesData only save the
4205 * used store dimensions.
4206 * 2. We use dimensionIndex but not name to reference store dimension
4207 * becuause the dataset dimension definition might has no name specified by users,
4208 * or names in sereis dimension definition might be different from dataset.
4209 */
4210 storeDimIndex?: number;
4211 /**
4212 * Which coordSys dimension this dimension mapped to.
4213 * A `coordDim` can be a "coordSysDim" that the coordSys required
4214 * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),
4215 * or an generated "extra coord name" if does not mapped to any "coordSysDim"
4216 * (That is determined by whether `isExtraCoord` is `true`).
4217 * Mandatory.
4218 */
4219 coordDim?: string;
4220 /**
4221 * The index of this dimension in `series.encode[coordDim]`.
4222 * Mandatory.
4223 */
4224 coordDimIndex?: number;
4225 /**
4226 * The format of `otherDims` is:
4227 * ```js
4228 * {
4229 * tooltip?: number
4230 * label?: number
4231 * itemName?: number
4232 * seriesName?: number
4233 * }
4234 * ```
4235 *
4236 * A `series.encode` can specified these fields:
4237 * ```js
4238 * encode: {
4239 * // "3, 1, 5" is the index of data dimension.
4240 * tooltip: [3, 1, 5],
4241 * label: [0, 3],
4242 * ...
4243 * }
4244 * ```
4245 * `otherDims` is the parse result of the `series.encode` above, like:
4246 * ```js
4247 * // Suppose the index of this data dimension is `3`.
4248 * this.otherDims = {
4249 * // `3` is at the index `0` of the `encode.tooltip`
4250 * tooltip: 0,
4251 * // `3` is at the index `1` of the `encode.label`
4252 * label: 1
4253 * };
4254 * ```
4255 *
4256 * This prop should never be `null`/`undefined` after initialized.
4257 */
4258 otherDims?: DataVisualDimensions;
4259 /**
4260 * Be `true` if this dimension is not mapped to any "coordSysDim" that the
4261 * "coordSys" required.
4262 * Mandatory.
4263 */
4264 isExtraCoord?: boolean;
4265 /**
4266 * If this dimension if for calculated value like stacking
4267 */
4268 isCalculationCoord?: boolean;
4269 defaultTooltip?: boolean;
4270 ordinalMeta?: OrdinalMeta;
4271 /**
4272 * Whether to create inverted indices.
4273 */
4274 createInvertedIndices?: boolean;
4275 /**
4276 * @param opt All of the fields will be shallow copied.
4277 */
4278 constructor(opt?: object | SeriesDimensionDefine);
4279}
4280
4281/**
4282 * Represents the dimension requirement of a series.
4283 *
4284 * NOTICE:
4285 * When there are too many dimensions in dataset and many series, only the used dimensions
4286 * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.
4287 * But users may query data by other unused dimension names.
4288 * In this case, users can only query data if and only if they have defined dimension names
4289 * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from
4290 * `source` dimensions.
4291 */
4292declare class SeriesDataSchema {
4293 /**
4294 * When there are too many dimensions, `dimensionDefineList` might only contain
4295 * used dimensions.
4296 *
4297 * CAUTION:
4298 * Should have been sorted by `storeDimIndex` asc.
4299 *
4300 * PENDING:
4301 * The item can still be modified outsite.
4302 * But MUST NOT add/remove item of this array.
4303 */
4304 readonly dimensions: SeriesDimensionDefine[];
4305 readonly source: Source;
4306 private _fullDimCount;
4307 private _dimNameMap;
4308 private _dimOmitted;
4309 constructor(opt: {
4310 source: Source;
4311 dimensions: SeriesDimensionDefine[];
4312 fullDimensionCount: number;
4313 dimensionOmitted: boolean;
4314 });
4315 isDimensionOmitted(): boolean;
4316 private _updateDimOmitted;
4317 /**
4318 * @caution Can only be used when `dimensionOmitted: true`.
4319 *
4320 * Get index by user defined dimension name (i.e., not internal generate name).
4321 * That is, get index from `dimensionsDefine`.
4322 * If no `dimensionsDefine`, or no name get, return -1.
4323 */
4324 getSourceDimensionIndex(dimName: DimensionName): DimensionIndex;
4325 /**
4326 * @caution Can only be used when `dimensionOmitted: true`.
4327 *
4328 * Notice: may return `null`/`undefined` if user not specify dimension names.
4329 */
4330 getSourceDimension(dimIndex: DimensionIndex): DimensionDefinition;
4331 makeStoreSchema(): {
4332 dimensions: DataStoreDimensionDefine[];
4333 hash: string;
4334 };
4335 makeOutputDimensionNames(): DimensionName[];
4336 appendCalculationDimension(dimDef: SeriesDimensionDefine): void;
4337}
4338
4339/**
4340 * [REQUIREMENT_MEMO]:
4341 * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.
4342 * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and
4343 * `root-dataset`. Them on `series` has higher priority.
4344 * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might
4345 * confuse users: whether those props indicate how to visit the upstream source or visit
4346 * the transform result source, and some transforms has nothing to do with these props,
4347 * and some transforms might have multiple upstream.
4348 * (3) Transforms should specify `metaRawOption` in each output, just like they can be
4349 * declared in `root-dataset`.
4350 * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.
4351 * That is for reducing complexity in transfroms.
4352 * PENDING: Whether to provide transposition transform?
4353 *
4354 * [IMPLEMENTAION_MEMO]:
4355 * "sourceVisitConfig" are calculated from `metaRawOption` and `data`.
4356 * They will not be calculated until `source` is about to be visited (to prevent from
4357 * duplicate calcuation). `source` is visited only in series and input to transforms.
4358 *
4359 * [DIMENSION_INHERIT_RULE]:
4360 * By default the dimensions are inherited from ancestors, unless a transform return
4361 * a new dimensions definition.
4362 * Consider the case:
4363 * ```js
4364 * dataset: [{
4365 * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]
4366 * }, {
4367 * transform: { type: 'filter', ... }
4368 * }]
4369 * dataset: [{
4370 * dimension: ['Product', 'Sales', 'Prise'],
4371 * source: [ ['Cookies', 321, 44.21], ...]
4372 * }, {
4373 * transform: { type: 'filter', ... }
4374 * }]
4375 * ```
4376 * The two types of option should have the same behavior after transform.
4377 *
4378 *
4379 * [SCENARIO]:
4380 * (1) Provide source data directly:
4381 * ```js
4382 * series: {
4383 * encode: {...},
4384 * dimensions: [...]
4385 * seriesLayoutBy: 'row',
4386 * data: [[...]]
4387 * }
4388 * ```
4389 * (2) Series refer to dataset.
4390 * ```js
4391 * series: [{
4392 * encode: {...}
4393 * // Ignore datasetIndex means `datasetIndex: 0`
4394 * // and the dimensions defination in dataset is used
4395 * }, {
4396 * encode: {...},
4397 * seriesLayoutBy: 'column',
4398 * datasetIndex: 1
4399 * }]
4400 * ```
4401 * (3) dataset transform
4402 * ```js
4403 * dataset: [{
4404 * source: [...]
4405 * }, {
4406 * source: [...]
4407 * }, {
4408 * // By default from 0.
4409 * transform: { type: 'filter', config: {...} }
4410 * }, {
4411 * // Piped.
4412 * transform: [
4413 * { type: 'filter', config: {...} },
4414 * { type: 'sort', config: {...} }
4415 * ]
4416 * }, {
4417 * id: 'regressionData',
4418 * fromDatasetIndex: 1,
4419 * // Third-party transform
4420 * transform: { type: 'ecStat:regression', config: {...} }
4421 * }, {
4422 * // retrieve the extra result.
4423 * id: 'regressionFormula',
4424 * fromDatasetId: 'regressionData',
4425 * fromTransformResult: 1
4426 * }]
4427 * ```
4428 */
4429declare class SourceManager {
4430 private _sourceHost;
4431 private _sourceList;
4432 private _storeList;
4433 private _upstreamSignList;
4434 private _versionSignBase;
4435 private _dirty;
4436 constructor(sourceHost: DatasetModel | SeriesModel);
4437 /**
4438 * Mark dirty.
4439 */
4440 dirty(): void;
4441 private _setLocalSource;
4442 /**
4443 * For detecting whether the upstream source is dirty, so that
4444 * the local cached source (in `_sourceList`) should be discarded.
4445 */
4446 private _getVersionSign;
4447 /**
4448 * Always return a source instance. Otherwise throw error.
4449 */
4450 prepareSource(): void;
4451 private _createSource;
4452 private _applyTransform;
4453 private _isDirty;
4454 /**
4455 * @param sourceIndex By defualt 0, means "main source".
4456 * Most cases there is only one source.
4457 */
4458 getSource(sourceIndex?: number): Source;
4459 /**
4460 *
4461 * Get a data store which can be shared across series.
4462 * Only available for series.
4463 *
4464 * @param seriesDimRequest Dimensions that are generated in series.
4465 * Should have been sorted by `storeDimIndex` asc.
4466 */
4467 getSharedDataStore(seriesDimRequest: SeriesDataSchema): DataStore;
4468 private _innerGetDataStore;
4469 /**
4470 * PEDING: Is it fast enough?
4471 * If no upstream, return empty array.
4472 */
4473 private _getUpstreamSourceManagers;
4474 private _getSourceMetaRawOption;
4475}
4476
4477/**
4478 * This module is imported by echarts directly.
4479 *
4480 * Notice:
4481 * Always keep this file exists for backward compatibility.
4482 * Because before 4.1.0, dataset is an optional component,
4483 * some users may import this module manually.
4484 */
4485
4486interface DatasetOption extends Pick<ComponentOption, 'type' | 'id' | 'name'>, Pick<SeriesEncodeOptionMixin, 'dimensions'> {
4487 mainType?: 'dataset';
4488 seriesLayoutBy?: SeriesLayoutBy;
4489 sourceHeader?: OptionSourceHeader;
4490 source?: OptionSourceData;
4491 fromDatasetIndex?: number;
4492 fromDatasetId?: string;
4493 transform?: DataTransformOption | PipedDataTransformOption;
4494 fromTransformResult?: number;
4495}
4496declare class DatasetModel<Opts extends DatasetOption = DatasetOption> extends ComponentModel<Opts> {
4497 type: string;
4498 static type: string;
4499 static defaultOption: DatasetOption;
4500 private _sourceManager;
4501 init(option: Opts, parentModel: Model, ecModel: GlobalModel): void;
4502 mergeOption(newOption: Opts, ecModel: GlobalModel): void;
4503 optionUpdated(): void;
4504 getSourceManager(): SourceManager;
4505}
4506
4507/**
4508 * [sourceFormat]
4509 *
4510 * + "original":
4511 * This format is only used in series.data, where
4512 * itemStyle can be specified in data item.
4513 *
4514 * + "arrayRows":
4515 * [
4516 * ['product', 'score', 'amount'],
4517 * ['Matcha Latte', 89.3, 95.8],
4518 * ['Milk Tea', 92.1, 89.4],
4519 * ['Cheese Cocoa', 94.4, 91.2],
4520 * ['Walnut Brownie', 85.4, 76.9]
4521 * ]
4522 *
4523 * + "objectRows":
4524 * [
4525 * {product: 'Matcha Latte', score: 89.3, amount: 95.8},
4526 * {product: 'Milk Tea', score: 92.1, amount: 89.4},
4527 * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},
4528 * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}
4529 * ]
4530 *
4531 * + "keyedColumns":
4532 * {
4533 * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],
4534 * 'count': [823, 235, 1042, 988],
4535 * 'score': [95.8, 81.4, 91.2, 76.9]
4536 * }
4537 *
4538 * + "typedArray"
4539 *
4540 * + "unknown"
4541 */
4542interface SourceMetaRawOption {
4543 seriesLayoutBy: SeriesLayoutBy;
4544 sourceHeader: OptionSourceHeader;
4545 dimensions: DimensionDefinitionLoose[];
4546}
4547interface Source extends SourceImpl {
4548}
4549declare class SourceImpl {
4550 /**
4551 * Not null/undefined.
4552 */
4553 readonly data: OptionSourceData;
4554 /**
4555 * See also "detectSourceFormat".
4556 * Not null/undefined.
4557 */
4558 readonly sourceFormat: SourceFormat;
4559 /**
4560 * 'row' or 'column'
4561 * Not null/undefined.
4562 */
4563 readonly seriesLayoutBy: SeriesLayoutBy;
4564 /**
4565 * dimensions definition from:
4566 * (1) standalone defined in option prop `dimensions: [...]`
4567 * (2) detected from option data. See `determineSourceDimensions`.
4568 * If can not be detected (e.g., there is only pure data `[[11, 33], ...]`
4569 * `dimensionsDefine` will be null/undefined.
4570 */
4571 readonly dimensionsDefine: DimensionDefinition[];
4572 /**
4573 * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`.
4574 * That is the same as `sourceHeader: number`,
4575 * which means from which line the real data start.
4576 * Not null/undefined, uint.
4577 */
4578 readonly startIndex: number;
4579 /**
4580 * Dimension count detected from data. Only works when `dimensionDefine`
4581 * does not exists.
4582 * Can be null/undefined (when unknown), uint.
4583 */
4584 readonly dimensionsDetectedCount: number;
4585 /**
4586 * Raw props from user option.
4587 */
4588 readonly metaRawOption: SourceMetaRawOption;
4589 constructor(fields: {
4590 data: OptionSourceData;
4591 sourceFormat: SourceFormat;
4592 seriesLayoutBy?: SeriesLayoutBy;
4593 dimensionsDefine?: DimensionDefinition[];
4594 startIndex?: number;
4595 dimensionsDetectedCount?: number;
4596 metaRawOption?: SourceMetaRawOption;
4597 encodeDefine?: HashMap<OptionEncodeValue, DimensionName>;
4598 });
4599}
4600
4601interface DataProvider {
4602 /**
4603 * true: all of the value are in primitive type (in type `OptionDataValue`).
4604 * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).
4605 * Like `data: [ { value: xx, itemStyle: {...} }, ...]`
4606 * At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
4607 */
4608 pure?: boolean;
4609 /**
4610 * If data is persistent and will not be released after use.
4611 */
4612 persistent?: boolean;
4613 getSource(): Source;
4614 count(): number;
4615 getItem(idx: number, out?: OptionDataItem): OptionDataItem;
4616 fillStorage?(start: number, end: number, out: ArrayLike$1<ParsedValue>[], extent: number[][]): void;
4617 appendData?(newData: ArrayLike$1<OptionDataItem>): void;
4618 clean?(): void;
4619}
4620
4621declare type DimensionSummaryEncode = {
4622 defaultedLabel: DimensionName[];
4623 defaultedTooltip: DimensionName[];
4624 [coordOrVisualDimName: string]: DimensionName[];
4625};
4626declare type DimensionSummary = {
4627 encode: DimensionSummaryEncode;
4628 userOutput: DimensionUserOuput;
4629 dataDimsOnCoord: DimensionName[];
4630 dataDimIndicesOnCoord: DimensionIndex[];
4631 encodeFirstDimNotExtra: {
4632 [coordDim: string]: DimensionName;
4633 };
4634};
4635declare type DimensionUserOuputEncode = {
4636 [coordOrVisualDimName: string]: DimensionIndex[];
4637};
4638declare class DimensionUserOuput {
4639 private _encode;
4640 private _cachedDimNames;
4641 private _schema?;
4642 constructor(encode: DimensionUserOuputEncode, dimRequest?: SeriesDataSchema);
4643 get(): {
4644 fullDimensions: DimensionName[];
4645 encode: DimensionUserOuputEncode;
4646 };
4647 /**
4648 * Get all data store dimension names.
4649 * Theoretically a series data store is defined both by series and used dataset (if any).
4650 * If some dimensions are omitted for performance reason in `this.dimensions`,
4651 * the dimension name may not be auto-generated if user does not specify a dimension name.
4652 * In this case, the dimension name is `null`/`undefined`.
4653 */
4654 private _getFullDimensionNames;
4655}
4656
4657declare class Graph {
4658 type: 'graph';
4659 readonly nodes: GraphNode[];
4660 readonly edges: GraphEdge[];
4661 data: SeriesData;
4662 edgeData: SeriesData;
4663 /**
4664 * Whether directed graph.
4665 */
4666 private _directed;
4667 private _nodesMap;
4668 /**
4669 * @type {Object.<string, module:echarts/data/Graph.Edge>}
4670 * @private
4671 */
4672 private _edgesMap;
4673 constructor(directed?: boolean);
4674 /**
4675 * If is directed graph
4676 */
4677 isDirected(): boolean;
4678 /**
4679 * Add a new node
4680 */
4681 addNode(id: string | number, dataIndex?: number): GraphNode;
4682 /**
4683 * Get node by data index
4684 */
4685 getNodeByIndex(dataIndex: number): GraphNode;
4686 /**
4687 * Get node by id
4688 */
4689 getNodeById(id: string): GraphNode;
4690 /**
4691 * Add a new edge
4692 */
4693 addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number): GraphEdge;
4694 /**
4695 * Get edge by data index
4696 */
4697 getEdgeByIndex(dataIndex: number): GraphEdge;
4698 /**
4699 * Get edge by two linked nodes
4700 */
4701 getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge;
4702 /**
4703 * Iterate all nodes
4704 */
4705 eachNode<Ctx>(cb: (this: Ctx, node: GraphNode, idx: number) => void, context?: Ctx): void;
4706 /**
4707 * Iterate all edges
4708 */
4709 eachEdge<Ctx>(cb: (this: Ctx, edge: GraphEdge, idx: number) => void, context?: Ctx): void;
4710 /**
4711 * Breadth first traverse
4712 * Return true to stop traversing
4713 */
4714 breadthFirstTraverse<Ctx>(cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void, startNode: GraphNode | string, direction: 'none' | 'in' | 'out', context?: Ctx): void;
4715 update(): void;
4716 /**
4717 * @return {module:echarts/data/Graph}
4718 */
4719 clone(): Graph;
4720}
4721interface GraphDataProxyMixin {
4722 getValue(dimension?: DimensionLoose): ParsedValue;
4723 setVisual(key: string | Dictionary<any>, value?: any): void;
4724 getVisual(key: string): any;
4725 setLayout(layout: any, merge?: boolean): void;
4726 getLayout(): any;
4727 getGraphicEl(): Element;
4728 getRawIndex(): number;
4729}
4730declare class GraphEdge {
4731 /**
4732 * The first node. If directed graph, it represents the source node.
4733 */
4734 node1: GraphNode;
4735 /**
4736 * The second node. If directed graph, it represents the target node.
4737 */
4738 node2: GraphNode;
4739 dataIndex: number;
4740 hostGraph: Graph;
4741 constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number);
4742 getModel<T = unknown>(): Model<T>;
4743 getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
4744 getAdjacentDataIndices(): {
4745 node: number[];
4746 edge: number[];
4747 };
4748}
4749interface GraphEdge extends GraphDataProxyMixin {
4750}
4751declare class GraphNode {
4752 id: string;
4753 inEdges: GraphEdge[];
4754 outEdges: GraphEdge[];
4755 edges: GraphEdge[];
4756 hostGraph: Graph;
4757 dataIndex: number;
4758 __visited: boolean;
4759 constructor(id?: string, dataIndex?: number);
4760 /**
4761 * @return {number}
4762 */
4763 degree(): number;
4764 /**
4765 * @return {number}
4766 */
4767 inDegree(): number;
4768 /**
4769 * @return {number}
4770 */
4771 outDegree(): number;
4772 getModel<T = unknown>(): Model<T>;
4773 getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
4774 getAdjacentDataIndices(): {
4775 node: number[];
4776 edge: number[];
4777 };
4778}
4779interface GraphNode extends GraphDataProxyMixin {
4780}
4781
4782declare type TreeTraverseOrder = 'preorder' | 'postorder';
4783declare type TreeTraverseCallback<Ctx> = (this: Ctx, node: TreeNode) => boolean | void;
4784declare type TreeTraverseOption = {
4785 order?: TreeTraverseOrder;
4786 attr?: 'children' | 'viewChildren';
4787};
4788interface TreeNodeOption extends Pick<OptionDataItemObject<OptionDataValue>, 'name' | 'value'> {
4789 children?: TreeNodeOption[];
4790}
4791declare class TreeNode {
4792 name: string;
4793 depth: number;
4794 height: number;
4795 parentNode: TreeNode;
4796 /**
4797 * Reference to list item.
4798 * Do not persistent dataIndex outside,
4799 * besause it may be changed by list.
4800 * If dataIndex -1,
4801 * this node is logical deleted (filtered) in list.
4802 */
4803 dataIndex: number;
4804 children: TreeNode[];
4805 viewChildren: TreeNode[];
4806 isExpand: boolean;
4807 readonly hostTree: Tree<Model>;
4808 constructor(name: string, hostTree: Tree<Model>);
4809 /**
4810 * The node is removed.
4811 */
4812 isRemoved(): boolean;
4813 /**
4814 * Travel this subtree (include this node).
4815 * Usage:
4816 * node.eachNode(function () { ... }); // preorder
4817 * node.eachNode('preorder', function () { ... }); // preorder
4818 * node.eachNode('postorder', function () { ... }); // postorder
4819 * node.eachNode(
4820 * {order: 'postorder', attr: 'viewChildren'},
4821 * function () { ... }
4822 * ); // postorder
4823 *
4824 * @param options If string, means order.
4825 * @param options.order 'preorder' or 'postorder'
4826 * @param options.attr 'children' or 'viewChildren'
4827 * @param cb If in preorder and return false,
4828 * its subtree will not be visited.
4829 */
4830 eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4831 eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4832 eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4833 /**
4834 * Update depth and height of this subtree.
4835 */
4836 updateDepthAndHeight(depth: number): void;
4837 getNodeById(id: string): TreeNode;
4838 contains(node: TreeNode): boolean;
4839 /**
4840 * @param includeSelf Default false.
4841 * @return order: [root, child, grandchild, ...]
4842 */
4843 getAncestors(includeSelf?: boolean): TreeNode[];
4844 getAncestorsIndices(): number[];
4845 getDescendantIndices(): number[];
4846 getValue(dimension?: DimensionLoose): ParsedValue;
4847 setLayout(layout: any, merge?: boolean): void;
4848 /**
4849 * @return {Object} layout
4850 */
4851 getLayout(): any;
4852 getModel<T = unknown>(): Model<T>;
4853 getLevelModel(): Model;
4854 /**
4855 * @example
4856 * setItemVisual('color', color);
4857 * setItemVisual({
4858 * 'color': color
4859 * });
4860 */
4861 setVisual(key: string, value: any): void;
4862 setVisual(obj: Dictionary<any>): void;
4863 /**
4864 * Get item visual
4865 * FIXME: make return type better
4866 */
4867 getVisual(key: string): unknown;
4868 getRawIndex(): number;
4869 getId(): string;
4870 /**
4871 * index in parent's children
4872 */
4873 getChildIndex(): number;
4874 /**
4875 * if this is an ancestor of another node
4876 *
4877 * @param node another node
4878 * @return if is ancestor
4879 */
4880 isAncestorOf(node: TreeNode): boolean;
4881 /**
4882 * if this is an descendant of another node
4883 *
4884 * @param node another node
4885 * @return if is descendant
4886 */
4887 isDescendantOf(node: TreeNode): boolean;
4888}
4889declare class Tree<HostModel extends Model = Model, LevelOption = any> {
4890 type: 'tree';
4891 root: TreeNode;
4892 data: SeriesData;
4893 hostModel: HostModel;
4894 levelModels: Model<LevelOption>[];
4895 private _nodes;
4896 constructor(hostModel: HostModel);
4897 /**
4898 * Travel this subtree (include this node).
4899 * Usage:
4900 * node.eachNode(function () { ... }); // preorder
4901 * node.eachNode('preorder', function () { ... }); // preorder
4902 * node.eachNode('postorder', function () { ... }); // postorder
4903 * node.eachNode(
4904 * {order: 'postorder', attr: 'viewChildren'},
4905 * function () { ... }
4906 * ); // postorder
4907 *
4908 * @param options If string, means order.
4909 * @param options.order 'preorder' or 'postorder'
4910 * @param options.attr 'children' or 'viewChildren'
4911 * @param cb
4912 * @param context
4913 */
4914 eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4915 eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4916 eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
4917 getNodeByDataIndex(dataIndex: number): TreeNode;
4918 getNodeById(name: string): TreeNode;
4919 /**
4920 * Update item available by list,
4921 * when list has been performed options like 'filterSelf' or 'map'.
4922 */
4923 update(): void;
4924 /**
4925 * Clear all layouts
4926 */
4927 clearLayouts(): void;
4928 /**
4929 * data node format:
4930 * {
4931 * name: ...
4932 * value: ...
4933 * children: [
4934 * {
4935 * name: ...
4936 * value: ...
4937 * children: ...
4938 * },
4939 * ...
4940 * ]
4941 * }
4942 */
4943 static createTree<T extends TreeNodeOption, HostModel extends Model>(dataRoot: T, hostModel: HostModel, beforeLink?: (data: SeriesData) => void): Tree<HostModel, any>;
4944}
4945
4946declare type VisualOptionBase = {
4947 [key in BuiltinVisualProperty]?: any;
4948};
4949declare type LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string;
4950interface VisualMapOption<T extends VisualOptionBase = VisualOptionBase> extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
4951 mainType?: 'visualMap';
4952 show?: boolean;
4953 align?: string;
4954 realtime?: boolean;
4955 /**
4956 * 'all' or null/undefined: all series.
4957 * A number or an array of number: the specified series.
4958 * set min: 0, max: 200, only for campatible with ec2.
4959 * In fact min max should not have default value.
4960 */
4961 seriesIndex?: 'all' | number[] | number;
4962 /**
4963 * min value, must specified if pieces is not specified.
4964 */
4965 min?: number;
4966 /**
4967 * max value, must specified if pieces is not specified.
4968 */
4969 max?: number;
4970 /**
4971 * Dimension to be encoded
4972 */
4973 dimension?: number;
4974 /**
4975 * Visual configuration for the data in selection
4976 */
4977 inRange?: T;
4978 /**
4979 * Visual configuration for the out of selection
4980 */
4981 outOfRange?: T;
4982 controller?: {
4983 inRange?: T;
4984 outOfRange?: T;
4985 };
4986 target?: {
4987 inRange?: T;
4988 outOfRange?: T;
4989 };
4990 /**
4991 * Width of the display item
4992 */
4993 itemWidth?: number;
4994 /**
4995 * Height of the display item
4996 */
4997 itemHeight?: number;
4998 inverse?: boolean;
4999 orient?: 'horizontal' | 'vertical';
5000 backgroundColor?: ZRColor;
5001 contentColor?: ZRColor;
5002 inactiveColor?: ZRColor;
5003 /**
5004 * Padding of the component. Can be an array similar to CSS
5005 */
5006 padding?: number[] | number;
5007 /**
5008 * Gap between text and item
5009 */
5010 textGap?: number;
5011 precision?: number;
5012 /**
5013 * @deprecated
5014 * Option from version 2
5015 */
5016 color?: ColorString[];
5017 formatter?: string | LabelFormatter;
5018 /**
5019 * Text on the both end. Such as ['High', 'Low']
5020 */
5021 text?: string[];
5022 textStyle?: LabelOption;
5023 categories?: unknown;
5024}
5025interface VisualMeta {
5026 stops: {
5027 value: number;
5028 color: ColorString;
5029 }[];
5030 outerColors: ColorString[];
5031 dimension?: DimensionIndex;
5032}
5033
5034declare type ItrParamDims = DimensionLoose | Array<DimensionLoose>;
5035declare type CtxOrList<Ctx> = unknown extends Ctx ? SeriesData : Ctx;
5036declare type EachCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => void;
5037declare type EachCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => void;
5038declare type EachCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => void;
5039declare type EachCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => void;
5040declare type FilterCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => boolean;
5041declare type FilterCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => boolean;
5042declare type FilterCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => boolean;
5043declare type FilterCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => boolean;
5044declare type MapArrayCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => any;
5045declare type MapArrayCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => any;
5046declare type MapArrayCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => any;
5047declare type MapArrayCb<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => any;
5048declare type MapCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
5049declare type MapCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
5050declare type SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine;
5051declare type SeriesDimensionLoose = DimensionLoose;
5052declare type SeriesDimensionName = DimensionName;
5053interface DefaultDataVisual {
5054 style: PathStyleProps;
5055 drawType: 'fill' | 'stroke';
5056 symbol?: string;
5057 symbolSize?: number | number[];
5058 symbolRotate?: number;
5059 symbolKeepAspect?: boolean;
5060 symbolOffset?: string | number | (string | number)[];
5061 liftZ?: number;
5062 legendIcon?: string;
5063 legendLineStyle?: LineStyleProps;
5064 visualMeta?: VisualMeta[];
5065 colorFromPalette?: boolean;
5066 decal?: DecalObject;
5067}
5068interface DataCalculationInfo<SERIES_MODEL> {
5069 stackedDimension: DimensionName;
5070 stackedByDimension: DimensionName;
5071 isStackedByIndex: boolean;
5072 stackedOverDimension: DimensionName;
5073 stackResultDimension: DimensionName;
5074 stackedOnSeries?: SERIES_MODEL;
5075}
5076declare class SeriesData<HostModel extends Model = Model, Visual extends DefaultDataVisual = DefaultDataVisual> {
5077 readonly type = "list";
5078 /**
5079 * Name of dimensions list of SeriesData.
5080 *
5081 * @caution Carefully use the index of this array.
5082 * Becuase when DataStore is an extra high dimension(>30) dataset. We will only pick
5083 * the used dimensions from DataStore to avoid performance issue.
5084 */
5085 readonly dimensions: SeriesDimensionName[];
5086 private _dimInfos;
5087 private _dimOmitted;
5088 private _schema?;
5089 /**
5090 * @pending
5091 * Actually we do not really need to convert dimensionIndex to dimensionName
5092 * and do not need `_dimIdxToName` if we do everything internally based on dimension
5093 * index rather than dimension name.
5094 */
5095 private _dimIdxToName?;
5096 readonly hostModel: HostModel;
5097 /**
5098 * @readonly
5099 */
5100 dataType: SeriesDataType;
5101 /**
5102 * @readonly
5103 * Host graph if List is used to store graph nodes / edges.
5104 */
5105 graph?: Graph;
5106 /**
5107 * @readonly
5108 * Host tree if List is used to store tree ndoes.
5109 */
5110 tree?: Tree;
5111 private _store;
5112 private _nameList;
5113 private _idList;
5114 private _visual;
5115 private _layout;
5116 private _itemVisuals;
5117 private _itemLayouts;
5118 private _graphicEls;
5119 private _approximateExtent;
5120 private _dimSummary;
5121 private _invertedIndicesMap;
5122 private _calculationInfo;
5123 userOutput: DimensionSummary['userOutput'];
5124 hasItemOption: boolean;
5125 private _nameRepeatCount;
5126 private _nameDimIdx;
5127 private _idDimIdx;
5128 private __wrappedMethods;
5129 TRANSFERABLE_METHODS: readonly ["cloneShallow", "downSample", "lttbDownSample", "map"];
5130 CHANGABLE_METHODS: readonly ["filterSelf", "selectRange"];
5131 DOWNSAMPLE_METHODS: readonly ["downSample", "lttbDownSample"];
5132 /**
5133 * @param dimensionsInput.dimensions
5134 * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
5135 * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
5136 */
5137 constructor(dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[], hostModel: HostModel);
5138 /**
5139 *
5140 * Get concrete dimension name by dimension name or dimension index.
5141 * If input a dimension name, do not validate whether the dimension name exits.
5142 *
5143 * @caution
5144 * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
5145 * Because only those dimensions will have auto-generated dimension names if not
5146 * have a user-specified name, and other dimensions will get a return of null/undefined.
5147 *
5148 * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples:
5149 * ```js
5150 * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
5151 * ```
5152 *
5153 * @return Concrete dim name.
5154 */
5155 getDimension(dim: SeriesDimensionLoose): DimensionName;
5156 /**
5157 * Get dimension index in data store. Return -1 if not found.
5158 * Can be used to index value from getRawValue.
5159 */
5160 getDimensionIndex(dim: DimensionLoose): DimensionIndex;
5161 /**
5162 * The meanings of the input parameter `dim`:
5163 *
5164 * + If dim is a number (e.g., `1`), it means the index of the dimension.
5165 * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
5166 * + If dim is a number-like string (e.g., `"1"`):
5167 * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
5168 * it means that concrete name.
5169 * + If not, it will be converted to a number, which means the index of the dimension.
5170 * (why? because of the backward compatbility. We have been tolerating number-like string in
5171 * dimension setting, although now it seems that it is not a good idea.)
5172 * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
5173 * if no dimension name is defined as `"1"`.
5174 * + If dim is a not-number-like string, it means the concrete dim name.
5175 * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
5176 * or customized in `dimensions` property of option like `"age"`.
5177 *
5178 * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
5179 */
5180 private _recognizeDimIndex;
5181 private _getStoreDimIndex;
5182 /**
5183 * Get type and calculation info of particular dimension
5184 * @param dim
5185 * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
5186 * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
5187 */
5188 getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine;
5189 /**
5190 * If `dimName` if from outside of `SeriesData`,
5191 * use this method other than visit `this._dimInfos` directly.
5192 */
5193 private _getDimInfo;
5194 private _initGetDimensionInfo;
5195 /**
5196 * concrete dimension name list on coord.
5197 */
5198 getDimensionsOnCoord(): SeriesDimensionName[];
5199 /**
5200 * @param coordDim
5201 * @param idx A coordDim may map to more than one data dim.
5202 * If not specified, return the first dim not extra.
5203 * @return concrete data dim. If not found, return null/undefined
5204 */
5205 mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName;
5206 mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName;
5207 mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[];
5208 getStore(): DataStore;
5209 /**
5210 * Initialize from data
5211 * @param data source or data or data store.
5212 * @param nameList The name of a datum is used on data diff and
5213 * default label/tooltip.
5214 * A name can be specified in encode.itemName,
5215 * or dataItem.name (only for series option data),
5216 * or provided in nameList from outside.
5217 */
5218 initData(data: Source | OptionSourceData | DataStore | DataProvider, nameList?: string[], dimValueGetter?: DimValueGetter): void;
5219 /**
5220 * Caution: Can be only called on raw data (before `this._indices` created).
5221 */
5222 appendData(data: ArrayLike$1<any>): void;
5223 /**
5224 * Caution: Can be only called on raw data (before `this._indices` created).
5225 * This method does not modify `rawData` (`dataProvider`), but only
5226 * add values to store.
5227 *
5228 * The final count will be increased by `Math.max(values.length, names.length)`.
5229 *
5230 * @param values That is the SourceType: 'arrayRows', like
5231 * [
5232 * [12, 33, 44],
5233 * [NaN, 43, 1],
5234 * ['-', 'asdf', 0]
5235 * ]
5236 * Each item is exaclty cooresponding to a dimension.
5237 */
5238 appendValues(values: any[][], names?: string[]): void;
5239 private _updateOrdinalMeta;
5240 private _shouldMakeIdFromName;
5241 private _doInit;
5242 /**
5243 * PENDING: In fact currently this function is only used to short-circuit
5244 * the calling of `scale.unionExtentFromData` when data have been filtered by modules
5245 * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
5246 * an axis, but if a "axis related data filter module" is used, the extent of the axis have
5247 * been fixed and no need to calling `scale.unionExtentFromData` actually.
5248 * But if we add "custom data filter" in future, which is not "axis related", this method may
5249 * be still needed.
5250 *
5251 * Optimize for the scenario that data is filtered by a given extent.
5252 * Consider that if data amount is more than hundreds of thousand,
5253 * extent calculation will cost more than 10ms and the cache will
5254 * be erased because of the filtering.
5255 */
5256 getApproximateExtent(dim: SeriesDimensionLoose): [number, number];
5257 /**
5258 * Calculate extent on a filtered data might be time consuming.
5259 * Approximate extent is only used for: calculte extent of filtered data outside.
5260 */
5261 setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void;
5262 getCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY): DataCalculationInfo<HostModel>[CALC_INFO_KEY];
5263 /**
5264 * @param key or k-v object
5265 */
5266 setCalculationInfo(key: DataCalculationInfo<HostModel>): void;
5267 setCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY, value: DataCalculationInfo<HostModel>[CALC_INFO_KEY]): void;
5268 /**
5269 * @return Never be null/undefined. `number` will be converted to string. Becuase:
5270 * In most cases, name is used in display, where returning a string is more convenient.
5271 * In other cases, name is used in query (see `indexOfName`), where we can keep the
5272 * rule that name `2` equals to name `'2'`.
5273 */
5274 getName(idx: number): string;
5275 private _getCategory;
5276 /**
5277 * @return Never null/undefined. `number` will be converted to string. Becuase:
5278 * In all cases having encountered at present, id is used in making diff comparison, which
5279 * are usually based on hash map. We can keep the rule that the internal id are always string
5280 * (treat `2` is the same as `'2'`) to make the related logic simple.
5281 */
5282 getId(idx: number): string;
5283 count(): number;
5284 /**
5285 * Get value. Return NaN if idx is out of range.
5286 *
5287 * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
5288 */
5289 get(dim: SeriesDimensionName, idx: number): ParsedValue;
5290 /**
5291 * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
5292 */
5293 getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue;
5294 getIndices(): globalThis.ArrayLike<number>;
5295 getDataExtent(dim: DimensionLoose): [number, number];
5296 getSum(dim: DimensionLoose): number;
5297 getMedian(dim: DimensionLoose): number;
5298 /**
5299 * Get value for multi dimensions.
5300 * @param dimensions If ignored, using all dimensions.
5301 */
5302 getValues(idx: number): ParsedValue[];
5303 getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[];
5304 /**
5305 * If value is NaN. Inlcuding '-'
5306 * Only check the coord dimensions.
5307 */
5308 hasValue(idx: number): boolean;
5309 /**
5310 * Retreive the index with given name
5311 */
5312 indexOfName(name: string): number;
5313 getRawIndex(idx: number): number;
5314 indexOfRawIndex(rawIndex: number): number;
5315 /**
5316 * Only support the dimension which inverted index created.
5317 * Do not support other cases until required.
5318 * @param dim concrete dim
5319 * @param value ordinal index
5320 * @return rawIndex
5321 */
5322 rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number;
5323 /**
5324 * Retreive the index of nearest value
5325 * @param dim
5326 * @param value
5327 * @param [maxDistance=Infinity]
5328 * @return If and only if multiple indices has
5329 * the same value, they are put to the result.
5330 */
5331 indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[];
5332 /**
5333 * Data iteration
5334 * @param ctx default this
5335 * @example
5336 * list.each('x', function (x, idx) {});
5337 * list.each(['x', 'y'], function (x, y, idx) {});
5338 * list.each(function (idx) {})
5339 */
5340 each<Ctx>(cb: EachCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
5341 each<Ctx>(dims: DimensionLoose, cb: EachCb1<Ctx>, ctx?: Ctx): void;
5342 each<Ctx>(dims: [DimensionLoose], cb: EachCb1<Ctx>, ctx?: Ctx): void;
5343 each<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: EachCb2<Ctx>, ctx?: Ctx): void;
5344 each<Ctx>(dims: ItrParamDims, cb: EachCb$1<Ctx>, ctx?: Ctx): void;
5345 /**
5346 * Data filter
5347 */
5348 filterSelf<Ctx>(cb: FilterCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): this;
5349 filterSelf<Ctx>(dims: DimensionLoose, cb: FilterCb1<Ctx>, ctx?: Ctx): this;
5350 filterSelf<Ctx>(dims: [DimensionLoose], cb: FilterCb1<Ctx>, ctx?: Ctx): this;
5351 filterSelf<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2<Ctx>, ctx?: Ctx): this;
5352 filterSelf<Ctx>(dims: ItrParamDims, cb: FilterCb$1<Ctx>, ctx?: Ctx): this;
5353 /**
5354 * Select data in range. (For optimization of filter)
5355 * (Manually inline code, support 5 million data filtering in data zoom.)
5356 */
5357 selectRange(range: Record<string, [number, number]>): SeriesData;
5358 /**
5359 * Data mapping to a plain array
5360 */
5361 mapArray<Ctx, Cb extends MapArrayCb0<Ctx>>(cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
5362 mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: DimensionLoose, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
5363 mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
5364 mapArray<Ctx, Cb extends MapArrayCb2<Ctx>>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
5365 mapArray<Ctx, Cb extends MapArrayCb<Ctx>>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
5366 /**
5367 * Data mapping to a new List with given dimensions
5368 */
5369 map<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
5370 map<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
5371 map<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
5372 /**
5373 * !!Danger: used on stack dimension only.
5374 */
5375 modify<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
5376 modify<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
5377 modify<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
5378 /**
5379 * Large data down sampling on given dimension
5380 * @param sampleIndex Sample index for name and id
5381 */
5382 downSample(dimension: DimensionLoose, rate: number, sampleValue: (frameValues: ArrayLike$1<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike$1<ParsedValue>, value: ParsedValueNumeric) => number): SeriesData<HostModel>;
5383 /**
5384 * Large data down sampling using largest-triangle-three-buckets
5385 * @param {string} valueDimension
5386 * @param {number} targetCount
5387 */
5388 lttbDownSample(valueDimension: DimensionLoose, rate: number): SeriesData<HostModel>;
5389 getRawDataItem(idx: number): OptionDataItem;
5390 /**
5391 * Get model of one data item.
5392 */
5393 getItemModel<ItemOpts extends unknown = unknown>(idx: number): Model<ItemOpts>;
5394 /**
5395 * Create a data differ
5396 */
5397 diff(otherList: SeriesData): DataDiffer;
5398 /**
5399 * Get visual property.
5400 */
5401 getVisual<K extends keyof Visual>(key: K): Visual[K];
5402 /**
5403 * Set visual property
5404 *
5405 * @example
5406 * setVisual('color', color);
5407 * setVisual({
5408 * 'color': color
5409 * });
5410 */
5411 setVisual<K extends keyof Visual>(key: K, val: Visual[K]): void;
5412 setVisual(kvObj: Partial<Visual>): void;
5413 /**
5414 * Get visual property of single data item
5415 */
5416 getItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
5417 /**
5418 * If exists visual property of single data item
5419 */
5420 hasItemVisual(): boolean;
5421 /**
5422 * Make sure itemVisual property is unique
5423 */
5424 ensureUniqueItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
5425 /**
5426 * Set visual property of single data item
5427 *
5428 * @param {number} idx
5429 * @param {string|Object} key
5430 * @param {*} [value]
5431 *
5432 * @example
5433 * setItemVisual(0, 'color', color);
5434 * setItemVisual(0, {
5435 * 'color': color
5436 * });
5437 */
5438 setItemVisual<K extends keyof Visual>(idx: number, key: K, value: Visual[K]): void;
5439 setItemVisual(idx: number, kvObject: Partial<Visual>): void;
5440 /**
5441 * Clear itemVisuals and list visual.
5442 */
5443 clearAllVisual(): void;
5444 /**
5445 * Set layout property.
5446 */
5447 setLayout(key: string, val: any): void;
5448 setLayout(kvObj: Dictionary<any>): void;
5449 /**
5450 * Get layout property.
5451 */
5452 getLayout(key: string): any;
5453 /**
5454 * Get layout of single data item
5455 */
5456 getItemLayout(idx: number): any;
5457 /**
5458 * Set layout of single data item
5459 */
5460 setItemLayout<M = false>(idx: number, layout: (M extends true ? Dictionary<any> : any), merge?: M): void;
5461 /**
5462 * Clear all layout of single data item
5463 */
5464 clearItemLayouts(): void;
5465 /**
5466 * Set graphic element relative to data. It can be set as null
5467 */
5468 setItemGraphicEl(idx: number, el: Element): void;
5469 getItemGraphicEl(idx: number): Element;
5470 eachItemGraphicEl<Ctx = unknown>(cb: (this: Ctx, el: Element, idx: number) => void, context?: Ctx): void;
5471 /**
5472 * Shallow clone a new list except visual and layout properties, and graph elements.
5473 * New list only change the indices.
5474 */
5475 cloneShallow(list?: SeriesData<HostModel>): SeriesData<HostModel>;
5476 /**
5477 * Wrap some method to add more feature
5478 */
5479 wrapMethod(methodName: FunctionPropertyNames<SeriesData>, injectFunction: (...args: any) => any): void;
5480 private static internalField;
5481}
5482interface SeriesData {
5483 getLinkedData(dataType?: SeriesDataType): SeriesData;
5484 getLinkedDataAll(): {
5485 data: SeriesData;
5486 type?: SeriesDataType;
5487 }[];
5488}
5489
5490/**
5491 * If string, e.g., 'geo', means {geoIndex: 0}.
5492 * If Object, could contain some of these properties below:
5493 * {
5494 * seriesIndex, seriesId, seriesName,
5495 * geoIndex, geoId, geoName,
5496 * bmapIndex, bmapId, bmapName,
5497 * xAxisIndex, xAxisId, xAxisName,
5498 * yAxisIndex, yAxisId, yAxisName,
5499 * gridIndex, gridId, gridName,
5500 * ... (can be extended)
5501 * }
5502 * Each properties can be number|string|Array.<number>|Array.<string>
5503 * For example, a finder could be
5504 * {
5505 * seriesIndex: 3,
5506 * geoId: ['aa', 'cc'],
5507 * gridName: ['xx', 'rr']
5508 * }
5509 * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)
5510 * If nothing or null/undefined specified, return nothing.
5511 * If both `abcIndex`, `abcId`, `abcName` specified, only one work.
5512 * The priority is: index > id > name, the same with `ecModel.queryComponents`.
5513 */
5514declare type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false;
5515declare type ModelFinderIdQuery = OptionId | OptionId[];
5516declare type ModelFinderNameQuery = OptionId | OptionId[];
5517declare type ModelFinder = string | ModelFinderObject;
5518declare type ModelFinderObject = {
5519 seriesIndex?: ModelFinderIndexQuery;
5520 seriesId?: ModelFinderIdQuery;
5521 seriesName?: ModelFinderNameQuery;
5522 geoIndex?: ModelFinderIndexQuery;
5523 geoId?: ModelFinderIdQuery;
5524 geoName?: ModelFinderNameQuery;
5525 bmapIndex?: ModelFinderIndexQuery;
5526 bmapId?: ModelFinderIdQuery;
5527 bmapName?: ModelFinderNameQuery;
5528 xAxisIndex?: ModelFinderIndexQuery;
5529 xAxisId?: ModelFinderIdQuery;
5530 xAxisName?: ModelFinderNameQuery;
5531 yAxisIndex?: ModelFinderIndexQuery;
5532 yAxisId?: ModelFinderIdQuery;
5533 yAxisName?: ModelFinderNameQuery;
5534 gridIndex?: ModelFinderIndexQuery;
5535 gridId?: ModelFinderIdQuery;
5536 gridName?: ModelFinderNameQuery;
5537 dataIndex?: number;
5538 dataIndexInside?: number;
5539};
5540/**
5541 * {
5542 * seriesModels: [seriesModel1, seriesModel2],
5543 * seriesModel: seriesModel1, // The first model
5544 * geoModels: [geoModel1, geoModel2],
5545 * geoModel: geoModel1, // The first model
5546 * ...
5547 * }
5548 */
5549declare type ParsedModelFinder = {
5550 [key: string]: ComponentModel | ComponentModel[] | undefined;
5551};
5552declare type QueryReferringOpt = {
5553 useDefault?: boolean;
5554 enableAll?: boolean;
5555 enableNone?: boolean;
5556};
5557
5558declare class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Model<Opt> {
5559 /**
5560 * @readonly
5561 */
5562 type: ComponentFullType;
5563 /**
5564 * @readonly
5565 */
5566 id: string;
5567 /**
5568 * Because simplified concept is probably better, series.name (or component.name)
5569 * has been having too many resposibilities:
5570 * (1) Generating id (which requires name in option should not be modified).
5571 * (2) As an index to mapping series when merging option or calling API (a name
5572 * can refer to more then one components, which is convinient is some case).
5573 * (3) Display.
5574 * @readOnly But injected
5575 */
5576 name: string;
5577 /**
5578 * @readOnly
5579 */
5580 mainType: ComponentMainType;
5581 /**
5582 * @readOnly
5583 */
5584 subType: ComponentSubType;
5585 /**
5586 * @readOnly
5587 */
5588 componentIndex: number;
5589 /**
5590 * @readOnly
5591 */
5592 protected defaultOption: ComponentOption;
5593 /**
5594 * @readOnly
5595 */
5596 ecModel: GlobalModel;
5597 /**
5598 * @readOnly
5599 */
5600 static dependencies: string[];
5601 readonly uid: string;
5602 /**
5603 * Support merge layout params.
5604 * Only support 'box' now (left/right/top/bottom/width/height).
5605 */
5606 static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type'];
5607 /**
5608 * Prevent from auto set z, zlevel, z2 by the framework.
5609 */
5610 preventAutoZ: boolean;
5611 __viewId: string;
5612 __requireNewView: boolean;
5613 static protoInitialize: void;
5614 constructor(option: Opt, parentModel: Model, ecModel: GlobalModel);
5615 init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
5616 mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
5617 mergeOption(option: Opt, ecModel: GlobalModel): void;
5618 /**
5619 * Called immediately after `init` or `mergeOption` of this instance called.
5620 */
5621 optionUpdated(newCptOption: Opt, isInit: boolean): void;
5622 /**
5623 * [How to declare defaultOption]:
5624 *
5625 * (A) If using class declaration in typescript (since echarts 5):
5626 * ```ts
5627 * import {ComponentOption} from '../model/option';
5628 * export interface XxxOption extends ComponentOption {
5629 * aaa: number
5630 * }
5631 * export class XxxModel extends Component {
5632 * static type = 'xxx';
5633 * static defaultOption: XxxOption = {
5634 * aaa: 123
5635 * }
5636 * }
5637 * Component.registerClass(XxxModel);
5638 * ```
5639 * ```ts
5640 * import {inheritDefaultOption} from '../util/component';
5641 * import {XxxModel, XxxOption} from './XxxModel';
5642 * export interface XxxSubOption extends XxxOption {
5643 * bbb: number
5644 * }
5645 * class XxxSubModel extends XxxModel {
5646 * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
5647 * bbb: 456
5648 * })
5649 * fn() {
5650 * let opt = this.getDefaultOption();
5651 * // opt is {aaa: 123, bbb: 456}
5652 * }
5653 * }
5654 * ```
5655 *
5656 * (B) If using class extend (previous approach in echarts 3 & 4):
5657 * ```js
5658 * let XxxComponent = Component.extend({
5659 * defaultOption: {
5660 * xx: 123
5661 * }
5662 * })
5663 * ```
5664 * ```js
5665 * let XxxSubComponent = XxxComponent.extend({
5666 * defaultOption: {
5667 * yy: 456
5668 * },
5669 * fn: function () {
5670 * let opt = this.getDefaultOption();
5671 * // opt is {xx: 123, yy: 456}
5672 * }
5673 * })
5674 * ```
5675 */
5676 getDefaultOption(): Opt;
5677 /**
5678 * Notice: always force to input param `useDefault` in case that forget to consider it.
5679 * The same behavior as `modelUtil.parseFinder`.
5680 *
5681 * @param useDefault In many cases like series refer axis and axis refer grid,
5682 * If axis index / axis id not specified, use the first target as default.
5683 * In other cases like dataZoom refer axis, if not specified, measn no refer.
5684 */
5685 getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {
5686 models: ComponentModel[];
5687 specified: boolean;
5688 };
5689 getBoxLayoutParams(): {
5690 left: string | number;
5691 top: string | number;
5692 right: string | number;
5693 bottom: string | number;
5694 width: string | number;
5695 height: string | number;
5696 };
5697 static registerClass: ClassManager['registerClass'];
5698 static hasClass: ClassManager['hasClass'];
5699 static registerSubTypeDefaulter: SubTypeDefaulterManager['registerSubTypeDefaulter'];
5700}
5701
5702/**
5703 * ECharts option manager
5704 */
5705
5706/**
5707 * TERM EXPLANATIONS:
5708 * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
5709 */
5710declare class OptionManager {
5711 private _api;
5712 private _timelineOptions;
5713 private _mediaList;
5714 private _mediaDefault;
5715 /**
5716 * -1, means default.
5717 * empty means no media.
5718 */
5719 private _currentMediaIndices;
5720 private _optionBackup;
5721 private _newBaseOption;
5722 constructor(api: ExtensionAPI);
5723 setOption(rawOption: ECBasicOption, optionPreprocessorFuncs: OptionPreprocessor[], opt: InnerSetOptionOpts): void;
5724 mountOption(isRecreate: boolean): ECUnitOption;
5725 getTimelineOption(ecModel: GlobalModel): ECUnitOption;
5726 getMediaOption(ecModel: GlobalModel): ECUnitOption[];
5727}
5728
5729declare const _default: {
5730 time: {
5731 month: string[];
5732 monthAbbr: string[];
5733 dayOfWeek: string[];
5734 dayOfWeekAbbr: string[];
5735 };
5736 legend: {
5737 selector: {
5738 all: string;
5739 inverse: string;
5740 };
5741 };
5742 toolbox: {
5743 brush: {
5744 title: {
5745 rect: string;
5746 polygon: string;
5747 lineX: string;
5748 lineY: string;
5749 keep: string;
5750 clear: string;
5751 };
5752 };
5753 dataView: {
5754 title: string;
5755 lang: string[];
5756 };
5757 dataZoom: {
5758 title: {
5759 zoom: string;
5760 back: string;
5761 };
5762 };
5763 magicType: {
5764 title: {
5765 line: string;
5766 bar: string;
5767 stack: string;
5768 tiled: string;
5769 };
5770 };
5771 restore: {
5772 title: string;
5773 };
5774 saveAsImage: {
5775 title: string;
5776 lang: string[];
5777 };
5778 };
5779 series: {
5780 typeNames: {
5781 pie: string;
5782 bar: string;
5783 line: string;
5784 scatter: string;
5785 effectScatter: string;
5786 radar: string;
5787 tree: string;
5788 treemap: string;
5789 boxplot: string;
5790 candlestick: string;
5791 k: string;
5792 heatmap: string;
5793 map: string;
5794 parallel: string;
5795 lines: string;
5796 graph: string;
5797 sankey: string;
5798 funnel: string;
5799 gauge: string;
5800 pictorialBar: string;
5801 themeRiver: string;
5802 sunburst: string;
5803 };
5804 };
5805 aria: {
5806 general: {
5807 withTitle: string;
5808 withoutTitle: string;
5809 };
5810 series: {
5811 single: {
5812 prefix: string;
5813 withName: string;
5814 withoutName: string;
5815 };
5816 multiple: {
5817 prefix: string;
5818 withName: string;
5819 withoutName: string;
5820 separator: {
5821 middle: string;
5822 end: string;
5823 };
5824 };
5825 };
5826 data: {
5827 allData: string;
5828 partialData: string;
5829 withName: string;
5830 withoutName: string;
5831 separator: {
5832 middle: string;
5833 end: string;
5834 };
5835 };
5836 };
5837};
5838
5839declare type LocaleOption = typeof _default;
5840declare function registerLocale(locale: string, localeObj: LocaleOption): void;
5841
5842/**
5843 * Caution: If the mechanism should be changed some day, these cases
5844 * should be considered:
5845 *
5846 * (1) In `merge option` mode, if using the same option to call `setOption`
5847 * many times, the result should be the same (try our best to ensure that).
5848 * (2) In `merge option` mode, if a component has no id/name specified, it
5849 * will be merged by index, and the result sequence of the components is
5850 * consistent to the original sequence.
5851 * (3) In `replaceMerge` mode, keep the result sequence of the components is
5852 * consistent to the original sequence, even though there might result in "hole".
5853 * (4) `reset` feature (in toolbox). Find detailed info in comments about
5854 * `mergeOption` in module:echarts/model/OptionManager.
5855 */
5856
5857interface GlobalModelSetOptionOpts {
5858 replaceMerge: ComponentMainType | ComponentMainType[];
5859}
5860interface InnerSetOptionOpts {
5861 replaceMergeMainTypeMap: HashMap<boolean, string>;
5862}
5863/**
5864 * @param condition.mainType Mandatory.
5865 * @param condition.subType Optional.
5866 * @param condition.query like {xxxIndex, xxxId, xxxName},
5867 * where xxx is mainType.
5868 * If query attribute is null/undefined or has no index/id/name,
5869 * do not filtering by query conditions, which is convenient for
5870 * no-payload situations or when target of action is global.
5871 * @param condition.filter parameter: component, return boolean.
5872 */
5873interface QueryConditionKindA {
5874 mainType: ComponentMainType;
5875 subType?: ComponentSubType;
5876 query?: {
5877 [k: string]: number | number[] | string | string[];
5878 };
5879 filter?: (cmpt: ComponentModel) => boolean;
5880}
5881/**
5882 * If none of index and id and name used, return all components with mainType.
5883 * @param condition.mainType
5884 * @param condition.subType If ignore, only query by mainType
5885 * @param condition.index Either input index or id or name.
5886 * @param condition.id Either input index or id or name.
5887 * @param condition.name Either input index or id or name.
5888 */
5889interface QueryConditionKindB {
5890 mainType: ComponentMainType;
5891 subType?: ComponentSubType;
5892 index?: number | number[];
5893 id?: OptionId | OptionId[];
5894 name?: OptionName | OptionName[];
5895}
5896interface EachComponentAllCallback {
5897 (mainType: string, model: ComponentModel, componentIndex: number): void;
5898}
5899interface EachComponentInMainTypeCallback {
5900 (model: ComponentModel, componentIndex: number): void;
5901}
5902declare class GlobalModel extends Model<ECUnitOption> {
5903 option: ECUnitOption;
5904 private _theme;
5905 private _locale;
5906 private _optionManager;
5907 private _componentsMap;
5908 /**
5909 * `_componentsMap` might have "hole" becuase of remove.
5910 * So save components count for a certain mainType here.
5911 */
5912 private _componentsCount;
5913 /**
5914 * Mapping between filtered series list and raw series list.
5915 * key: filtered series indices, value: raw series indices.
5916 * Items of `_seriesIndices` never be null/empty/-1.
5917 * If series has been removed by `replaceMerge`, those series
5918 * also won't be in `_seriesIndices`, just like be filtered.
5919 */
5920 private _seriesIndices;
5921 /**
5922 * Key: seriesIndex.
5923 * Keep consistent with `_seriesIndices`.
5924 */
5925 private _seriesIndicesMap;
5926 /**
5927 * Model for store update payload
5928 */
5929 private _payload;
5930 scheduler: Scheduler;
5931 init(option: ECBasicOption, parentModel: Model, ecModel: GlobalModel, theme: object, locale: object, optionManager: OptionManager): void;
5932 setOption(option: ECBasicOption, opts: GlobalModelSetOptionOpts, optionPreprocessorFuncs: OptionPreprocessor[]): void;
5933 /**
5934 * @param type null/undefined: reset all.
5935 * 'recreate': force recreate all.
5936 * 'timeline': only reset timeline option
5937 * 'media': only reset media query option
5938 * @return Whether option changed.
5939 */
5940 resetOption(type: 'recreate' | 'timeline' | 'media', opt?: Pick<GlobalModelSetOptionOpts, 'replaceMerge'>): boolean;
5941 private _resetOption;
5942 mergeOption(option: ECUnitOption): void;
5943 private _mergeOption;
5944 /**
5945 * Get option for output (cloned option and inner info removed)
5946 */
5947 getOption(): ECUnitOption;
5948 getTheme(): Model;
5949 getLocaleModel(): Model<LocaleOption>;
5950 setUpdatePayload(payload: Payload): void;
5951 getUpdatePayload(): Payload;
5952 /**
5953 * @param idx If not specified, return the first one.
5954 */
5955 getComponent(mainType: ComponentMainType, idx?: number): ComponentModel;
5956 /**
5957 * @return Never be null/undefined.
5958 */
5959 queryComponents(condition: QueryConditionKindB): ComponentModel[];
5960 /**
5961 * The interface is different from queryComponents,
5962 * which is convenient for inner usage.
5963 *
5964 * @usage
5965 * let result = findComponents(
5966 * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
5967 * );
5968 * let result = findComponents(
5969 * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
5970 * );
5971 * let result = findComponents(
5972 * {mainType: 'series',
5973 * filter: function (model, index) {...}}
5974 * );
5975 * // result like [component0, componnet1, ...]
5976 */
5977 findComponents(condition: QueryConditionKindA): ComponentModel[];
5978 /**
5979 * Travel components (before filtered).
5980 *
5981 * @usage
5982 * eachComponent('legend', function (legendModel, index) {
5983 * ...
5984 * });
5985 * eachComponent(function (componentType, model, index) {
5986 * // componentType does not include subType
5987 * // (componentType is 'xxx' but not 'xxx.aa')
5988 * });
5989 * eachComponent(
5990 * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
5991 * function (model, index) {...}
5992 * );
5993 * eachComponent(
5994 * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
5995 * function (model, index) {...}
5996 * );
5997 */
5998 eachComponent<T>(cb: EachComponentAllCallback, context?: T): void;
5999 eachComponent<T>(mainType: string, cb: EachComponentInMainTypeCallback, context?: T): void;
6000 eachComponent<T>(mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T): void;
6001 /**
6002 * Get series list before filtered by name.
6003 */
6004 getSeriesByName(name: OptionName): SeriesModel[];
6005 /**
6006 * Get series list before filtered by index.
6007 */
6008 getSeriesByIndex(seriesIndex: number): SeriesModel;
6009 /**
6010 * Get series list before filtered by type.
6011 * FIXME: rename to getRawSeriesByType?
6012 */
6013 getSeriesByType(subType: ComponentSubType): SeriesModel[];
6014 /**
6015 * Get all series before filtered.
6016 */
6017 getSeries(): SeriesModel[];
6018 /**
6019 * Count series before filtered.
6020 */
6021 getSeriesCount(): number;
6022 /**
6023 * After filtering, series may be different
6024 * frome raw series.
6025 */
6026 eachSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
6027 /**
6028 * Iterate raw series before filtered.
6029 *
6030 * @param {Function} cb
6031 * @param {*} context
6032 */
6033 eachRawSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
6034 /**
6035 * After filtering, series may be different.
6036 * frome raw series.
6037 */
6038 eachSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
6039 /**
6040 * Iterate raw series before filtered of given type.
6041 */
6042 eachRawSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
6043 isSeriesFiltered(seriesModel: SeriesModel): boolean;
6044 getCurrentSeriesIndices(): number[];
6045 filterSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean, context?: T): void;
6046 restoreData(payload?: Payload): void;
6047 private static internalField;
6048}
6049interface GlobalModel extends PaletteMixin<ECUnitOption> {
6050}
6051
6052interface DataFormatMixin extends DataHost {
6053 ecModel: GlobalModel;
6054 mainType: ComponentMainType;
6055 subType: ComponentSubType;
6056 componentIndex: number;
6057 id: string;
6058 name: string;
6059 animatedValue: OptionDataValue[];
6060}
6061declare class DataFormatMixin {
6062 /**
6063 * Get params for formatter
6064 */
6065 getDataParams(dataIndex: number, dataType?: SeriesDataType): CallbackDataParams;
6066 /**
6067 * Format label
6068 * @param dataIndex
6069 * @param status 'normal' by default
6070 * @param dataType
6071 * @param labelDimIndex Only used in some chart that
6072 * use formatter in different dimensions, like radar.
6073 * @param formatter Formatter given outside.
6074 * @return return null/undefined if no formatter
6075 */
6076 getFormattedLabel(dataIndex: number, status?: DisplayState, dataType?: SeriesDataType, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: {
6077 interpolatedValue: InterpolatableValue;
6078 }): string;
6079 /**
6080 * Get raw value in option
6081 */
6082 getRawValue(idx: number, dataType?: SeriesDataType): unknown;
6083 /**
6084 * Should be implemented.
6085 * @param {number} dataIndex
6086 * @param {boolean} [multipleSeries=false]
6087 * @param {string} [dataType]
6088 */
6089 formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: string): TooltipFormatResult;
6090}
6091declare type TooltipFormatResult = string | TooltipMarkupBlockFragment;
6092
6093/**
6094 * [Notice]:
6095 * Consider custom bundle on demand, chart specified
6096 * or component specified types and constants should
6097 * not put here. Only common types and constants can
6098 * be put in this file.
6099 */
6100
6101declare type RendererType = 'canvas' | 'svg';
6102declare type LayoutOrient = 'vertical' | 'horizontal';
6103declare type HorizontalAlign = 'left' | 'center' | 'right';
6104declare type VerticalAlign = 'top' | 'middle' | 'bottom';
6105declare type ColorString = string;
6106declare type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject;
6107declare type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[];
6108declare type ZRFontStyle = 'normal' | 'italic' | 'oblique';
6109declare type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
6110declare type ZREasing = AnimationEasing;
6111declare type ZRTextAlign = TextAlign;
6112declare type ZRTextVerticalAlign = TextVerticalAlign;
6113declare type ZRRectLike = RectLike;
6114declare type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps;
6115declare type ZRElementEventName = ElementEventName | 'globalout';
6116declare type ComponentFullType = string;
6117declare type ComponentMainType = keyof ECUnitOption & string;
6118declare type ComponentSubType = Exclude<ComponentOption['type'], undefined>;
6119interface DataHost {
6120 getData(dataType?: SeriesDataType): SeriesData;
6121}
6122interface DataModel extends Model<unknown>, DataHost, DataFormatMixin {
6123}
6124interface PayloadItem {
6125 excludeSeriesId?: OptionId | OptionId[];
6126 animation?: PayloadAnimationPart;
6127 [other: string]: any;
6128}
6129interface Payload extends PayloadItem {
6130 type: string;
6131 escapeConnect?: boolean;
6132 batch?: PayloadItem[];
6133}
6134interface PayloadAnimationPart {
6135 duration?: number;
6136 easing?: AnimationEasing;
6137 delay?: number;
6138}
6139interface ViewRootGroup extends Group {
6140 __ecComponentInfo?: {
6141 mainType: string;
6142 index: number;
6143 };
6144}
6145interface ECElementEvent extends ECEventData, CallbackDataParams {
6146 type: ZRElementEventName;
6147 event?: ElementEvent;
6148}
6149/**
6150 * The echarts event type to user.
6151 * Also known as packedEvent.
6152 */
6153interface ECActionEvent extends ECEventData {
6154 type: string;
6155 componentType?: string;
6156 componentIndex?: number;
6157 seriesIndex?: number;
6158 escapeConnect?: boolean;
6159 batch?: ECEventData;
6160}
6161interface ECEventData {
6162 [key: string]: any;
6163}
6164interface EventQueryItem {
6165 [key: string]: any;
6166}
6167interface ActionInfo {
6168 type: string;
6169 event?: string;
6170 update?: string;
6171}
6172interface ActionHandler {
6173 (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData;
6174}
6175interface OptionPreprocessor {
6176 (option: ECUnitOption, isTheme: boolean): void;
6177}
6178interface PostUpdater {
6179 (ecModel: GlobalModel, api: ExtensionAPI): void;
6180}
6181interface StageHandlerReset {
6182 (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void;
6183}
6184interface StageHandlerOverallReset {
6185 (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void;
6186}
6187interface StageHandler {
6188 /**
6189 * Indicate that the task will be piped all series
6190 * (`performRawSeries` indicate whether includes filtered series).
6191 */
6192 createOnAllSeries?: boolean;
6193 /**
6194 * Indicate that the task will be only piped in the pipeline of this type of series.
6195 * (`performRawSeries` indicate whether includes filtered series).
6196 */
6197 seriesType?: string;
6198 /**
6199 * Indicate that the task will be only piped in the pipeline of the returned series.
6200 */
6201 getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap<SeriesModel>;
6202 /**
6203 * If `true`, filtered series will also be "performed".
6204 */
6205 performRawSeries?: boolean;
6206 /**
6207 * Called only when this task in a pipeline.
6208 */
6209 plan?: StageHandlerPlan;
6210 /**
6211 * If `overallReset` specified, an "overall task" will be created.
6212 * "overall task" does not belong to a certain pipeline.
6213 * They always be "performed" in certain phase (depends on when they declared).
6214 * They has "stub"s to connect with pipelines (one stub for one pipeline),
6215 * delivering info like "dirty" and "output end".
6216 */
6217 overallReset?: StageHandlerOverallReset;
6218 /**
6219 * Called only when this task in a pipeline, and "dirty".
6220 */
6221 reset?: StageHandlerReset;
6222}
6223interface StageHandlerInternal extends StageHandler {
6224 uid: string;
6225 visualType?: 'layout' | 'visual';
6226 __prio: number;
6227 __raw: StageHandler | StageHandlerOverallReset;
6228 isVisual?: boolean;
6229 isLayout?: boolean;
6230}
6231declare type StageHandlerProgressParams = TaskProgressParams;
6232interface StageHandlerProgressExecutor {
6233 dataEach?: (data: SeriesData, idx: number) => void;
6234 progress?: (params: StageHandlerProgressParams, data: SeriesData) => void;
6235}
6236declare type StageHandlerPlanReturn = TaskPlanCallbackReturn;
6237interface StageHandlerPlan {
6238 (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerPlanReturn;
6239}
6240interface LoadingEffectCreator {
6241 (api: ExtensionAPI, cfg: object): LoadingEffect;
6242}
6243interface LoadingEffect extends Element {
6244 resize: () => void;
6245}
6246/**
6247 * 'html' is used for rendering tooltip in extra DOM form, and the result
6248 * string is used as DOM HTML content.
6249 * 'richText' is used for rendering tooltip in rich text form, for those where
6250 * DOM operation is not supported.
6251 */
6252declare type TooltipRenderMode = 'html' | 'richText';
6253declare type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc';
6254declare type OrdinalRawValue = string | number;
6255declare type OrdinalNumber = number;
6256/**
6257 * @usage For example,
6258 * ```js
6259 * { ordinalNumbers: [2, 5, 3, 4] }
6260 * ```
6261 * means that ordinal 2 should be diplayed on tick 0,
6262 * ordinal 5 should be displayed on tick 1, ...
6263 */
6264declare type OrdinalSortInfo = {
6265 ordinalNumbers: OrdinalNumber[];
6266};
6267/**
6268 * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`.
6269 * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`)
6270 * into `ParsedValue` and stored into `data/SeriesData` storage.
6271 * Note:
6272 * (1) The term "parse" does not mean `src/scale/Scale['parse']`.
6273 * (2) If a category dimension is not mapped to any axis, its raw value will NOT be
6274 * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage.
6275 */
6276declare type ParsedValue = ParsedValueNumeric | OrdinalRawValue;
6277declare type ParsedValueNumeric = number | OrdinalNumber;
6278/**
6279 * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`.
6280 * (For example, used in `axis.min`, `axis.max`, `convertToPixel`).
6281 * Note:
6282 * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through
6283 * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`.
6284 */
6285declare type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date;
6286interface ScaleTick {
6287 level?: number;
6288 value: number;
6289}
6290declare type DimensionIndex = number;
6291declare type DimensionIndexLoose = DimensionIndex | string;
6292declare type DimensionName = string;
6293declare type DimensionLoose = DimensionName | DimensionIndexLoose;
6294declare type DimensionType = DataStoreDimensionType;
6295interface DataVisualDimensions {
6296 tooltip?: DimensionIndex | false;
6297 label?: DimensionIndex;
6298 itemName?: DimensionIndex;
6299 itemId?: DimensionIndex;
6300 itemGroupId?: DimensionIndex;
6301 seriesName?: DimensionIndex;
6302}
6303declare type DimensionDefinition = {
6304 type?: DataStoreDimensionType;
6305 name?: DimensionName;
6306 displayName?: string;
6307};
6308declare type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition;
6309declare const SOURCE_FORMAT_ORIGINAL: "original";
6310declare const SOURCE_FORMAT_ARRAY_ROWS: "arrayRows";
6311declare const SOURCE_FORMAT_OBJECT_ROWS: "objectRows";
6312declare const SOURCE_FORMAT_KEYED_COLUMNS: "keyedColumns";
6313declare const SOURCE_FORMAT_TYPED_ARRAY: "typedArray";
6314declare const SOURCE_FORMAT_UNKNOWN: "unknown";
6315declare type SourceFormat = typeof SOURCE_FORMAT_ORIGINAL | typeof SOURCE_FORMAT_ARRAY_ROWS | typeof SOURCE_FORMAT_OBJECT_ROWS | typeof SOURCE_FORMAT_KEYED_COLUMNS | typeof SOURCE_FORMAT_TYPED_ARRAY | typeof SOURCE_FORMAT_UNKNOWN;
6316declare const SERIES_LAYOUT_BY_COLUMN: "column";
6317declare const SERIES_LAYOUT_BY_ROW: "row";
6318declare type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW;
6319declare type OptionSourceHeader = boolean | 'auto' | number;
6320declare type SeriesDataType = 'main' | 'node' | 'edge';
6321/**
6322 * [ECUnitOption]:
6323 * An object that contains definitions of components
6324 * and other properties. For example:
6325 *
6326 * ```ts
6327 * let option: ECUnitOption = {
6328 *
6329 * // Single `title` component:
6330 * title: {...},
6331 *
6332 * // Two `visualMap` components:
6333 * visualMap: [{...}, {...}],
6334 *
6335 * // Two `series.bar` components
6336 * // and one `series.pie` component:
6337 * series: [
6338 * {type: 'bar', data: [...]},
6339 * {type: 'bar', data: [...]},
6340 * {type: 'pie', data: [...]}
6341 * ],
6342 *
6343 * // A property:
6344 * backgroundColor: '#421ae4'
6345 *
6346 * // A property object:
6347 * textStyle: {
6348 * color: 'red',
6349 * fontSize: 20
6350 * }
6351 * };
6352 * ```
6353 */
6354declare type ECUnitOption = {
6355 baseOption?: unknown;
6356 options?: unknown;
6357 media?: unknown;
6358 timeline?: ComponentOption | ComponentOption[];
6359 backgroundColor?: ZRColor;
6360 darkMode?: boolean | 'auto';
6361 textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
6362 useUTC?: boolean;
6363 [key: string]: ComponentOption | ComponentOption[] | Dictionary<unknown> | unknown;
6364 stateAnimation?: AnimationOption$1;
6365} & AnimationOptionMixin & ColorPaletteOptionMixin;
6366/**
6367 * [ECOption]:
6368 * An object input to echarts.setOption(option).
6369 * May be an 'option: ECUnitOption',
6370 * or may be an object contains multi-options. For example:
6371 *
6372 * ```ts
6373 * let option: ECOption = {
6374 * baseOption: {
6375 * title: {...},
6376 * legend: {...},
6377 * series: [
6378 * {data: [...]},
6379 * {data: [...]},
6380 * ...
6381 * ]
6382 * },
6383 * timeline: {...},
6384 * options: [
6385 * {title: {...}, series: {data: [...]}},
6386 * {title: {...}, series: {data: [...]}},
6387 * ...
6388 * ],
6389 * media: [
6390 * {
6391 * query: {maxWidth: 320},
6392 * option: {series: {x: 20}, visualMap: {show: false}}
6393 * },
6394 * {
6395 * query: {minWidth: 320, maxWidth: 720},
6396 * option: {series: {x: 500}, visualMap: {show: true}}
6397 * },
6398 * {
6399 * option: {series: {x: 1200}, visualMap: {show: true}}
6400 * }
6401 * ]
6402 * };
6403 * ```
6404 */
6405interface ECBasicOption extends ECUnitOption {
6406 baseOption?: ECUnitOption;
6407 timeline?: ComponentOption | ComponentOption[];
6408 options?: ECUnitOption[];
6409 media?: MediaUnit[];
6410}
6411declare type OptionSourceData<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = OptionSourceDataOriginal<VAL, ORIITEM> | OptionSourceDataObjectRows<VAL> | OptionSourceDataArrayRows<VAL> | OptionSourceDataKeyedColumns<VAL> | OptionSourceDataTypedArray;
6412declare type OptionDataItemOriginal<VAL extends OptionDataValue = OptionDataValue> = VAL | VAL[] | OptionDataItemObject<VAL>;
6413declare type OptionSourceDataOriginal<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = ArrayLike<ORIITEM>;
6414declare type OptionSourceDataObjectRows<VAL extends OptionDataValue = OptionDataValue> = Array<Dictionary<VAL>>;
6415declare type OptionSourceDataArrayRows<VAL extends OptionDataValue = OptionDataValue> = Array<Array<VAL>>;
6416declare type OptionSourceDataKeyedColumns<VAL extends OptionDataValue = OptionDataValue> = Dictionary<ArrayLike<VAL>>;
6417declare type OptionSourceDataTypedArray = ArrayLike<number>;
6418declare type OptionDataItem = OptionDataValue | Dictionary<OptionDataValue> | OptionDataValue[] | OptionDataItemObject<OptionDataValue>;
6419declare type OptionDataItemObject<T> = {
6420 id?: OptionId;
6421 name?: OptionName;
6422 groupId?: OptionId;
6423 value?: T[] | T;
6424 selected?: boolean;
6425};
6426declare type OptionId = string | number;
6427declare type OptionName = string | number;
6428interface GraphEdgeItemObject<VAL extends OptionDataValue> extends OptionDataItemObject<VAL> {
6429 /**
6430 * Name or index of source node.
6431 */
6432 source?: string | number;
6433 /**
6434 * Name or index of target node.
6435 */
6436 target?: string | number;
6437}
6438declare type OptionDataValue = string | number | Date;
6439declare type OptionDataValueNumeric = number | '-';
6440declare type OptionDataValueDate = Date | string | number;
6441declare type ModelOption = any;
6442declare type ThemeOption = Dictionary<any>;
6443declare type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select';
6444interface OptionEncodeVisualDimensions {
6445 tooltip?: OptionEncodeValue;
6446 label?: OptionEncodeValue;
6447 itemName?: OptionEncodeValue;
6448 itemId?: OptionEncodeValue;
6449 seriesName?: OptionEncodeValue;
6450 itemGroupId?: OptionEncodeValue;
6451}
6452interface OptionEncode extends OptionEncodeVisualDimensions {
6453 [coordDim: string]: OptionEncodeValue | undefined;
6454}
6455declare type OptionEncodeValue = DimensionLoose | DimensionLoose[];
6456declare type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode;
6457interface CallbackDataParams {
6458 componentType: string;
6459 componentSubType: string;
6460 componentIndex: number;
6461 seriesType?: string;
6462 seriesIndex?: number;
6463 seriesId?: string;
6464 seriesName?: string;
6465 name: string;
6466 dataIndex: number;
6467 data: OptionDataItem;
6468 dataType?: SeriesDataType;
6469 value: OptionDataItem | OptionDataValue;
6470 color?: ZRColor;
6471 borderColor?: string;
6472 dimensionNames?: DimensionName[];
6473 encode?: DimensionUserOuputEncode;
6474 marker?: TooltipMarker;
6475 status?: DisplayState;
6476 dimensionIndex?: number;
6477 percent?: number;
6478 $vars: string[];
6479}
6480declare type InterpolatableValue = ParsedValue | ParsedValue[];
6481declare type DecalDashArrayX = number | (number | number[])[];
6482declare type DecalDashArrayY = number | number[];
6483interface DecalObject {
6484 symbol?: string | string[];
6485 symbolSize?: number;
6486 symbolKeepAspect?: boolean;
6487 color?: string;
6488 backgroundColor?: string;
6489 dashArrayX?: DecalDashArrayX;
6490 dashArrayY?: DecalDashArrayY;
6491 rotation?: number;
6492 maxTileWidth?: number;
6493 maxTileHeight?: number;
6494}
6495interface MediaQuery {
6496 minWidth?: number;
6497 maxWidth?: number;
6498 minHeight?: number;
6499 maxHeight?: number;
6500 minAspectRatio?: number;
6501 maxAspectRatio?: number;
6502}
6503declare type MediaUnit = {
6504 query?: MediaQuery;
6505 option: ECUnitOption;
6506};
6507declare type ComponentLayoutMode = {
6508 type?: 'box';
6509 ignoreSize?: boolean | boolean[];
6510};
6511/******************* Mixins for Common Option Properties ********************** */
6512declare type PaletteOptionMixin = ColorPaletteOptionMixin;
6513interface ColorPaletteOptionMixin {
6514 color?: ZRColor | ZRColor[];
6515 colorLayer?: ZRColor[][];
6516}
6517interface AriaLabelOption {
6518 enabled?: boolean;
6519 description?: string;
6520 general?: {
6521 withTitle?: string;
6522 withoutTitle?: string;
6523 };
6524 series?: {
6525 maxCount?: number;
6526 single?: {
6527 prefix?: string;
6528 withName?: string;
6529 withoutName?: string;
6530 };
6531 multiple?: {
6532 prefix?: string;
6533 withName?: string;
6534 withoutName?: string;
6535 separator?: {
6536 middle?: string;
6537 end?: string;
6538 };
6539 };
6540 };
6541 data?: {
6542 maxCount?: number;
6543 allData?: string;
6544 partialData?: string;
6545 withName?: string;
6546 withoutName?: string;
6547 separator?: {
6548 middle?: string;
6549 end?: string;
6550 };
6551 };
6552}
6553interface AriaOption extends AriaLabelOption {
6554 mainType?: 'aria';
6555 enabled?: boolean;
6556 label?: AriaLabelOption;
6557 decal?: {
6558 show?: boolean;
6559 decals?: DecalObject | DecalObject[];
6560 };
6561}
6562/**
6563 * Mixin of option set to control the box layout of each component.
6564 */
6565interface BoxLayoutOptionMixin {
6566 width?: number | string;
6567 height?: number | string;
6568 top?: number | string;
6569 right?: number | string;
6570 bottom?: number | string;
6571 left?: number | string;
6572}
6573interface CircleLayoutOptionMixin {
6574 center?: (number | string)[];
6575 radius?: (number | string)[] | number | string;
6576}
6577interface ShadowOptionMixin {
6578 shadowBlur?: number;
6579 shadowColor?: ColorString;
6580 shadowOffsetX?: number;
6581 shadowOffsetY?: number;
6582}
6583interface BorderOptionMixin {
6584 borderColor?: ZRColor;
6585 borderWidth?: number;
6586 borderType?: ZRLineType;
6587 borderCap?: CanvasLineCap;
6588 borderJoin?: CanvasLineJoin;
6589 borderDashOffset?: number;
6590 borderMiterLimit?: number;
6591}
6592declare type ColorBy = 'series' | 'data';
6593interface SunburstColorByMixin {
6594 colorBy?: ColorBy;
6595}
6596declare type AnimationDelayCallbackParam = {
6597 count: number;
6598 index: number;
6599};
6600declare type AnimationDurationCallback = (idx: number) => number;
6601declare type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number;
6602interface AnimationOption$1 {
6603 duration?: number;
6604 easing?: AnimationEasing;
6605 delay?: number;
6606}
6607/**
6608 * Mixin of option set to control the animation of series.
6609 */
6610interface AnimationOptionMixin {
6611 /**
6612 * If enable animation
6613 */
6614 animation?: boolean;
6615 /**
6616 * Disable animation when the number of elements exceeds the threshold
6617 */
6618 animationThreshold?: number;
6619 /**
6620 * Duration of initialize animation.
6621 * Can be a callback to specify duration of each element
6622 */
6623 animationDuration?: number | AnimationDurationCallback;
6624 /**
6625 * Easing of initialize animation
6626 */
6627 animationEasing?: AnimationEasing;
6628 /**
6629 * Delay of initialize animation
6630 * Can be a callback to specify duration of each element
6631 */
6632 animationDelay?: number | AnimationDelayCallback;
6633 /**
6634 * Delay of data update animation.
6635 * Can be a callback to specify duration of each element
6636 */
6637 animationDurationUpdate?: number | AnimationDurationCallback;
6638 /**
6639 * Easing of data update animation.
6640 */
6641 animationEasingUpdate?: AnimationEasing;
6642 /**
6643 * Delay of data update animation.
6644 * Can be a callback to specify duration of each element
6645 */
6646 animationDelayUpdate?: number | AnimationDelayCallback;
6647}
6648interface RoamOptionMixin {
6649 /**
6650 * If enable roam. can be specified 'scale' or 'move'
6651 */
6652 roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale';
6653 /**
6654 * Current center position.
6655 */
6656 center?: number[];
6657 /**
6658 * Current zoom level. Default is 1
6659 */
6660 zoom?: number;
6661 scaleLimit?: {
6662 min?: number;
6663 max?: number;
6664 };
6665}
6666declare type SymbolSizeCallback<T> = (rawValue: any, params: T) => number | number[];
6667declare type SymbolCallback<T> = (rawValue: any, params: T) => string;
6668declare type SymbolRotateCallback<T> = (rawValue: any, params: T) => number;
6669declare type SymbolOffsetCallback<T> = (rawValue: any, params: T) => string | number | (string | number)[];
6670/**
6671 * Mixin of option set to control the element symbol.
6672 * Include type of symbol, and size of symbol.
6673 */
6674interface SymbolOptionMixin<T = never> {
6675 /**
6676 * type of symbol, like `cirlce`, `rect`, or custom path and image.
6677 */
6678 symbol?: string | (T extends never ? never : SymbolCallback<T>);
6679 /**
6680 * Size of symbol.
6681 */
6682 symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback<T>);
6683 symbolRotate?: number | (T extends never ? never : SymbolRotateCallback<T>);
6684 symbolKeepAspect?: boolean;
6685 symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback<T>);
6686}
6687/**
6688 * ItemStyleOption is a most common used set to config element styles.
6689 * It includes both fill and stroke style.
6690 */
6691interface ItemStyleOption<TCbParams = never> extends ShadowOptionMixin, BorderOptionMixin {
6692 color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor));
6693 opacity?: number;
6694 decal?: DecalObject | 'none';
6695}
6696/**
6697 * ItemStyleOption is a option set to control styles on lines.
6698 * Used in the components or series like `line`, `axis`
6699 * It includes stroke style.
6700 */
6701interface LineStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
6702 width?: number;
6703 color?: Clr;
6704 opacity?: number;
6705 type?: ZRLineType;
6706 cap?: CanvasLineCap;
6707 join?: CanvasLineJoin;
6708 dashOffset?: number;
6709 miterLimit?: number;
6710}
6711/**
6712 * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle.
6713 * It only include fill style.
6714 */
6715interface AreaStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
6716 color?: Clr;
6717 opacity?: number;
6718}
6719interface VisualOptionUnit {
6720 symbol?: string;
6721 symbolSize?: number;
6722 color?: ColorString;
6723 colorAlpha?: number;
6724 opacity?: number;
6725 colorLightness?: number;
6726 colorSaturation?: number;
6727 colorHue?: number;
6728 decal?: DecalObject;
6729 liftZ?: number;
6730}
6731declare type VisualOptionFixed = VisualOptionUnit;
6732/**
6733 * Option about visual properties used in piecewise mapping
6734 * Used in each piece.
6735 */
6736declare type VisualOptionPiecewise = VisualOptionUnit;
6737/**
6738 * All visual properties can be encoded.
6739 */
6740declare type BuiltinVisualProperty = keyof VisualOptionUnit;
6741interface TextCommonOption extends ShadowOptionMixin {
6742 color?: string;
6743 fontStyle?: ZRFontStyle;
6744 fontWeight?: ZRFontWeight;
6745 fontFamily?: string;
6746 fontSize?: number | string;
6747 align?: HorizontalAlign;
6748 verticalAlign?: VerticalAlign;
6749 baseline?: VerticalAlign;
6750 opacity?: number;
6751 lineHeight?: number;
6752 backgroundColor?: ColorString | {
6753 image: ImageLike | string;
6754 };
6755 borderColor?: string;
6756 borderWidth?: number;
6757 borderType?: ZRLineType;
6758 borderDashOffset?: number;
6759 borderRadius?: number | number[];
6760 padding?: number | number[];
6761 width?: number | string;
6762 height?: number;
6763 textBorderColor?: string;
6764 textBorderWidth?: number;
6765 textBorderType?: ZRLineType;
6766 textBorderDashOffset?: number;
6767 textShadowBlur?: number;
6768 textShadowColor?: string;
6769 textShadowOffsetX?: number;
6770 textShadowOffsetY?: number;
6771 tag?: string;
6772}
6773interface LabelFormatterCallback<T = CallbackDataParams> {
6774 (params: T): string;
6775}
6776/**
6777 * LabelOption is an option set to control the style of labels.
6778 * Include color, background, shadow, truncate, rotation, distance, etc..
6779 */
6780interface LabelOption extends TextCommonOption {
6781 /**
6782 * If show label
6783 */
6784 show?: boolean;
6785 position?: ElementTextConfig['position'];
6786 distance?: number;
6787 rotate?: number;
6788 offset?: number[];
6789 /**
6790 * Min margin between labels. Used when label has layout.
6791 */
6792 minMargin?: number;
6793 overflow?: TextStyleProps['overflow'];
6794 silent?: boolean;
6795 precision?: number | 'auto';
6796 valueAnimation?: boolean;
6797 rich?: Dictionary<TextCommonOption>;
6798}
6799interface SeriesLabelOption extends LabelOption {
6800 formatter?: string | LabelFormatterCallback<CallbackDataParams>;
6801}
6802/**
6803 * Option for labels on line, like markLine, lines
6804 */
6805interface LineLabelOption extends Omit<LabelOption, 'distance' | 'position'> {
6806 position?: 'start' | 'middle' | 'end' | 'insideStart' | 'insideStartTop' | 'insideStartBottom' | 'insideMiddle' | 'insideMiddleTop' | 'insideMiddleBottom' | 'insideEnd' | 'insideEndTop' | 'insideEndBottom' | 'insideMiddleBottom';
6807 /**
6808 * Distance can be an array.
6809 * Which will specify horizontal and vertical distance respectively
6810 */
6811 distance?: number | number[];
6812}
6813interface LabelLineOption {
6814 show?: boolean;
6815 /**
6816 * If displayed above other elements
6817 */
6818 showAbove?: boolean;
6819 length?: number;
6820 length2?: number;
6821 smooth?: boolean | number;
6822 minTurnAngle?: number;
6823 lineStyle?: LineStyleOption;
6824}
6825interface SeriesLineLabelOption extends LineLabelOption {
6826 formatter?: string | LabelFormatterCallback<CallbackDataParams>;
6827}
6828interface LabelLayoutOptionCallbackParams {
6829 /**
6830 * Index of data which the label represents.
6831 * It can be null if label does't represent any data.
6832 */
6833 dataIndex?: number;
6834 /**
6835 * Type of data which the label represents.
6836 * It can be null if label does't represent any data.
6837 */
6838 dataType?: SeriesDataType;
6839 seriesIndex: number;
6840 text: string;
6841 align: ZRTextAlign;
6842 verticalAlign: ZRTextVerticalAlign;
6843 rect: RectLike;
6844 labelRect: RectLike;
6845 labelLinePoints?: number[][];
6846}
6847interface LabelLayoutOption {
6848 /**
6849 * If move the overlapped label. If label is still overlapped after moved.
6850 * It will determine if to hide this label with `hideOverlap` policy.
6851 *
6852 * shiftX/Y will keep the order on x/y
6853 * shuffleX/y will move the label around the original position randomly.
6854 */
6855 moveOverlap?: 'shiftX' | 'shiftY' | 'shuffleX' | 'shuffleY';
6856 /**
6857 * If hide the overlapped label. It will be handled after move.
6858 * @default 'none'
6859 */
6860 hideOverlap?: boolean;
6861 /**
6862 * If label is draggable.
6863 */
6864 draggable?: boolean;
6865 /**
6866 * Can be absolute px number or percent string.
6867 */
6868 x?: number | string;
6869 y?: number | string;
6870 /**
6871 * offset on x based on the original position.
6872 */
6873 dx?: number;
6874 /**
6875 * offset on y based on the original position.
6876 */
6877 dy?: number;
6878 rotate?: number;
6879 align?: ZRTextAlign;
6880 verticalAlign?: ZRTextVerticalAlign;
6881 width?: number;
6882 height?: number;
6883 fontSize?: number;
6884 labelLinePoints?: number[][];
6885}
6886declare type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption;
6887interface TooltipFormatterCallback<T> {
6888 /**
6889 * For sync callback
6890 * params will be an array on axis trigger.
6891 */
6892 (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[];
6893 /**
6894 * For async callback.
6895 * Returned html string will be a placeholder when callback is not invoked.
6896 */
6897 (params: T, asyncTicket: string, callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void): string | HTMLElement | HTMLElement[];
6898}
6899declare type TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom';
6900declare type TooltipBoxLayoutOption = Pick<BoxLayoutOptionMixin, 'top' | 'left' | 'right' | 'bottom'>;
6901declare type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[];
6902/**
6903 * Position relative to the hoverred element. Only available when trigger is item.
6904 */
6905interface TooltipPositionCallback {
6906 (point: [number, number],
6907 /**
6908 * params will be an array on axis trigger.
6909 */
6910 params: TooltipPositionCallbackParams,
6911 /**
6912 * Will be HTMLDivElement when renderMode is html
6913 * Otherwise it's graphic.Text
6914 */
6915 el: HTMLDivElement | ZRText | null,
6916 /**
6917 * Rect of hover elements. Will be null if not hovered
6918 */
6919 rect: RectLike | null, size: {
6920 /**
6921 * Size of popup content
6922 */
6923 contentSize: [number, number];
6924 /**
6925 * Size of the chart view
6926 */
6927 viewSize: [number, number];
6928 }): Array<number | string> | TooltipBuiltinPosition | TooltipBoxLayoutOption;
6929}
6930/**
6931 * Common tooltip option
6932 * Can be configured on series, graphic elements
6933 */
6934interface CommonTooltipOption<FormatterParams> {
6935 show?: boolean;
6936 /**
6937 * When to trigger
6938 */
6939 triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click';
6940 /**
6941 * Whether to not hide popup content automatically
6942 */
6943 alwaysShowContent?: boolean;
6944 formatter?: string | TooltipFormatterCallback<FormatterParams>;
6945 /**
6946 * Absolution pixel [x, y] array. Or relative percent string [x, y] array.
6947 * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',
6948 * which is relative to the hovered element.
6949 *
6950 * Support to be a callback
6951 */
6952 position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption;
6953 confine?: boolean;
6954 /**
6955 * Consider triggered from axisPointer handle, verticalAlign should be 'middle'
6956 */
6957 align?: HorizontalAlign;
6958 verticalAlign?: VerticalAlign;
6959 /**
6960 * Delay of show. milesecond.
6961 */
6962 showDelay?: number;
6963 /**
6964 * Delay of hide. milesecond.
6965 */
6966 hideDelay?: number;
6967 transitionDuration?: number;
6968 /**
6969 * Whether mouse is allowed to enter the floating layer of tooltip
6970 * If you need to interact in the tooltip like with links or buttons, it can be set as true.
6971 */
6972 enterable?: boolean;
6973 backgroundColor?: ColorString;
6974 borderColor?: ColorString;
6975 borderRadius?: number;
6976 borderWidth?: number;
6977 shadowBlur?: number;
6978 shadowColor?: string;
6979 shadowOffsetX?: number;
6980 shadowOffsetY?: number;
6981 /**
6982 * Padding between tooltip content and tooltip border.
6983 */
6984 padding?: number | number[];
6985 /**
6986 * Available when renderMode is 'html'
6987 */
6988 extraCssText?: string;
6989 textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'width' | 'height' | 'textBorderColor' | 'textBorderWidth' | 'textShadowColor' | 'textShadowBlur' | 'textShadowOffsetX' | 'textShadowOffsetY' | 'align'> & {
6990 decoration?: string;
6991 };
6992}
6993declare type ComponentItemTooltipOption<T> = CommonTooltipOption<T> & {
6994 content?: string;
6995 formatterParams?: ComponentItemTooltipLabelFormatterParams;
6996};
6997declare type ComponentItemTooltipLabelFormatterParams = {
6998 componentType: string;
6999 name: string;
7000 $vars: string[];
7001} & {
7002 [key in string]: unknown;
7003};
7004/**
7005 * Tooltip option configured on each series
7006 */
7007declare type SeriesTooltipOption = CommonTooltipOption<CallbackDataParams> & {
7008 trigger?: 'item' | 'axis' | boolean | 'none';
7009};
7010declare type LabelFormatterParams = {
7011 value: ScaleDataValue;
7012 axisDimension: string;
7013 axisIndex: number;
7014 seriesData: CallbackDataParams[];
7015};
7016/**
7017 * Common axis option. can be configured on each axis
7018 */
7019interface CommonAxisPointerOption {
7020 show?: boolean | 'auto';
7021 z?: number;
7022 zlevel?: number;
7023 triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click';
7024 type?: 'line' | 'shadow' | 'none';
7025 snap?: boolean;
7026 triggerTooltip?: boolean;
7027 /**
7028 * current value. When using axisPointer.handle, value can be set to define the initail position of axisPointer.
7029 */
7030 value?: ScaleDataValue;
7031 status?: 'show' | 'hide';
7032 label?: LabelOption & {
7033 precision?: 'auto' | number;
7034 margin?: number;
7035 /**
7036 * String template include variable {value} or callback function
7037 */
7038 formatter?: string | ((params: LabelFormatterParams) => string);
7039 };
7040 animation?: boolean | 'auto';
7041 animationDurationUpdate?: number;
7042 animationEasingUpdate?: ZREasing;
7043 /**
7044 * Available when type is 'line'
7045 */
7046 lineStyle?: LineStyleOption;
7047 /**
7048 * Available when type is 'shadow'
7049 */
7050 shadowStyle?: AreaStyleOption;
7051 handle?: {
7052 show?: boolean;
7053 icon?: string;
7054 /**
7055 * The size of the handle
7056 */
7057 size?: number | number[];
7058 /**
7059 * Distance from handle center to axis.
7060 */
7061 margin?: number;
7062 color?: ColorString;
7063 /**
7064 * Throttle for mobile performance
7065 */
7066 throttle?: number;
7067 } & ShadowOptionMixin;
7068 seriesDataIndices?: {
7069 seriesIndex: number;
7070 dataIndex: number;
7071 dataIndexInside: number;
7072 }[];
7073}
7074interface ComponentOption {
7075 mainType?: string;
7076 type?: string;
7077 id?: OptionId;
7078 name?: OptionName;
7079 z?: number;
7080 zlevel?: number;
7081}
7082declare type BlurScope = 'coordinateSystem' | 'series' | 'global';
7083/**
7084 * can be array of data indices.
7085 * Or may be an dictionary if have different types of data like in graph.
7086 */
7087declare type InnerFocus = DefaultEmphasisFocus | ArrayLike<number> | Dictionary<ArrayLike<number>>;
7088interface DefaultStatesMixin {
7089 emphasis?: any;
7090 select?: any;
7091 blur?: any;
7092}
7093declare type DefaultEmphasisFocus = 'none' | 'self' | 'series';
7094interface DefaultStatesMixinEmpasis {
7095 /**
7096 * self: Focus self and blur all others.
7097 * series: Focus series and blur all other series.
7098 */
7099 focus?: DefaultEmphasisFocus;
7100}
7101interface StatesMixinBase {
7102 emphasis?: unknown;
7103 select?: unknown;
7104 blur?: unknown;
7105}
7106interface StatesOptionMixin<StateOption, StatesMixin extends StatesMixinBase> {
7107 /**
7108 * Emphasis states
7109 */
7110 emphasis?: StateOption & StatesMixin['emphasis'] & {
7111 /**
7112 * Scope of blurred element when focus.
7113 *
7114 * coordinateSystem: blur others in the same coordinateSystem
7115 * series: blur others in the same series
7116 * global: blur all others
7117 *
7118 * Default to be coordinate system.
7119 */
7120 blurScope?: BlurScope;
7121 };
7122 /**
7123 * Select states
7124 */
7125 select?: StateOption & StatesMixin['select'];
7126 /**
7127 * Blur states.
7128 */
7129 blur?: StateOption & StatesMixin['blur'];
7130}
7131interface UniversalTransitionOption {
7132 enabled?: boolean;
7133 /**
7134 * Animation delay of each divided element
7135 */
7136 delay?: (index: number, count: number) => number;
7137 /**
7138 * How to divide the shape in combine and split animation.
7139 */
7140 divideShape?: 'clone' | 'split';
7141 /**
7142 * Series will have transition between if they have same seriesKey.
7143 * Usually it is a string. It can also be an array,
7144 * which means it can be transition from or to multiple series with each key in this array item.
7145 *
7146 * Note:
7147 * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent)
7148 * Transition between string key has higher priority.
7149 *
7150 * Default to use series id.
7151 */
7152 seriesKey?: string | string[];
7153}
7154interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBase = DefaultStatesMixin> extends ComponentOption, AnimationOptionMixin, ColorPaletteOptionMixin, StatesOptionMixin<StateOption, StatesMixin> {
7155 mainType?: 'series';
7156 silent?: boolean;
7157 blendMode?: string;
7158 /**
7159 * Cursor when mouse on the elements
7160 */
7161 cursor?: string;
7162 /**
7163 * groupId of data. can be used for doing drilldown / up animation
7164 * It will be ignored if:
7165 * - groupId is specified in each data
7166 * - encode.itemGroupId is given.
7167 */
7168 dataGroupId?: OptionId;
7169 data?: unknown;
7170 colorBy?: ColorBy;
7171 legendHoverLink?: boolean;
7172 /**
7173 * Configurations about progressive rendering
7174 */
7175 progressive?: number | false;
7176 progressiveThreshold?: number;
7177 progressiveChunkMode?: 'mod';
7178 /**
7179 * Not available on every series
7180 */
7181 coordinateSystem?: string;
7182 hoverLayerThreshold?: number;
7183 /**
7184 * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series
7185 * namely, the series is "layout" on columns or rows
7186 * @default 'column'
7187 */
7188 seriesLayoutBy?: 'column' | 'row';
7189 labelLine?: LabelLineOption;
7190 /**
7191 * Overall label layout option in label layout stage.
7192 */
7193 labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback;
7194 /**
7195 * Animation config for state transition.
7196 */
7197 stateAnimation?: AnimationOption$1;
7198 /**
7199 * If enabled universal transition cross series.
7200 * @example
7201 * universalTransition: true
7202 * universalTransition: { enabled: true }
7203 */
7204 universalTransition?: boolean | UniversalTransitionOption;
7205 /**
7206 * Map of selected data
7207 * key is name or index of data.
7208 */
7209 selectedMap?: Dictionary<boolean>;
7210 selectedMode?: 'single' | 'multiple' | boolean;
7211}
7212interface SeriesOnCartesianOptionMixin {
7213 xAxisIndex?: number;
7214 yAxisIndex?: number;
7215 xAxisId?: string;
7216 yAxisId?: string;
7217}
7218interface SeriesOnPolarOptionMixin {
7219 polarIndex?: number;
7220 polarId?: string;
7221}
7222interface SeriesOnSingleOptionMixin {
7223 singleAxisIndex?: number;
7224 singleAxisId?: string;
7225}
7226interface SeriesOnGeoOptionMixin {
7227 geoIndex?: number;
7228 geoId?: string;
7229}
7230interface SeriesOnCalendarOptionMixin {
7231 calendarIndex?: number;
7232 calendarId?: string;
7233}
7234interface SeriesLargeOptionMixin {
7235 large?: boolean;
7236 largeThreshold?: number;
7237}
7238interface SeriesStackOptionMixin {
7239 stack?: string;
7240}
7241declare type SamplingFunc = (frame: ArrayLike<number>) => number;
7242interface SeriesSamplingOptionMixin {
7243 sampling?: 'none' | 'average' | 'min' | 'max' | 'sum' | 'lttb' | SamplingFunc;
7244}
7245interface SeriesEncodeOptionMixin {
7246 datasetIndex?: number;
7247 datasetId?: string | number;
7248 seriesLayoutBy?: SeriesLayoutBy;
7249 sourceHeader?: OptionSourceHeader;
7250 dimensions?: DimensionDefinitionLoose[];
7251 encode?: OptionEncode;
7252}
7253
7254declare type AreaStyleProps = Pick<PathStyleProps, 'fill' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'opacity' | 'shadowColor'>;
7255declare class AreaStyleMixin {
7256 getAreaStyle(this: Model, excludes?: readonly (keyof AreaStyleOption)[], includes?: readonly (keyof AreaStyleOption)[]): AreaStyleProps;
7257}
7258
7259declare type LabelFontOption = Pick<LabelOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
7260declare type LabelRectRelatedOption = Pick<LabelOption, 'align' | 'verticalAlign' | 'padding' | 'lineHeight' | 'baseline' | 'rich'> & LabelFontOption;
7261declare class TextStyleMixin {
7262 /**
7263 * Get color property or get color from option.textStyle.color
7264 */
7265 getTextColor(this: Model, isEmphasis?: boolean): ColorString;
7266 /**
7267 * Create font string from fontStyle, fontWeight, fontSize, fontFamily
7268 * @return {string}
7269 */
7270 getFont(this: Model<LabelFontOption>): string;
7271 getTextRect(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string): BoundingRect;
7272}
7273
7274interface Model<Opt = ModelOption> extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin {
7275}
7276declare class Model<Opt = ModelOption> {
7277 parentModel: Model;
7278 ecModel: GlobalModel;
7279 option: Opt;
7280 constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel);
7281 init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void;
7282 /**
7283 * Merge the input option to me.
7284 */
7285 mergeOption(option: Opt, ecModel?: GlobalModel): void;
7286 get<R extends keyof Opt>(path: R, ignoreParent?: boolean): Opt[R];
7287 get<R extends keyof Opt>(path: readonly [R], ignoreParent?: boolean): Opt[R];
7288 get<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], ignoreParent?: boolean): Opt[R][S];
7289 get<R extends keyof Opt, S extends keyof Opt[R], T extends keyof Opt[R][S]>(path: readonly [R, S, T], ignoreParent?: boolean): Opt[R][S][T];
7290 getShallow<R extends keyof Opt>(key: R, ignoreParent?: boolean): Opt[R];
7291 getModel<R extends keyof Opt>(path: R, parentModel?: Model): Model<Opt[R]>;
7292 getModel<R extends keyof Opt>(path: readonly [R], parentModel?: Model): Model<Opt[R]>;
7293 getModel<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], parentModel?: Model): Model<Opt[R][S]>;
7294 getModel<Ra extends keyof Opt, Rb extends keyof Opt, S extends keyof Opt[Rb]>(path: readonly [Ra] | readonly [Rb, S], parentModel?: Model): Model<Opt[Ra]> | Model<Opt[Rb][S]>;
7295 getModel<R extends keyof Opt, S extends keyof Opt[R], T extends keyof Opt[R][S]>(path: readonly [R, S, T], parentModel?: Model): Model<Opt[R][S][T]>;
7296 /**
7297 * Squash option stack into one.
7298 * parentModel will be removed after squashed.
7299 *
7300 * NOTE: resolveParentPath will not be applied here for simplicity. DON'T use this function
7301 * if resolveParentPath is modified.
7302 *
7303 * @param deepMerge If do deep merge. Default to be false.
7304 */
7305 /**
7306 * If model has option
7307 */
7308 isEmpty(): boolean;
7309 restoreData(): void;
7310 clone(): Model<Opt>;
7311 parsePath(path: string | readonly string[]): readonly string[];
7312 resolveParentPath(path: readonly string[]): string[];
7313 isAnimationEnabled(): boolean;
7314 private _doGet;
7315}
7316
7317declare type AnimateOrSetPropsOption = {
7318 dataIndex?: number;
7319 cb?: () => void;
7320 during?: (percent: number) => void;
7321 removeOpt?: AnimationOption$1;
7322 isFrom?: boolean;
7323};
7324/**
7325 * Update graphic element properties with or without animation according to the
7326 * configuration in series.
7327 *
7328 * Caution: this method will stop previous animation.
7329 * So do not use this method to one element twice before
7330 * animation starts, unless you know what you are doing.
7331 * @example
7332 * graphic.updateProps(el, {
7333 * position: [100, 100]
7334 * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
7335 * // Or
7336 * graphic.updateProps(el, {
7337 * position: [100, 100]
7338 * }, seriesModel, function () { console.log('Animation done!'); });
7339 */
7340declare function updateProps<Props>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
7341
7342/**
7343 * Init graphic element properties with or without animation according to the
7344 * configuration in series.
7345 *
7346 * Caution: this method will stop previous animation.
7347 * So do not use this method to one element twice before
7348 * animation starts, unless you know what you are doing.
7349 */
7350declare function initProps<Props>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
7351
7352declare type ExtendShapeOpt = Parameters<typeof Path.extend>[0];
7353declare type ExtendShapeReturn = ReturnType<typeof Path.extend>;
7354/**
7355 * Extend shape with parameters
7356 */
7357declare function extendShape(opts: ExtendShapeOpt): ExtendShapeReturn;
7358declare const extendPathFromString: typeof extendFromString;
7359declare type SVGPathOption$1 = Parameters<typeof extendPathFromString>[1];
7360declare type SVGPathCtor = ReturnType<typeof extendPathFromString>;
7361declare type SVGPath$1 = InstanceType<SVGPathCtor>;
7362/**
7363 * Extend path
7364 */
7365declare function extendPath(pathData: string, opts: SVGPathOption$1): SVGPathCtor;
7366/**
7367 * Register a user defined shape.
7368 * The shape class can be fetched by `getShapeClass`
7369 * This method will overwrite the registered shapes, including
7370 * the registered built-in shapes, if using the same `name`.
7371 * The shape can be used in `custom series` and
7372 * `graphic component` by declaring `{type: name}`.
7373 *
7374 * @param name
7375 * @param ShapeClass Can be generated by `extendShape`.
7376 */
7377declare function registerShape(name: string, ShapeClass: {
7378 new (): Path;
7379}): void;
7380/**
7381 * Find shape class registered by `registerShape`. Usually used in
7382 * fetching user defined shape.
7383 *
7384 * [Caution]:
7385 * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
7386 * to use user registered shapes.
7387 * Because the built-in shape (see `getBuiltInShape`) will be registered by
7388 * `registerShape` by default. That enables users to get both built-in
7389 * shapes as well as the shapes belonging to themsleves. But users can overwrite
7390 * the built-in shapes by using names like 'circle', 'rect' via calling
7391 * `registerShape`. So the echarts inner featrues should not fetch shapes from here
7392 * in case that it is overwritten by users, except that some features, like
7393 * `custom series`, `graphic component`, do it deliberately.
7394 *
7395 * (2) In the features like `custom series`, `graphic component`, the user input
7396 * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
7397 * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
7398 * are reserved names, that is, if some user register a shape named `'image'`,
7399 * the shape will not be used. If we intending to add some more reserved names
7400 * in feature, that might bring break changes (disable some existing user shape
7401 * names). But that case probably rearly happen. So we dont make more mechanism
7402 * to resolve this issue here.
7403 *
7404 * @param name
7405 * @return The shape class. If not found, return nothing.
7406 */
7407declare function getShapeClass(name: string): {
7408 new (): Path;
7409};
7410/**
7411 * Create a path element from path data string
7412 * @param pathData
7413 * @param opts
7414 * @param rect
7415 * @param layout 'center' or 'cover' default to be cover
7416 */
7417declare function makePath(pathData: string, opts: SVGPathOption$1, rect: ZRRectLike, layout?: 'center' | 'cover'): SVGPath$1;
7418/**
7419 * Create a image element from image url
7420 * @param imageUrl image url
7421 * @param opts options
7422 * @param rect constrain rect
7423 * @param layout 'center' or 'cover'. Default to be 'cover'
7424 */
7425declare function makeImage(imageUrl: string, rect: ZRRectLike, layout?: 'center' | 'cover'): ZRImage;
7426declare const mergePath$1: typeof mergePath;
7427/**
7428 * Resize a path to fit the rect
7429 * @param path
7430 * @param rect
7431 */
7432declare function resizePath(path: SVGPath$1, rect: ZRRectLike): void;
7433/**
7434 * Get transform matrix of target (param target),
7435 * in coordinate of its ancestor (param ancestor)
7436 *
7437 * @param target
7438 * @param [ancestor]
7439 */
7440declare function getTransform(target: Transformable, ancestor?: Transformable): MatrixArray;
7441declare function clipPointsByRect(points: VectorArray[], rect: ZRRectLike): number[][];
7442/**
7443 * Return a new clipped rect. If rect size are negative, return undefined.
7444 */
7445declare function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike;
7446declare function createIcon(iconStr: string, // Support 'image://' or 'path://' or direct svg path.
7447opt?: Omit<DisplayableProps, 'style'>, rect?: ZRRectLike): SVGPath$1 | ZRImage;
7448
7449declare type GeoSVGSourceInput = string | Document | SVGElement;
7450declare type GeoJSONSourceInput = string | GeoJSON | GeoJSONCompressed;
7451interface NameMap {
7452 [regionName: string]: string;
7453}
7454interface GeoSpecialAreas {
7455 [areaName: string]: {
7456 left: number;
7457 top: number;
7458 width?: number;
7459 height?: number;
7460 };
7461}
7462interface GeoJSON extends GeoJSONFeatureCollection<GeoJSONGeometry> {
7463}
7464interface GeoJSONCompressed extends GeoJSONFeatureCollection<GeoJSONGeometryCompressed> {
7465 UTF8Encoding?: boolean;
7466 UTF8Scale?: number;
7467}
7468interface GeoJSONFeatureCollection<G> {
7469 type: 'FeatureCollection';
7470 features: GeoJSONFeature<G>[];
7471}
7472interface GeoJSONFeature<G = GeoJSONGeometry> {
7473 type: 'Feature';
7474 id?: string | number;
7475 properties: {
7476 name?: string;
7477 cp?: number[];
7478 [key: string]: any;
7479 };
7480 geometry: G;
7481}
7482declare type GeoJSONGeometry = GeoJSONGeometryPoint | GeoJSONGeometryMultiPoint | GeoJSONGeometryLineString | GeoJSONGeometryMultiLineString | GeoJSONGeometryPolygon | GeoJSONGeometryMultiPolygon;
7483declare type GeoJSONGeometryCompressed = GeoJSONGeometryPoint | GeoJSONGeometryMultiPoint | GeoJSONGeometryLineString | GeoJSONGeometryMultiLineString | GeoJSONGeometryPolygonCompressed | GeoJSONGeometryMultiPolygonCompressed;
7484interface GeoJSONGeometryPoint {
7485 type: 'Point';
7486 coordinates: number[];
7487}
7488interface GeoJSONGeometryMultiPoint {
7489 type: 'MultiPoint';
7490 coordinates: number[][];
7491}
7492interface GeoJSONGeometryLineString {
7493 type: 'LineString';
7494 coordinates: number[][];
7495}
7496interface GeoJSONGeometryMultiLineString {
7497 type: 'MultiLineString';
7498 coordinates: number[][][];
7499}
7500interface GeoJSONGeometryPolygon {
7501 type: 'Polygon';
7502 coordinates: number[][][];
7503}
7504interface GeoJSONGeometryPolygonCompressed {
7505 type: 'Polygon';
7506 coordinates: string[];
7507 encodeOffsets: number[][];
7508}
7509interface GeoJSONGeometryMultiPolygon {
7510 type: 'MultiPolygon';
7511 coordinates: number[][][][];
7512}
7513interface GeoJSONGeometryMultiPolygonCompressed {
7514 type: 'MultiPolygon';
7515 coordinates: string[][];
7516 encodeOffsets: number[][][];
7517}
7518interface GeoResource {
7519 readonly type: 'geoJSON' | 'geoSVG';
7520 load(nameMap: NameMap, nameProperty: string): {
7521 boundingRect: BoundingRect;
7522 regions: Region[];
7523 regionsMap: HashMap<Region>;
7524 };
7525}
7526
7527declare class GeoJSONResource implements GeoResource {
7528 readonly type = "geoJSON";
7529 private _geoJSON;
7530 private _specialAreas;
7531 private _mapName;
7532 private _parsedMap;
7533 constructor(mapName: string, geoJSON: GeoJSONSourceInput, specialAreas: GeoSpecialAreas);
7534 /**
7535 * @param nameMap can be null/undefined
7536 * @param nameProperty can be null/undefined
7537 */
7538 load(nameMap: NameMap, nameProperty: string): {
7539 regions: GeoJSONRegion[];
7540 boundingRect: BoundingRect;
7541 regionsMap: HashMap<GeoJSONRegion, string | number>;
7542 };
7543 private _parseToRegions;
7544 /**
7545 * Only for exporting to users.
7546 * **MUST NOT** used internally.
7547 */
7548 getMapForUser(): {
7549 geoJson: GeoJSON | GeoJSONCompressed;
7550 geoJSON: GeoJSON | GeoJSONCompressed;
7551 specialAreas: GeoSpecialAreas;
7552 };
7553}
7554
7555declare type MapInput = GeoJSONMapInput | SVGMapInput;
7556interface GeoJSONMapInput {
7557 geoJSON: GeoJSONSourceInput;
7558 specialAreas: GeoSpecialAreas;
7559}
7560interface SVGMapInput {
7561 svg: GeoSVGSourceInput;
7562}
7563declare const _default$1: {
7564 /**
7565 * Compatible with previous `echarts.registerMap`.
7566 *
7567 * @usage
7568 * ```js
7569 *
7570 * echarts.registerMap('USA', geoJson, specialAreas);
7571 *
7572 * echarts.registerMap('USA', {
7573 * geoJson: geoJson,
7574 * specialAreas: {...}
7575 * });
7576 * echarts.registerMap('USA', {
7577 * geoJSON: geoJson,
7578 * specialAreas: {...}
7579 * });
7580 *
7581 * echarts.registerMap('airport', {
7582 * svg: svg
7583 * }
7584 * ```
7585 *
7586 * Note:
7587 * Do not support that register multiple geoJSON or SVG
7588 * one map name. Because different geoJSON and SVG have
7589 * different unit. It's not easy to make sure how those
7590 * units are mapping/normalize.
7591 * If intending to use multiple geoJSON or SVG, we can
7592 * use multiple geo coordinate system.
7593 */
7594 registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void;
7595 getGeoResource(mapName: string): GeoResource;
7596 /**
7597 * Only for exporting to users.
7598 * **MUST NOT** used internally.
7599 */
7600 getMapForUser: (mapName: string) => ReturnType<GeoJSONResource['getMapForUser']>;
7601 load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType<GeoResource['load']>;
7602};
7603
7604interface UpdateLifecycleTransitionSeriesFinder {
7605 seriesIndex?: ModelFinderIndexQuery;
7606 seriesId?: ModelFinderIdQuery;
7607 dimension: DimensionLoose;
7608}
7609interface UpdateLifecycleTransitionItem {
7610 from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
7611 to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
7612}
7613declare type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[];
7614interface UpdateLifecycleParams {
7615 updatedSeries?: SeriesModel[];
7616 /**
7617 * If this update is from setOption and option is changed.
7618 */
7619 optionChanged?: boolean;
7620 seriesTransition?: UpdateLifecycleTransitionOpt;
7621}
7622interface LifecycleEvents {
7623 'afterinit': [EChartsType];
7624 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
7625 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
7626 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
7627 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
7628 'afterupdate': [GlobalModel, ExtensionAPI];
7629}
7630
7631declare type ModelFinder$1 = ModelFinder;
7632declare const version$1 = "5.2.1";
7633declare const dependencies: {
7634 zrender: string;
7635};
7636declare const PRIORITY: {
7637 PROCESSOR: {
7638 FILTER: number;
7639 SERIES_FILTER: number;
7640 STATISTIC: number;
7641 };
7642 VISUAL: {
7643 LAYOUT: number;
7644 PROGRESSIVE_LAYOUT: number;
7645 GLOBAL: number;
7646 CHART: number;
7647 POST_CHART_LAYOUT: number;
7648 COMPONENT: number;
7649 BRUSH: number;
7650 CHART_ITEM: number;
7651 ARIA: number;
7652 DECAL: number;
7653 };
7654};
7655declare const IN_MAIN_PROCESS_KEY: "__flagInMainProcess";
7656declare const PENDING_UPDATE: "__pendingUpdate";
7657declare const STATUS_NEEDS_UPDATE_KEY: "__needsUpdateStatus";
7658declare const CONNECT_STATUS_KEY: "__connectUpdateStatus";
7659declare type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt;
7660declare type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem;
7661interface SetOptionOpts {
7662 notMerge?: boolean;
7663 lazyUpdate?: boolean;
7664 silent?: boolean;
7665 replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
7666 transition?: SetOptionTransitionOpt;
7667}
7668interface ResizeOpts {
7669 width?: number | 'auto';
7670 height?: number | 'auto';
7671 animation?: AnimationOption$1;
7672 silent?: boolean;
7673}
7674interface PostIniter {
7675 (chart: EChartsType): void;
7676}
7677declare type RenderedEventParam = {
7678 elapsedTime: number;
7679};
7680declare type ECEventDefinition = {
7681 [key in ZRElementEventName]: EventCallbackSingleParam<ECElementEvent>;
7682} & {
7683 rendered: EventCallbackSingleParam<RenderedEventParam>;
7684 finished: () => void | boolean;
7685} & {
7686 [key: string]: (...args: unknown[]) => void | boolean;
7687};
7688declare type EChartsInitOpts = {
7689 locale?: string | LocaleOption;
7690 renderer?: RendererType;
7691 devicePixelRatio?: number;
7692 useDirtyRect?: boolean;
7693 width?: number;
7694 height?: number;
7695};
7696declare class ECharts extends Eventful<ECEventDefinition> {
7697 /**
7698 * @readonly
7699 */
7700 id: string;
7701 /**
7702 * Group id
7703 * @readonly
7704 */
7705 group: string;
7706 private _zr;
7707 private _dom;
7708 private _model;
7709 private _throttledZrFlush;
7710 private _theme;
7711 private _locale;
7712 private _chartsViews;
7713 private _chartsMap;
7714 private _componentsViews;
7715 private _componentsMap;
7716 private _coordSysMgr;
7717 private _api;
7718 private _scheduler;
7719 private _messageCenter;
7720 private _pendingActions;
7721 protected _$eventProcessor: never;
7722 private _disposed;
7723 private _loadingFX;
7724 private [PENDING_UPDATE];
7725 private [IN_MAIN_PROCESS_KEY];
7726 private [CONNECT_STATUS_KEY];
7727 private [STATUS_NEEDS_UPDATE_KEY];
7728 constructor(dom: HTMLElement, theme?: string | ThemeOption, opts?: EChartsInitOpts);
7729 private _onframe;
7730 getDom(): HTMLElement;
7731 getId(): string;
7732 getZr(): ZRenderType;
7733 /**
7734 * Usage:
7735 * chart.setOption(option, notMerge, lazyUpdate);
7736 * chart.setOption(option, {
7737 * notMerge: ...,
7738 * lazyUpdate: ...,
7739 * silent: ...
7740 * });
7741 *
7742 * @param opts opts or notMerge.
7743 * @param opts.notMerge Default `false`.
7744 * @param opts.lazyUpdate Default `false`. Useful when setOption frequently.
7745 * @param opts.silent Default `false`.
7746 * @param opts.replaceMerge Default undefined.
7747 */
7748 setOption<Opt extends ECBasicOption>(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void;
7749 setOption<Opt extends ECBasicOption>(option: Opt, opts?: SetOptionOpts): void;
7750 /**
7751 * @DEPRECATED
7752 */
7753 private setTheme;
7754 private getModel;
7755 getOption(): ECBasicOption;
7756 getWidth(): number;
7757 getHeight(): number;
7758 getDevicePixelRatio(): number;
7759 /**
7760 * Get canvas which has all thing rendered
7761 */
7762 getRenderedCanvas(opts?: {
7763 backgroundColor?: ZRColor;
7764 pixelRatio?: number;
7765 }): HTMLCanvasElement;
7766 /**
7767 * Get svg data url
7768 */
7769 getSvgDataURL(): string;
7770 getDataURL(opts?: {
7771 type?: 'png' | 'jpg' | 'svg';
7772 pixelRatio?: number;
7773 backgroundColor?: ZRColor;
7774 excludeComponents?: ComponentMainType[];
7775 }): string;
7776 getConnectedDataURL(opts?: {
7777 type?: 'png' | 'jpg' | 'svg';
7778 pixelRatio?: number;
7779 backgroundColor?: ZRColor;
7780 connectedBackgroundColor?: ZRColor;
7781 excludeComponents?: string[];
7782 }): string;
7783 /**
7784 * Convert from logical coordinate system to pixel coordinate system.
7785 * See CoordinateSystem#convertToPixel.
7786 */
7787 convertToPixel(finder: ModelFinder$1, value: ScaleDataValue): number;
7788 convertToPixel(finder: ModelFinder$1, value: ScaleDataValue[]): number[];
7789 /**
7790 * Convert from pixel coordinate system to logical coordinate system.
7791 * See CoordinateSystem#convertFromPixel.
7792 */
7793 convertFromPixel(finder: ModelFinder$1, value: number): number;
7794 convertFromPixel(finder: ModelFinder$1, value: number[]): number[];
7795 /**
7796 * Is the specified coordinate systems or components contain the given pixel point.
7797 * @param {Array|number} value
7798 * @return {boolean} result
7799 */
7800 containPixel(finder: ModelFinder$1, value: number[]): boolean;
7801 /**
7802 * Get visual from series or data.
7803 * @param finder
7804 * If string, e.g., 'series', means {seriesIndex: 0}.
7805 * If Object, could contain some of these properties below:
7806 * {
7807 * seriesIndex / seriesId / seriesName,
7808 * dataIndex / dataIndexInside
7809 * }
7810 * If dataIndex is not specified, series visual will be fetched,
7811 * but not data item visual.
7812 * If all of seriesIndex, seriesId, seriesName are not specified,
7813 * visual will be fetched from first series.
7814 * @param visualType 'color', 'symbol', 'symbolSize'
7815 */
7816 getVisual(finder: ModelFinder$1, visualType: string): string | number | number[] | PatternObject | LinearGradientObject | RadialGradientObject;
7817 /**
7818 * Get view of corresponding component model
7819 */
7820 private getViewOfComponentModel;
7821 /**
7822 * Get view of corresponding series model
7823 */
7824 private getViewOfSeriesModel;
7825 private _initEvents;
7826 isDisposed(): boolean;
7827 clear(): void;
7828 dispose(): void;
7829 /**
7830 * Resize the chart
7831 */
7832 resize(opts?: ResizeOpts): void;
7833 /**
7834 * Show loading effect
7835 * @param name 'default' by default
7836 * @param cfg cfg of registered loading effect
7837 */
7838 showLoading(cfg?: object): void;
7839 showLoading(name?: string, cfg?: object): void;
7840 /**
7841 * Hide loading effect
7842 */
7843 hideLoading(): void;
7844 makeActionFromEvent(eventObj: ECActionEvent): Payload;
7845 /**
7846 * @param opt If pass boolean, means opt.silent
7847 * @param opt.silent Default `false`. Whether trigger events.
7848 * @param opt.flush Default `undefined`.
7849 * true: Flush immediately, and then pixel in canvas can be fetched
7850 * immediately. Caution: it might affect performance.
7851 * false: Not flush.
7852 * undefined: Auto decide whether perform flush.
7853 */
7854 dispatchAction(payload: Payload, opt?: boolean | {
7855 silent?: boolean;
7856 flush?: boolean | undefined;
7857 }): void;
7858 updateLabelLayout(): void;
7859 appendData(params: {
7860 seriesIndex: number;
7861 data: any;
7862 }): void;
7863 private static internalField;
7864}
7865/**
7866 * @param opts.devicePixelRatio Use window.devicePixelRatio by default
7867 * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
7868 * @param opts.width Use clientWidth of the input `dom` by default.
7869 * Can be 'auto' (the same as null/undefined)
7870 * @param opts.height Use clientHeight of the input `dom` by default.
7871 * Can be 'auto' (the same as null/undefined)
7872 * @param opts.locale Specify the locale.
7873 * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
7874 */
7875declare function init$1(dom: HTMLElement, theme?: string | object, opts?: EChartsInitOpts): EChartsType;
7876/**
7877 * @usage
7878 * (A)
7879 * ```js
7880 * let chart1 = echarts.init(dom1);
7881 * let chart2 = echarts.init(dom2);
7882 * chart1.group = 'xxx';
7883 * chart2.group = 'xxx';
7884 * echarts.connect('xxx');
7885 * ```
7886 * (B)
7887 * ```js
7888 * let chart1 = echarts.init(dom1);
7889 * let chart2 = echarts.init(dom2);
7890 * echarts.connect('xxx', [chart1, chart2]);
7891 * ```
7892 */
7893declare function connect(groupId: string | EChartsType[]): string;
7894/**
7895 * @deprecated
7896 */
7897declare function disConnect(groupId: string): void;
7898/**
7899 * Alias and backword compat
7900 */
7901declare const disconnect: typeof disConnect;
7902/**
7903 * Dispose a chart instance
7904 */
7905declare function dispose$1(chart: EChartsType | HTMLElement | string): void;
7906declare function getInstanceByDom(dom: HTMLElement): EChartsType;
7907declare function getInstanceById(key: string): EChartsType;
7908/**
7909 * Register theme
7910 */
7911declare function registerTheme(name: string, theme: ThemeOption): void;
7912/**
7913 * Register option preprocessor
7914 */
7915declare function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void;
7916declare function registerProcessor(priority: number | StageHandler | StageHandlerOverallReset, processor?: StageHandler | StageHandlerOverallReset): void;
7917/**
7918 * Register postIniter
7919 * @param {Function} postInitFunc
7920 */
7921declare function registerPostInit(postInitFunc: PostIniter): void;
7922/**
7923 * Register postUpdater
7924 * @param {Function} postUpdateFunc
7925 */
7926declare function registerPostUpdate(postUpdateFunc: PostUpdater): void;
7927declare function registerUpdateLifecycle<T extends keyof LifecycleEvents>(name: T, cb: (...args: LifecycleEvents[T]) => void): void;
7928/**
7929 * @usage
7930 * registerAction('someAction', 'someEvent', function () { ... });
7931 * registerAction('someAction', function () { ... });
7932 * registerAction(
7933 * {type: 'someAction', event: 'someEvent', update: 'updateView'},
7934 * function () { ... }
7935 * );
7936 *
7937 * @param {(string|Object)} actionInfo
7938 * @param {string} actionInfo.type
7939 * @param {string} [actionInfo.event]
7940 * @param {string} [actionInfo.update]
7941 * @param {string} [eventName]
7942 * @param {Function} action
7943 */
7944declare function registerAction(type: string, eventName: string, action: ActionHandler): void;
7945declare function registerAction(type: string, action: ActionHandler): void;
7946declare function registerAction(actionInfo: ActionInfo, action: ActionHandler): void;
7947declare function registerCoordinateSystem(type: string, coordSysCreator: CoordinateSystemCreator): void;
7948/**
7949 * Get dimensions of specified coordinate system.
7950 * @param {string} type
7951 * @return {Array.<string|Object>}
7952 */
7953declare function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[];
7954
7955/**
7956 * Layout is a special stage of visual encoding
7957 * Most visual encoding like color are common for different chart
7958 * But each chart has it's own layout algorithm
7959 */
7960declare function registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
7961declare function registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void;
7962declare function registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
7963declare function registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void;
7964
7965declare function registerLoading(name: string, loadingFx: LoadingEffectCreator): void;
7966/**
7967 * ZRender need a canvas context to do measureText.
7968 * But in node environment canvas may be created by node-canvas.
7969 * So we need to specify how to create a canvas instead of using document.createElement('canvas')
7970 *
7971 * Be careful of using it in the browser.
7972 *
7973 * @example
7974 * let Canvas = require('canvas');
7975 * let echarts = require('echarts');
7976 * echarts.setCanvasCreator(function () {
7977 * // Small size is enough.
7978 * return new Canvas(32, 32);
7979 * });
7980 */
7981declare function setCanvasCreator(creator: () => HTMLCanvasElement): void;
7982/**
7983 * The parameters and usage: see `geoSourceManager.registerMap`.
7984 * Compatible with previous `echarts.registerMap`.
7985 */
7986declare function registerMap(mapName: Parameters<typeof _default$1.registerMap>[0], geoJson: Parameters<typeof _default$1.registerMap>[1], specialAreas?: Parameters<typeof _default$1.registerMap>[2]): void;
7987declare function getMap(mapName: string): {
7988 geoJson: GeoJSON | GeoJSONCompressed;
7989 geoJSON: GeoJSON | GeoJSONCompressed;
7990 specialAreas: GeoSpecialAreas;
7991};
7992declare const registerTransform: typeof registerExternalTransform;
7993declare const dataTool: {};
7994interface EChartsType extends ECharts {
7995}
7996
7997declare function parse(colorStr: string, rgbaArr?: number[]): number[];
7998declare function lift(color: string, level: number): string;
7999declare function toHex(color: string): string;
8000declare function fastLerp(normalizedValue: number, colors: number[][], out?: number[]): number[];
8001declare const fastMapToColor: typeof fastLerp;
8002declare type LerpFullOutput = {
8003 color: string;
8004 leftIndex: number;
8005 rightIndex: number;
8006 value: number;
8007};
8008declare function lerp$1(normalizedValue: number, colors: string[], fullOutput: boolean): LerpFullOutput;
8009declare function lerp$1(normalizedValue: number, colors: string[]): string;
8010declare const mapToColor: typeof lerp$1;
8011declare function modifyHSL(color: string, h?: number, s?: number, l?: number): string;
8012declare function modifyAlpha(color: string, alpha?: number): string;
8013declare function stringify(arrColor: number[], type: string): string;
8014declare function lum(color: string, backgroundLum: number): number;
8015declare function random(): string;
8016
8017declare const color_d_parse: typeof parse;
8018declare const color_d_lift: typeof lift;
8019declare const color_d_toHex: typeof toHex;
8020declare const color_d_fastLerp: typeof fastLerp;
8021declare const color_d_fastMapToColor: typeof fastMapToColor;
8022declare const color_d_mapToColor: typeof mapToColor;
8023declare const color_d_modifyHSL: typeof modifyHSL;
8024declare const color_d_modifyAlpha: typeof modifyAlpha;
8025declare const color_d_stringify: typeof stringify;
8026declare const color_d_lum: typeof lum;
8027declare const color_d_random: typeof random;
8028declare namespace color_d {
8029 export {
8030 color_d_parse as parse,
8031 color_d_lift as lift,
8032 color_d_toHex as toHex,
8033 color_d_fastLerp as fastLerp,
8034 color_d_fastMapToColor as fastMapToColor,
8035 lerp$1 as lerp,
8036 color_d_mapToColor as mapToColor,
8037 color_d_modifyHSL as modifyHSL,
8038 color_d_modifyAlpha as modifyAlpha,
8039 color_d_stringify as stringify,
8040 color_d_lum as lum,
8041 color_d_random as random,
8042 };
8043}
8044
8045declare type ThrottleFunction = (this: unknown, ...args: unknown[]) => void;
8046interface ThrottleController {
8047 clear(): void;
8048 debounceNextCall(debounceDelay: number): void;
8049}
8050/**
8051 * @public
8052 * @param {(Function)} fn
8053 * @param {number} [delay=0] Unit: ms.
8054 * @param {boolean} [debounce=false]
8055 * true: If call interval less than `delay`, only the last call works.
8056 * false: If call interval less than `delay, call works on fixed rate.
8057 * @return {(Function)} throttled fn.
8058 */
8059declare function throttle<T extends ThrottleFunction>(fn: T, delay?: number, debounce?: boolean): T & ThrottleController;
8060
8061declare type EnableDataStackDimensionsInput = {
8062 schema: SeriesDataSchema;
8063 store?: DataStore;
8064};
8065declare type EnableDataStackDimensionsInputLegacy = (SeriesDimensionDefine | string)[];
8066/**
8067 * Note that it is too complicated to support 3d stack by value
8068 * (have to create two-dimension inverted index), so in 3d case
8069 * we just support that stacked by index.
8070 *
8071 * @param seriesModel
8072 * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
8073 * The input will be modified.
8074 * @param opt
8075 * @param opt.stackedCoordDimension Specify a coord dimension if needed.
8076 * @param opt.byIndex=false
8077 * @return calculationInfo
8078 * {
8079 * stackedDimension: string
8080 * stackedByDimension: string
8081 * isStackedByIndex: boolean
8082 * stackedOverDimension: string
8083 * stackResultDimension: string
8084 * }
8085 */
8086declare function enableDataStack(seriesModel: SeriesModel<SeriesOption & SeriesStackOptionMixin>, dimensionsInput: EnableDataStackDimensionsInput | EnableDataStackDimensionsInputLegacy, opt?: {
8087 stackedCoordDimension?: string;
8088 byIndex?: boolean;
8089}): Pick<DataCalculationInfo<unknown>, 'stackedDimension' | 'stackedByDimension' | 'isStackedByIndex' | 'stackedOverDimension' | 'stackResultDimension'>;
8090declare function isDimensionStacked(data: SeriesData, stackedDim: string): boolean;
8091declare function getStackedDimension(data: SeriesData, targetDim: string): DimensionName;
8092
8093/**
8094 * ECData stored on graphic element
8095 */
8096interface ECData {
8097 dataIndex?: number;
8098 dataModel?: DataModel;
8099 eventData?: ECEventData;
8100 seriesIndex?: number;
8101 dataType?: SeriesDataType;
8102 focus?: InnerFocus;
8103 blurScope?: BlurScope;
8104 componentMainType?: ComponentMainType;
8105 componentIndex?: number;
8106 componentHighDownName?: string;
8107 tooltipConfig?: {
8108 name: string;
8109 option: ComponentItemTooltipOption<unknown>;
8110 };
8111}
8112declare const getECData: (hostObj: Element<ElementProps>) => ECData;
8113
8114interface CoordDimensionDefinition extends DimensionDefinition {
8115 dimsDef?: (DimensionName | {
8116 name: DimensionName;
8117 defaultTooltip?: boolean;
8118 })[];
8119 otherDims?: DataVisualDimensions;
8120 ordinalMeta?: OrdinalMeta;
8121 coordDim?: DimensionName;
8122 coordDimIndex?: DimensionIndex;
8123}
8124declare type CoordDimensionDefinitionLoose = CoordDimensionDefinition['name'] | CoordDimensionDefinition;
8125declare type PrepareSeriesDataSchemaParams = {
8126 coordDimensions?: CoordDimensionDefinitionLoose[];
8127 /**
8128 * Will use `source.dimensionsDefine` if not given.
8129 */
8130 dimensionsDefine?: DimensionDefinitionLoose[];
8131 /**
8132 * Will use `source.encodeDefine` if not given.
8133 */
8134 encodeDefine?: HashMap<OptionEncodeValue, DimensionName> | OptionEncode;
8135 dimensionsCount?: number;
8136 /**
8137 * Make default encode if user not specified.
8138 */
8139 encodeDefaulter?: EncodeDefaulter;
8140 generateCoord?: string;
8141 generateCoordCount?: number;
8142 /**
8143 * If be able to omit unused dimension
8144 * Used to improve the performance on high dimension data.
8145 */
8146 canOmitUnusedDimensions?: boolean;
8147};
8148/**
8149 * For outside usage compat (like echarts-gl are using it).
8150 */
8151declare function createDimensions(source: Source | OptionSourceData, opt?: PrepareSeriesDataSchemaParams): SeriesDimensionDefine[];
8152
8153/**
8154 * Enable the function that mouseover will trigger the emphasis state.
8155 *
8156 * NOTE:
8157 * This function should be used on the element with dataIndex, seriesIndex.
8158 *
8159 */
8160declare function enableHoverEmphasis(el: Element, focus?: InnerFocus, blurScope?: BlurScope): void;
8161
8162/**
8163 * Create a muti dimension List structure from seriesModel.
8164 */
8165declare function createList(seriesModel: SeriesModel): SeriesData<Model<any>, DefaultDataVisual>;
8166
8167declare const dataStack: {
8168 isDimensionStacked: typeof isDimensionStacked;
8169 enableDataStack: typeof enableDataStack;
8170 getStackedDimension: typeof getStackedDimension;
8171};
8172
8173/**
8174 * Create scale
8175 * @param {Array.<number>} dataExtent
8176 * @param {Object|module:echarts/Model} option If `optoin.type`
8177 * is secified, it can only be `'value'` currently.
8178 */
8179declare function createScale(dataExtent: number[], option: object | AxisBaseModel): Scale<Dictionary<unknown>>;
8180/**
8181 * Mixin common methods to axis model,
8182 *
8183 * Inlcude methods
8184 * `getFormattedLabels() => Array.<string>`
8185 * `getCategories() => Array.<string>`
8186 * `getMin(origin: boolean) => number`
8187 * `getMax(origin: boolean) => number`
8188 * `getNeedCrossZero() => boolean`
8189 */
8190declare function mixinAxisModelCommonMethods(Model: Model): void;
8191
8192declare function createTextStyle(textStyleModel: Model<TextCommonOption>, opts?: {
8193 state?: DisplayState;
8194}): TextStyleProps;
8195
8196declare const helper_d_getLayoutRect: typeof getLayoutRect;
8197declare const helper_d_getECData: typeof getECData;
8198declare const helper_d_createList: typeof createList;
8199declare const helper_d_dataStack: typeof dataStack;
8200declare const helper_d_createScale: typeof createScale;
8201declare const helper_d_mixinAxisModelCommonMethods: typeof mixinAxisModelCommonMethods;
8202declare const helper_d_createTextStyle: typeof createTextStyle;
8203declare const helper_d_createDimensions: typeof createDimensions;
8204declare const helper_d_createSymbol: typeof createSymbol;
8205declare const helper_d_enableHoverEmphasis: typeof enableHoverEmphasis;
8206declare namespace helper_d {
8207 export {
8208 helper_d_getLayoutRect as getLayoutRect,
8209 helper_d_getECData as getECData,
8210 helper_d_createList as createList,
8211 helper_d_dataStack as dataStack,
8212 helper_d_createScale as createScale,
8213 helper_d_mixinAxisModelCommonMethods as mixinAxisModelCommonMethods,
8214 helper_d_createTextStyle as createTextStyle,
8215 helper_d_createDimensions as createDimensions,
8216 helper_d_createSymbol as createSymbol,
8217 helper_d_enableHoverEmphasis as enableHoverEmphasis,
8218 };
8219}
8220
8221declare function parseGeoJSON(geoJson: GeoJSON | GeoJSONCompressed, nameProperty: string): GeoJSONRegion[];
8222
8223/**
8224 * Linear mapping a value from domain to range
8225 * @param val
8226 * @param domain Domain extent domain[0] can be bigger than domain[1]
8227 * @param range Range extent range[0] can be bigger than range[1]
8228 * @param clamp Default to be false
8229 */
8230declare function linearMap(val: number, domain: number[], range: number[], clamp?: boolean): number;
8231/**
8232 * (1) Fix rounding error of float numbers.
8233 * (2) Support return string to avoid scientific notation like '3.5e-7'.
8234 */
8235declare function round(x: number | string, precision?: number): number;
8236declare function round(x: number | string, precision: number, returnStr: false): number;
8237declare function round(x: number | string, precision: number, returnStr: true): string;
8238/**
8239 * Inplacd asc sort arr.
8240 * The input arr will be modified.
8241 */
8242declare function asc<T extends number[]>(arr: T): T;
8243/**
8244 * Get precision.
8245 */
8246declare function getPrecision(val: string | number): number;
8247/**
8248 * Get precision with slow but safe method
8249 */
8250declare function getPrecisionSafe(val: string | number): number;
8251/**
8252 * Minimal dicernible data precisioin according to a single pixel.
8253 */
8254declare function getPixelPrecision(dataExtent: [number, number], pixelExtent: [number, number]): number;
8255/**
8256 * Get a data of given precision, assuring the sum of percentages
8257 * in valueList is 1.
8258 * The largest remainer method is used.
8259 * https://en.wikipedia.org/wiki/Largest_remainder_method
8260 *
8261 * @param valueList a list of all data
8262 * @param idx index of the data to be processed in valueList
8263 * @param precision integer number showing digits of precision
8264 * @return percent ranging from 0 to 100
8265 */
8266declare function getPercentWithPrecision(valueList: number[], idx: number, precision: number): number;
8267declare const MAX_SAFE_INTEGER = 9007199254740991;
8268/**
8269 * To 0 - 2 * PI, considering negative radian.
8270 */
8271declare function remRadian(radian: number): number;
8272/**
8273 * @param {type} radian
8274 * @return {boolean}
8275 */
8276declare function isRadianAroundZero(val: number): boolean;
8277/**
8278 * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
8279 * These values can be accepted:
8280 * + An instance of Date, represent a time in its own time zone.
8281 * + Or string in a subset of ISO 8601, only including:
8282 * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
8283 * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
8284 * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
8285 * all of which will be treated as local time if time zone is not specified
8286 * (see <https://momentjs.com/>).
8287 * + Or other string format, including (all of which will be treated as loacal time):
8288 * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
8289 * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
8290 * + a timestamp, which represent a time in UTC.
8291 * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
8292 */
8293declare function parseDate(value: unknown): Date;
8294/**
8295 * Quantity of a number. e.g. 0.1, 1, 10, 100
8296 *
8297 * @param val
8298 * @return
8299 */
8300declare function quantity(val: number): number;
8301/**
8302 * Exponent of the quantity of a number
8303 * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
8304 *
8305 * @param val non-negative value
8306 * @return
8307 */
8308declare function quantityExponent(val: number): number;
8309/**
8310 * find a “nice” number approximately equal to x. Round the number if round = true,
8311 * take ceiling if round = false. The primary observation is that the “nicest”
8312 * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
8313 *
8314 * See "Nice Numbers for Graph Labels" of Graphic Gems.
8315 *
8316 * @param val Non-negative value.
8317 * @param round
8318 * @return Niced number
8319 */
8320declare function nice(val: number, round?: boolean): number;
8321/**
8322 * This code was copied from "d3.js"
8323 * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
8324 * See the license statement at the head of this file.
8325 * @param ascArr
8326 */
8327declare function quantile(ascArr: number[], p: number): number;
8328declare type IntervalItem = {
8329 interval: [number, number];
8330 close: [0 | 1, 0 | 1];
8331};
8332/**
8333 * Order intervals asc, and split them when overlap.
8334 * expect(numberUtil.reformIntervals([
8335 * {interval: [18, 62], close: [1, 1]},
8336 * {interval: [-Infinity, -70], close: [0, 0]},
8337 * {interval: [-70, -26], close: [1, 1]},
8338 * {interval: [-26, 18], close: [1, 1]},
8339 * {interval: [62, 150], close: [1, 1]},
8340 * {interval: [106, 150], close: [1, 1]},
8341 * {interval: [150, Infinity], close: [0, 0]}
8342 * ])).toEqual([
8343 * {interval: [-Infinity, -70], close: [0, 0]},
8344 * {interval: [-70, -26], close: [1, 1]},
8345 * {interval: [-26, 18], close: [0, 1]},
8346 * {interval: [18, 62], close: [0, 1]},
8347 * {interval: [62, 150], close: [0, 1]},
8348 * {interval: [150, Infinity], close: [0, 0]}
8349 * ]);
8350 * @param list, where `close` mean open or close
8351 * of the interval, and Infinity can be used.
8352 * @return The origin list, which has been reformed.
8353 */
8354declare function reformIntervals(list: IntervalItem[]): IntervalItem[];
8355/**
8356 * [Numberic is defined as]:
8357 * `parseFloat(val) == val`
8358 * For example:
8359 * numeric:
8360 * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
8361 * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
8362 * not-numeric:
8363 * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
8364 * empty string, string with only white-spaces or line-terminal (see es spec),
8365 * 0x12, '0x12', '-0x12', 012, '012', '-012',
8366 * non-string, ...
8367 *
8368 * @test See full test cases in `test/ut/spec/util/number.js`.
8369 * @return Must be a typeof number. If not numeric, return NaN.
8370 */
8371declare function numericToNumber(val: unknown): number;
8372/**
8373 * Definition of "numeric": see `numericToNumber`.
8374 */
8375declare function isNumeric(val: unknown): val is number;
8376
8377declare const number_d_linearMap: typeof linearMap;
8378declare const number_d_round: typeof round;
8379declare const number_d_asc: typeof asc;
8380declare const number_d_getPrecision: typeof getPrecision;
8381declare const number_d_getPrecisionSafe: typeof getPrecisionSafe;
8382declare const number_d_getPixelPrecision: typeof getPixelPrecision;
8383declare const number_d_getPercentWithPrecision: typeof getPercentWithPrecision;
8384declare const number_d_MAX_SAFE_INTEGER: typeof MAX_SAFE_INTEGER;
8385declare const number_d_remRadian: typeof remRadian;
8386declare const number_d_isRadianAroundZero: typeof isRadianAroundZero;
8387declare const number_d_parseDate: typeof parseDate;
8388declare const number_d_quantity: typeof quantity;
8389declare const number_d_quantityExponent: typeof quantityExponent;
8390declare const number_d_nice: typeof nice;
8391declare const number_d_quantile: typeof quantile;
8392declare const number_d_reformIntervals: typeof reformIntervals;
8393declare const number_d_isNumeric: typeof isNumeric;
8394declare const number_d_numericToNumber: typeof numericToNumber;
8395declare namespace number_d {
8396 export {
8397 number_d_linearMap as linearMap,
8398 number_d_round as round,
8399 number_d_asc as asc,
8400 number_d_getPrecision as getPrecision,
8401 number_d_getPrecisionSafe as getPrecisionSafe,
8402 number_d_getPixelPrecision as getPixelPrecision,
8403 number_d_getPercentWithPrecision as getPercentWithPrecision,
8404 number_d_MAX_SAFE_INTEGER as MAX_SAFE_INTEGER,
8405 number_d_remRadian as remRadian,
8406 number_d_isRadianAroundZero as isRadianAroundZero,
8407 number_d_parseDate as parseDate,
8408 number_d_quantity as quantity,
8409 number_d_quantityExponent as quantityExponent,
8410 number_d_nice as nice,
8411 number_d_quantile as quantile,
8412 number_d_reformIntervals as reformIntervals,
8413 number_d_isNumeric as isNumeric,
8414 number_d_numericToNumber as numericToNumber,
8415 };
8416}
8417
8418declare function format(time: unknown, template: string, isUTC: boolean, lang?: string | Model<LocaleOption>): string;
8419
8420declare const time_d_format: typeof format;
8421declare namespace time_d {
8422 export {
8423 parseDate as parse,
8424 time_d_format as format,
8425 };
8426}
8427
8428declare const graphic_d_extendShape: typeof extendShape;
8429declare const graphic_d_extendPath: typeof extendPath;
8430declare const graphic_d_makePath: typeof makePath;
8431declare const graphic_d_makeImage: typeof makeImage;
8432declare const graphic_d_resizePath: typeof resizePath;
8433declare const graphic_d_createIcon: typeof createIcon;
8434declare const graphic_d_updateProps: typeof updateProps;
8435declare const graphic_d_initProps: typeof initProps;
8436declare const graphic_d_getTransform: typeof getTransform;
8437declare const graphic_d_clipPointsByRect: typeof clipPointsByRect;
8438declare const graphic_d_clipRectByRect: typeof clipRectByRect;
8439declare const graphic_d_registerShape: typeof registerShape;
8440declare const graphic_d_getShapeClass: typeof getShapeClass;
8441type graphic_d_Group = Group;
8442declare const graphic_d_Group: typeof Group;
8443type graphic_d_Circle = Circle;
8444declare const graphic_d_Circle: typeof Circle;
8445type graphic_d_Ellipse = Ellipse;
8446declare const graphic_d_Ellipse: typeof Ellipse;
8447type graphic_d_Sector = Sector;
8448declare const graphic_d_Sector: typeof Sector;
8449type graphic_d_Ring = Ring;
8450declare const graphic_d_Ring: typeof Ring;
8451type graphic_d_Polygon = Polygon;
8452declare const graphic_d_Polygon: typeof Polygon;
8453type graphic_d_Polyline = Polyline;
8454declare const graphic_d_Polyline: typeof Polyline;
8455type graphic_d_Rect = Rect;
8456declare const graphic_d_Rect: typeof Rect;
8457type graphic_d_Line = Line;
8458declare const graphic_d_Line: typeof Line;
8459type graphic_d_BezierCurve = BezierCurve;
8460declare const graphic_d_BezierCurve: typeof BezierCurve;
8461type graphic_d_Arc = Arc;
8462declare const graphic_d_Arc: typeof Arc;
8463type graphic_d_IncrementalDisplayable = IncrementalDisplayable;
8464declare const graphic_d_IncrementalDisplayable: typeof IncrementalDisplayable;
8465type graphic_d_CompoundPath = CompoundPath;
8466declare const graphic_d_CompoundPath: typeof CompoundPath;
8467type graphic_d_LinearGradient = LinearGradient;
8468declare const graphic_d_LinearGradient: typeof LinearGradient;
8469type graphic_d_RadialGradient = RadialGradient;
8470declare const graphic_d_RadialGradient: typeof RadialGradient;
8471type graphic_d_BoundingRect = BoundingRect;
8472declare const graphic_d_BoundingRect: typeof BoundingRect;
8473declare namespace graphic_d {
8474 export {
8475 graphic_d_extendShape as extendShape,
8476 graphic_d_extendPath as extendPath,
8477 graphic_d_makePath as makePath,
8478 graphic_d_makeImage as makeImage,
8479 mergePath$1 as mergePath,
8480 graphic_d_resizePath as resizePath,
8481 graphic_d_createIcon as createIcon,
8482 graphic_d_updateProps as updateProps,
8483 graphic_d_initProps as initProps,
8484 graphic_d_getTransform as getTransform,
8485 graphic_d_clipPointsByRect as clipPointsByRect,
8486 graphic_d_clipRectByRect as clipRectByRect,
8487 graphic_d_registerShape as registerShape,
8488 graphic_d_getShapeClass as getShapeClass,
8489 graphic_d_Group as Group,
8490 ZRImage as Image,
8491 ZRText as Text,
8492 graphic_d_Circle as Circle,
8493 graphic_d_Ellipse as Ellipse,
8494 graphic_d_Sector as Sector,
8495 graphic_d_Ring as Ring,
8496 graphic_d_Polygon as Polygon,
8497 graphic_d_Polyline as Polyline,
8498 graphic_d_Rect as Rect,
8499 graphic_d_Line as Line,
8500 graphic_d_BezierCurve as BezierCurve,
8501 graphic_d_Arc as Arc,
8502 graphic_d_IncrementalDisplayable as IncrementalDisplayable,
8503 graphic_d_CompoundPath as CompoundPath,
8504 graphic_d_LinearGradient as LinearGradient,
8505 graphic_d_RadialGradient as RadialGradient,
8506 graphic_d_BoundingRect as BoundingRect,
8507 };
8508}
8509
8510declare const format_d_addCommas: typeof addCommas;
8511declare const format_d_toCamelCase: typeof toCamelCase;
8512declare const format_d_encodeHTML: typeof encodeHTML;
8513declare const format_d_formatTpl: typeof formatTpl;
8514declare const format_d_getTooltipMarker: typeof getTooltipMarker;
8515declare const format_d_formatTime: typeof formatTime;
8516declare const format_d_capitalFirst: typeof capitalFirst;
8517declare const format_d_truncateText: typeof truncateText;
8518declare const format_d_getTextRect: typeof getTextRect;
8519declare namespace format_d {
8520 export {
8521 format_d_addCommas as addCommas,
8522 format_d_toCamelCase as toCamelCase,
8523 normalizeCssArray$1 as normalizeCssArray,
8524 format_d_encodeHTML as encodeHTML,
8525 format_d_formatTpl as formatTpl,
8526 format_d_getTooltipMarker as getTooltipMarker,
8527 format_d_formatTime as formatTime,
8528 format_d_capitalFirst as capitalFirst,
8529 format_d_truncateText as truncateText,
8530 format_d_getTextRect as getTextRect,
8531 };
8532}
8533
8534declare const util_d$1_map: typeof map;
8535declare const util_d$1_each: typeof each;
8536declare const util_d$1_indexOf: typeof indexOf;
8537declare const util_d$1_inherits: typeof inherits;
8538declare const util_d$1_reduce: typeof reduce;
8539declare const util_d$1_filter: typeof filter;
8540declare const util_d$1_bind: typeof bind;
8541declare const util_d$1_curry: typeof curry;
8542declare const util_d$1_isArray: typeof isArray;
8543declare const util_d$1_isString: typeof isString;
8544declare const util_d$1_isObject: typeof isObject;
8545declare const util_d$1_isFunction: typeof isFunction;
8546declare const util_d$1_extend: typeof extend;
8547declare const util_d$1_defaults: typeof defaults;
8548declare const util_d$1_merge: typeof merge;
8549declare namespace util_d$1 {
8550 export {
8551 util_d$1_map as map,
8552 util_d$1_each as each,
8553 util_d$1_indexOf as indexOf,
8554 util_d$1_inherits as inherits,
8555 util_d$1_reduce as reduce,
8556 util_d$1_filter as filter,
8557 util_d$1_bind as bind,
8558 util_d$1_curry as curry,
8559 util_d$1_isArray as isArray,
8560 util_d$1_isString as isString,
8561 util_d$1_isObject as isObject,
8562 util_d$1_isFunction as isFunction,
8563 util_d$1_extend as extend,
8564 util_d$1_defaults as defaults,
8565 clone$2 as clone,
8566 util_d$1_merge as merge,
8567 };
8568}
8569
8570declare class Browser {
8571 firefox: boolean;
8572 ie: boolean;
8573 edge: boolean;
8574 newEdge: boolean;
8575 weChat: boolean;
8576 version: string | number;
8577}
8578declare class Env {
8579 browser: Browser;
8580 node: boolean;
8581 wxa: boolean;
8582 worker: boolean;
8583 canvasSupported: boolean;
8584 svgSupported: boolean;
8585 touchEventsSupported: boolean;
8586 pointerEventsSupported: boolean;
8587 domSupported: boolean;
8588 transformSupported: boolean;
8589 transform3dSupported: boolean;
8590}
8591declare const env: Env;
8592
8593declare function brushSingle(ctx: CanvasRenderingContext2D, el: Displayable): void;
8594
8595declare function extendComponentModel(proto: object): ComponentModel;
8596declare function extendComponentView(proto: object): ChartView;
8597declare function extendSeriesModel(proto: object): SeriesModel;
8598declare function extendChartView(proto: object): ChartView;
8599
8600declare type ParallelLayoutDirection = 'horizontal' | 'vertical';
8601interface ParallelCoordinateSystemOption extends ComponentOption, BoxLayoutOptionMixin {
8602 mainType?: 'parallel';
8603 layout?: ParallelLayoutDirection;
8604 axisExpandable?: boolean;
8605 axisExpandCenter?: number;
8606 axisExpandCount?: number;
8607 axisExpandWidth?: number;
8608 axisExpandTriggerOn?: 'click' | 'mousemove';
8609 axisExpandRate?: number;
8610 axisExpandDebounce?: number;
8611 axisExpandSlideTriggerArea?: [number, number, number];
8612 axisExpandWindow?: number[];
8613 parallelAxisDefault?: ParallelAxisOption;
8614}
8615
8616declare type ParallelAxisOption = AxisBaseOption & {
8617 /**
8618 * 0, 1, 2, ...
8619 */
8620 dim?: number | number[];
8621 parallelIndex?: number;
8622 areaSelectStyle?: {
8623 width?: number;
8624 borderWidth?: number;
8625 borderColor?: ZRColor;
8626 color?: ZRColor;
8627 opacity?: number;
8628 };
8629 realtime?: boolean;
8630};
8631
8632declare type Dependencies = {
8633 grid: XAXisOption | YAXisOption | AxisPointerOption;
8634 polar: AngleAxisOption | RadiusAxisOption;
8635 parallel: ParallelAxisOption;
8636};
8637declare type DependenciesKeys = keyof Dependencies & string;
8638declare type Arrayable<T> = T | T[];
8639declare type GetMainType<OptionUnion extends ComponentOption> = Exclude<OptionUnion['mainType'], undefined>;
8640declare type ExtractComponentOption<OptionUnion, ExtractMainType> = OptionUnion extends {
8641 mainType?: ExtractMainType;
8642} ? OptionUnion : never;
8643declare type GetDependency<DependencyOption extends ComponentOption> = {
8644 [key in GetMainType<DependencyOption>]?: Arrayable<ExtractComponentOption<DependencyOption, key>>;
8645};
8646declare type GetDependencies<MainType extends string> = GetDependency<Dependencies[Extract<MainType, DependenciesKeys>]>;
8647declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<ECBasicOption, 'baseOption' | 'options'> & {
8648 [key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>;
8649} & GetDependencies<GetMainType<OptionUnion>>;
8650declare type CheckMainType<OptionUnionMainType extends string> = string extends OptionUnionMainType ? never : {};
8651declare type ComposeOption<OptionUnion extends ComponentOption> = ComposeUnitOption<OptionUnion> & {
8652 baseOption?: ComposeUnitOption<OptionUnion>;
8653 options?: ComposeUnitOption<OptionUnion>[];
8654};
8655
8656interface RadarIndicatorOption {
8657 name?: string;
8658 text?: string;
8659 min?: number;
8660 max?: number;
8661 color?: ColorString;
8662 axisType?: 'value' | 'log';
8663}
8664interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {
8665 mainType?: 'radar';
8666 startAngle?: number;
8667 shape?: 'polygon' | 'circle';
8668 axisLine?: AxisBaseOption['axisLine'];
8669 axisTick?: AxisBaseOption['axisTick'];
8670 axisLabel?: AxisBaseOption['axisLabel'];
8671 splitLine?: AxisBaseOption['splitLine'];
8672 splitArea?: AxisBaseOption['splitArea'];
8673 axisName?: {
8674 show?: boolean;
8675 formatter?: string | ((name?: string, indicatorOpt?: InnerIndicatorAxisOption) => string);
8676 } & LabelOption;
8677 axisNameGap?: number;
8678 triggerEvent?: boolean;
8679 scale?: boolean;
8680 splitNumber?: number;
8681 boundaryGap?: CategoryAxisBaseOption['boundaryGap'] | ValueAxisBaseOption['boundaryGap'];
8682 indicator?: RadarIndicatorOption[];
8683}
8684declare type InnerIndicatorAxisOption = AxisBaseOption & {};
8685
8686declare type SingleAxisPosition = 'top' | 'bottom' | 'left' | 'right';
8687declare type SingleAxisOption = AxisBaseOption & BoxLayoutOptionMixin & {
8688 mainType?: 'singleAxis';
8689 position?: SingleAxisPosition;
8690 orient?: LayoutOrient;
8691};
8692
8693interface CalendarMonthLabelFormatterCallbackParams {
8694 nameMap: string;
8695 yyyy: string;
8696 yy: string;
8697 /**
8698 * Month string. With 0 prefix.
8699 */
8700 MM: string;
8701 /**
8702 * Month number
8703 */
8704 M: number;
8705}
8706interface CalendarYearLabelFormatterCallbackParams {
8707 nameMap: string;
8708 /**
8709 * Start year
8710 */
8711 start: string;
8712 /**
8713 * End year
8714 */
8715 end: string;
8716}
8717interface CalendarOption extends ComponentOption, BoxLayoutOptionMixin {
8718 mainType?: 'calendar';
8719 cellSize?: number | 'auto' | (number | 'auto')[];
8720 orient?: LayoutOrient;
8721 splitLine?: {
8722 show?: boolean;
8723 lineStyle?: LineStyleOption;
8724 };
8725 itemStyle?: ItemStyleOption;
8726 /**
8727 * // one year
8728 * range: 2017
8729 * // one month
8730 * range: '2017-02'
8731 * // a range
8732 * range: ['2017-01-02', '2017-02-23']
8733 * // note: they will be identified as ['2017-01-01', '2017-02-01']
8734 * range: ['2017-01', '2017-02']
8735 */
8736 range?: OptionDataValueDate | (OptionDataValueDate)[];
8737 dayLabel?: Omit<LabelOption, 'position'> & {
8738 /**
8739 * First day of week.
8740 */
8741 firstDay?: number;
8742 /**
8743 * Margin between day label and axis line.
8744 * Can be percent string of cell size.
8745 */
8746 margin?: number | string;
8747 /**
8748 * Position of week, at the beginning or end of the range.
8749 */
8750 position?: 'start' | 'end';
8751 /**
8752 * Week text content, defaults to 'en'; It supports Chinese, English, and custom; index 0 always means Sunday
8753 * en: shortcut to English ['S', 'M', 'T', 'W', 'T', 'F', 'S']
8754 * cn: shortcut to Chinese ['日', '一', '二', '三', '四', '五', '六']
8755 */
8756 nameMap?: 'en' | 'cn' | string[];
8757 };
8758 monthLabel?: Omit<LabelOption, 'position'> & {
8759 /**
8760 * Margin between month label and axis line.
8761 */
8762 margin?: number;
8763 /**
8764 * Position of month label, at the beginning or end of the range.
8765 */
8766 position?: 'start' | 'end';
8767 /**
8768 * Month text content, defaults to 'en'; It supports Chinese, English, and custom; Index 0 always means Jan;
8769 */
8770 nameMap?: 'en' | 'cn' | string[];
8771 formatter?: string | ((params: CalendarMonthLabelFormatterCallbackParams) => string);
8772 };
8773 yearLabel?: Omit<LabelOption, 'position'> & {
8774 /**
8775 * Margin between year label and axis line.
8776 */
8777 margin?: number;
8778 /**
8779 * Position of year label, at the beginning or end of the range.
8780 */
8781 position?: 'top' | 'bottom' | 'left' | 'right';
8782 formatter?: string | ((params: CalendarYearLabelFormatterCallbackParams) => string);
8783 };
8784}
8785
8786declare type IconStyle = ItemStyleOption & {
8787 textFill?: LabelOption['color'];
8788 textBackgroundColor?: LabelOption['backgroundColor'];
8789 textPosition?: LabelOption['position'];
8790 textAlign?: LabelOption['align'];
8791 textBorderRadius?: LabelOption['borderRadius'];
8792 textPadding?: LabelOption['padding'];
8793};
8794interface ToolboxFeatureOption {
8795 show?: boolean;
8796 title?: string | Partial<Dictionary<string>>;
8797 icon?: string | Partial<Dictionary<string>>;
8798 iconStyle?: IconStyle;
8799 emphasis?: {
8800 iconStyle?: IconStyle;
8801 };
8802 iconStatus?: Partial<Dictionary<DisplayState>>;
8803 onclick?: () => void;
8804}
8805
8806interface ToolboxTooltipFormatterParams {
8807 componentType: 'toolbox';
8808 name: string;
8809 title: string;
8810 $vars: ['name', 'title'];
8811}
8812interface ToolboxOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
8813 mainType?: 'toolbox';
8814 show?: boolean;
8815 orient?: LayoutOrient;
8816 backgroundColor?: ZRColor;
8817 borderRadius?: number | number[];
8818 padding?: number | number[];
8819 itemSize?: number;
8820 itemGap?: number;
8821 showTitle?: boolean;
8822 iconStyle?: ItemStyleOption;
8823 emphasis?: {
8824 iconStyle?: ItemStyleOption;
8825 };
8826 textStyle?: LabelOption;
8827 tooltip?: CommonTooltipOption<ToolboxTooltipFormatterParams>;
8828 /**
8829 * Write all supported features in the final export option.
8830 */
8831 feature?: Partial<Dictionary<ToolboxFeatureOption>>;
8832}
8833
8834interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
8835 mainType?: 'title';
8836 show?: boolean;
8837 text?: string;
8838 /**
8839 * Link to url
8840 */
8841 link?: string;
8842 target?: 'self' | 'blank';
8843 subtext?: string;
8844 sublink?: string;
8845 subtarget?: 'self' | 'blank';
8846 textAlign?: ZRTextAlign;
8847 textVerticalAlign?: ZRTextVerticalAlign;
8848 /**
8849 * @deprecated Use textVerticalAlign instead
8850 */
8851 textBaseline?: ZRTextVerticalAlign;
8852 backgroundColor?: ZRColor;
8853 /**
8854 * Padding between text and border.
8855 * Support to be a single number or an array.
8856 */
8857 padding?: number | number[];
8858 /**
8859 * Gap between text and subtext
8860 */
8861 itemGap?: number;
8862 textStyle?: LabelOption;
8863 subtextStyle?: LabelOption;
8864 /**
8865 * If trigger mouse or touch event
8866 */
8867 triggerEvent?: boolean;
8868 /**
8869 * Radius of background border.
8870 */
8871 borderRadius?: number | number[];
8872}
8873
8874interface TimelineControlStyle extends ItemStyleOption {
8875 show?: boolean;
8876 showPlayBtn?: boolean;
8877 showPrevBtn?: boolean;
8878 showNextBtn?: boolean;
8879 itemSize?: number;
8880 itemGap?: number;
8881 position?: 'left' | 'right' | 'top' | 'bottom';
8882 playIcon?: string;
8883 stopIcon?: string;
8884 prevIcon?: string;
8885 nextIcon?: string;
8886 playBtnSize?: number | string;
8887 stopBtnSize?: number | string;
8888 nextBtnSize?: number | string;
8889 prevBtnSize?: number | string;
8890}
8891interface TimelineCheckpointStyle extends ItemStyleOption, SymbolOptionMixin {
8892 animation?: boolean;
8893 animationDuration?: number;
8894 animationEasing?: ZREasing;
8895}
8896interface TimelineLineStyleOption extends LineStyleOption {
8897 show?: boolean;
8898}
8899interface TimelineLabelOption extends Omit<LabelOption, 'position'> {
8900 show?: boolean;
8901 position?: 'auto' | 'left' | 'right' | 'top' | 'bottom' | number;
8902 interval?: 'auto' | number;
8903 formatter?: string | ((value: string | number, index: number) => string);
8904}
8905interface TimelineDataItemOption extends SymbolOptionMixin {
8906 value?: OptionDataValue;
8907 itemStyle?: ItemStyleOption;
8908 label?: TimelineLabelOption;
8909 checkpointStyle?: TimelineCheckpointStyle;
8910 emphasis?: {
8911 itemStyle?: ItemStyleOption;
8912 label?: TimelineLabelOption;
8913 checkpointStyle?: TimelineCheckpointStyle;
8914 };
8915 progress?: {
8916 lineStyle?: TimelineLineStyleOption;
8917 itemStyle?: ItemStyleOption;
8918 label?: TimelineLabelOption;
8919 };
8920 tooltip?: boolean;
8921}
8922interface TimelineOption extends ComponentOption, BoxLayoutOptionMixin, SymbolOptionMixin {
8923 mainType?: 'timeline';
8924 backgroundColor?: ZRColor;
8925 borderColor?: ColorString;
8926 borderWidth?: number;
8927 tooltip?: CommonTooltipOption<CallbackDataParams> & {
8928 trigger?: 'item';
8929 };
8930 show?: boolean;
8931 axisType?: 'category' | 'time' | 'value';
8932 currentIndex?: number;
8933 autoPlay?: boolean;
8934 rewind?: boolean;
8935 loop?: boolean;
8936 playInterval?: number;
8937 realtime?: boolean;
8938 controlPosition?: 'left' | 'right' | 'top' | 'bottom';
8939 padding?: number | number[];
8940 orient?: LayoutOrient;
8941 inverse?: boolean;
8942 replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
8943 lineStyle?: TimelineLineStyleOption;
8944 itemStyle?: ItemStyleOption;
8945 checkpointStyle?: TimelineCheckpointStyle;
8946 controlStyle?: TimelineControlStyle;
8947 label?: TimelineLabelOption;
8948 emphasis?: {
8949 lineStyle?: TimelineLineStyleOption;
8950 itemStyle?: ItemStyleOption;
8951 checkpointStyle?: TimelineCheckpointStyle;
8952 controlStyle?: TimelineControlStyle;
8953 label?: TimelineLabelOption;
8954 };
8955 progress?: {
8956 lineStyle?: TimelineLineStyleOption;
8957 itemStyle?: ItemStyleOption;
8958 label?: TimelineLabelOption;
8959 };
8960 data?: (OptionDataValue | TimelineDataItemOption)[];
8961}
8962
8963interface SliderTimelineOption extends TimelineOption {
8964}
8965
8966interface ScrollableLegendOption extends LegendOption {
8967 scrollDataIndex?: number;
8968 /**
8969 * Gap between each page button
8970 */
8971 pageButtonItemGap?: number;
8972 /**
8973 * Gap between page buttons group and legend items.
8974 */
8975 pageButtonGap?: number;
8976 pageButtonPosition?: 'start' | 'end';
8977 pageFormatter?: string | ((param: {
8978 current: number;
8979 total: number;
8980 }) => string);
8981 pageIcons?: {
8982 horizontal?: string[];
8983 vertical?: string[];
8984 };
8985 pageIconColor?: ZRColor;
8986 pageIconInactiveColor?: ZRColor;
8987 pageIconSize?: number;
8988 pageTextStyle?: LabelOption;
8989 animationDurationUpdate?: number;
8990}
8991
8992interface DataZoomOption extends ComponentOption {
8993 mainType?: 'dataZoom';
8994 /**
8995 * Default auto by axisIndex
8996 */
8997 orient?: LayoutOrient;
8998 /**
8999 * Default the first horizontal category axis.
9000 */
9001 xAxisIndex?: number | number[];
9002 xAxisId?: string | string[];
9003 /**
9004 * Default the first vertical category axis.
9005 */
9006 yAxisIndex?: number | number[];
9007 yAxisId?: string | string[];
9008 radiusAxisIndex?: number | number[];
9009 radiusAxisId?: string | string[];
9010 angleAxisIndex?: number | number[];
9011 angleAxisId?: string | string[];
9012 singleAxisIndex?: number | number[];
9013 singleAxisId?: string | string[];
9014 /**
9015 * Possible values: 'filter' or 'empty' or 'weakFilter'.
9016 * 'filter': data items which are out of window will be removed. This option is
9017 * applicable when filtering outliers. For each data item, it will be
9018 * filtered if one of the relevant dimensions is out of the window.
9019 * 'weakFilter': data items which are out of window will be removed. This option
9020 * is applicable when filtering outliers. For each data item, it will be
9021 * filtered only if all of the relevant dimensions are out of the same
9022 * side of the window.
9023 * 'empty': data items which are out of window will be set to empty.
9024 * This option is applicable when user should not neglect
9025 * that there are some data items out of window.
9026 * 'none': Do not filter.
9027 * Taking line chart as an example, line will be broken in
9028 * the filtered points when filterModel is set to 'empty', but
9029 * be connected when set to 'filter'.
9030 */
9031 filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
9032 /**
9033 * Dispatch action by the fixed rate, avoid frequency.
9034 * default 100. Do not throttle when use null/undefined.
9035 * If animation === true and animationDurationUpdate > 0,
9036 * default value is 100, otherwise 20.
9037 */
9038 throttle?: number | null | undefined;
9039 /**
9040 * Start percent. 0 ~ 100
9041 */
9042 start?: number;
9043 /**
9044 * End percent. 0 ~ 100
9045 */
9046 end?: number;
9047 /**
9048 * Start value. If startValue specified, start is ignored
9049 */
9050 startValue?: number | string | Date;
9051 /**
9052 * End value. If endValue specified, end is ignored.
9053 */
9054 endValue?: number | string | Date;
9055 /**
9056 * Min span percent, 0 - 100
9057 * The range of dataZoom can not be smaller than that.
9058 */
9059 minSpan?: number;
9060 /**
9061 * Max span percent, 0 - 100
9062 * The range of dataZoom can not be larger than that.
9063 */
9064 maxSpan?: number;
9065 minValueSpan?: number;
9066 maxValueSpan?: number;
9067 rangeMode?: ['value' | 'percent', 'value' | 'percent'];
9068 realtime?: boolean;
9069 textStyle?: LabelOption;
9070}
9071
9072interface SliderDataZoomOption extends DataZoomOption, BoxLayoutOptionMixin {
9073 show?: boolean;
9074 /**
9075 * Slider dataZoom don't support textStyle
9076 */
9077 /**
9078 * Background of slider zoom component
9079 */
9080 backgroundColor?: ZRColor;
9081 /**
9082 * @deprecated Use borderColor instead
9083 */
9084 /**
9085 * border color of the box. For compatibility,
9086 * if dataBackgroundColor is set, borderColor
9087 * is ignored.
9088 */
9089 borderColor?: ZRColor;
9090 /**
9091 * Border radius of the box.
9092 */
9093 borderRadius?: number | number[];
9094 dataBackground?: {
9095 lineStyle?: LineStyleOption;
9096 areaStyle?: AreaStyleOption;
9097 };
9098 selectedDataBackground?: {
9099 lineStyle?: LineStyleOption;
9100 areaStyle?: AreaStyleOption;
9101 };
9102 /**
9103 * Color of selected area.
9104 */
9105 fillerColor?: ZRColor;
9106 /**
9107 * @deprecated Use handleStyle instead
9108 */
9109 handleIcon?: string;
9110 /**
9111 * number: height of icon. width will be calculated according to the aspect of icon.
9112 * string: percent of the slider height. width will be calculated according to the aspect of icon.
9113 */
9114 handleSize?: string | number;
9115 handleStyle?: ItemStyleOption;
9116 /**
9117 * Icon to indicate it is a draggable panel.
9118 */
9119 moveHandleIcon?: string;
9120 moveHandleStyle?: ItemStyleOption;
9121 /**
9122 * Height of handle rect. Can be a percent string relative to the slider height.
9123 */
9124 moveHandleSize?: number;
9125 labelPrecision?: number | 'auto';
9126 labelFormatter?: string | ((value: number, valueStr: string) => string);
9127 showDetail?: boolean;
9128 showDataShadow?: 'auto' | boolean;
9129 zoomLock?: boolean;
9130 textStyle?: LabelOption;
9131 /**
9132 * If eable select by brushing
9133 */
9134 brushSelect?: boolean;
9135 brushStyle?: ItemStyleOption;
9136 emphasis?: {
9137 handleStyle?: ItemStyleOption;
9138 moveHandleStyle?: ItemStyleOption;
9139 };
9140}
9141
9142interface InsideDataZoomOption extends DataZoomOption {
9143 /**
9144 * Whether disable this inside zoom.
9145 */
9146 disabled?: boolean;
9147 /**
9148 * Whether disable zoom but only pan.
9149 */
9150 zoomLock?: boolean;
9151 zoomOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
9152 moveOnMouseMove?: boolean | 'shift' | 'ctrl' | 'alt';
9153 moveOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
9154 preventDefaultMouseMove?: boolean;
9155 /**
9156 * Inside dataZoom don't support textStyle
9157 */
9158 textStyle?: never;
9159}
9160
9161interface ContinousVisualMapOption extends VisualMapOption {
9162 align?: 'auto' | 'left' | 'right' | 'top' | 'bottom';
9163 /**
9164 * This prop effect default component type determine
9165 * @see echarts/component/visualMap/typeDefaulter.
9166 */
9167 calculable?: boolean;
9168 /**
9169 * selected range. In default case `range` is [min, max]
9170 * and can auto change along with modification of min max,
9171 * util user specifid a range.
9172 */
9173 range?: number[];
9174 /**
9175 * Whether to enable hover highlight.
9176 */
9177 hoverLink?: boolean;
9178 /**
9179 * The extent of hovered data.
9180 */
9181 hoverLinkDataSize?: number;
9182 /**
9183 * Whether trigger hoverLink when hover handle.
9184 * If not specified, follow the value of `realtime`.
9185 */
9186 hoverLinkOnHandle?: boolean;
9187 handleIcon?: string;
9188 handleSize?: string | number;
9189 handleStyle?: ItemStyleOption;
9190 indicatorIcon?: string;
9191 indicatorSize?: string | number;
9192 indicatorStyle?: ItemStyleOption;
9193 emphasis?: {
9194 handleStyle?: ItemStyleOption;
9195 };
9196}
9197
9198interface VisualPiece extends VisualOptionPiecewise {
9199 min?: number;
9200 max?: number;
9201 lt?: number;
9202 gt?: number;
9203 lte?: number;
9204 gte?: number;
9205 value?: number;
9206 label?: string;
9207}
9208/**
9209 * Order Rule:
9210 *
9211 * option.categories / option.pieces / option.text / option.selected:
9212 * If !option.inverse,
9213 * Order when vertical: ['top', ..., 'bottom'].
9214 * Order when horizontal: ['left', ..., 'right'].
9215 * If option.inverse, the meaning of
9216 * the order should be reversed.
9217 *
9218 * this._pieceList:
9219 * The order is always [low, ..., high].
9220 *
9221 * Mapping from location to low-high:
9222 * If !option.inverse
9223 * When vertical, top is high.
9224 * When horizontal, right is high.
9225 * If option.inverse, reverse.
9226 */
9227interface PiecewiseVisualMapOption extends VisualMapOption {
9228 align?: 'auto' | 'left' | 'right';
9229 minOpen?: boolean;
9230 maxOpen?: boolean;
9231 /**
9232 * When put the controller vertically, it is the length of
9233 * horizontal side of each item. Otherwise, vertical side.
9234 * When put the controller vertically, it is the length of
9235 * vertical side of each item. Otherwise, horizontal side.
9236 */
9237 itemWidth?: number;
9238 itemHeight?: number;
9239 itemSymbol?: string;
9240 pieces?: VisualPiece[];
9241 /**
9242 * category names, like: ['some1', 'some2', 'some3'].
9243 * Attr min/max are ignored when categories set. See "Order Rule"
9244 */
9245 categories?: string[];
9246 /**
9247 * If set to 5, auto split five pieces equally.
9248 * If set to 0 and component type not set, component type will be
9249 * determined as "continuous". (It is less reasonable but for ec2
9250 * compatibility, see echarts/component/visualMap/typeDefaulter)
9251 */
9252 splitNumber?: number;
9253 /**
9254 * Object. If not specified, means selected. When pieces and splitNumber: {'0': true, '5': true}
9255 * When categories: {'cate1': false, 'cate3': true} When selected === false, means all unselected.
9256 */
9257 selected?: Dictionary<boolean>;
9258 selectedMode?: 'multiple' | 'single';
9259 /**
9260 * By default, when text is used, label will hide (the logic
9261 * is remained for compatibility reason)
9262 */
9263 showLabel?: boolean;
9264 itemGap?: number;
9265 hoverLink?: boolean;
9266}
9267
9268declare type MarkerStatisticType = 'average' | 'min' | 'max' | 'median';
9269/**
9270 * Option to specify where to put the marker.
9271 */
9272interface MarkerPositionOption {
9273 x?: number | string;
9274 y?: number | string;
9275 /**
9276 * Coord on any coordinate system
9277 */
9278 coord?: (ScaleDataValue | MarkerStatisticType)[];
9279 xAxis?: ScaleDataValue;
9280 yAxis?: ScaleDataValue;
9281 radiusAxis?: ScaleDataValue;
9282 angleAxis?: ScaleDataValue;
9283 type?: MarkerStatisticType;
9284 /**
9285 * When using statistic method with type.
9286 * valueIndex and valueDim can be specify which dim the statistic is used on.
9287 */
9288 valueIndex?: number;
9289 valueDim?: string;
9290 /**
9291 * Value to be displayed as label. Totally optional
9292 */
9293 value?: string | number;
9294}
9295interface MarkerOption extends ComponentOption, AnimationOptionMixin {
9296 silent?: boolean;
9297 data?: unknown[];
9298 tooltip?: CommonTooltipOption<unknown> & {
9299 trigger?: 'item' | 'axis' | boolean | 'none';
9300 };
9301}
9302
9303interface MarkLineStateOption {
9304 lineStyle?: LineStyleOption;
9305 /**
9306 * itemStyle for symbol
9307 */
9308 itemStyle?: ItemStyleOption;
9309 label?: SeriesLineLabelOption;
9310}
9311interface MarkLineDataItemOptionBase extends MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
9312 name?: string;
9313}
9314interface MarkLine1DDataItemOption extends MarkLineDataItemOptionBase {
9315 xAxis?: number | string;
9316 yAxis?: number | string;
9317 type?: MarkerStatisticType;
9318 /**
9319 * When using statistic method with type.
9320 * valueIndex and valueDim can be specify which dim the statistic is used on.
9321 */
9322 valueIndex?: number;
9323 valueDim?: string;
9324 /**
9325 * Symbol for both two ends
9326 */
9327 symbol?: string[] | string;
9328 symbolSize?: number[] | number;
9329 symbolRotate?: number[] | number;
9330 symbolOffset?: number | string | (number | string)[];
9331}
9332interface MarkLine2DDataItemDimOption extends MarkLineDataItemOptionBase, SymbolOptionMixin, MarkerPositionOption {
9333}
9334declare type MarkLine2DDataItemOption = [
9335 MarkLine2DDataItemDimOption,
9336 MarkLine2DDataItemDimOption
9337];
9338interface MarkLineOption extends MarkerOption, MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
9339 mainType?: 'markLine';
9340 symbol?: string[] | string;
9341 symbolSize?: number[] | number;
9342 symbolRotate?: number[] | number;
9343 symbolOffset?: number | string | (number | string)[];
9344 /**
9345 * Precision used on statistic method
9346 */
9347 precision?: number;
9348 data?: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[];
9349}
9350
9351interface MarkPointStateOption {
9352 itemStyle?: ItemStyleOption;
9353 label?: SeriesLabelOption;
9354}
9355interface MarkPointDataItemOption extends MarkPointStateOption, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, SymbolOptionMixin<CallbackDataParams>, MarkerPositionOption {
9356 name: string;
9357}
9358interface MarkPointOption extends MarkerOption, SymbolOptionMixin<CallbackDataParams>, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, MarkPointStateOption {
9359 mainType?: 'markPoint';
9360 precision?: number;
9361 data?: MarkPointDataItemOption[];
9362}
9363
9364interface MarkAreaStateOption {
9365 itemStyle?: ItemStyleOption;
9366 label?: SeriesLabelOption;
9367}
9368interface MarkAreaDataItemOptionBase extends MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
9369 name?: string;
9370}
9371interface MarkArea1DDataItemOption extends MarkAreaDataItemOptionBase {
9372 xAxis?: number;
9373 yAxis?: number;
9374 type?: MarkerStatisticType;
9375 valueIndex?: number;
9376 valueDim?: string;
9377}
9378interface MarkArea2DDataItemDimOption extends MarkAreaDataItemOptionBase, MarkerPositionOption {
9379}
9380declare type MarkArea2DDataItemOption = [
9381 MarkArea2DDataItemDimOption,
9382 MarkArea2DDataItemDimOption
9383];
9384interface MarkAreaOption extends MarkerOption, MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
9385 mainType?: 'markArea';
9386 precision?: number;
9387 data?: (MarkArea1DDataItemOption | MarkArea2DDataItemOption)[];
9388}
9389
9390declare type LineDataValue = OptionDataValue | OptionDataValue[];
9391interface LineStateOptionMixin {
9392 emphasis?: {
9393 focus?: DefaultEmphasisFocus;
9394 scale?: boolean;
9395 };
9396}
9397interface LineStateOption<TCbParams = never> {
9398 itemStyle?: ItemStyleOption<TCbParams>;
9399 label?: SeriesLabelOption;
9400 endLabel?: LineEndLabelOption;
9401}
9402interface LineDataItemOption extends SymbolOptionMixin, LineStateOption, StatesOptionMixin<LineStateOption, LineStateOptionMixin> {
9403 name?: string;
9404 value?: LineDataValue;
9405}
9406interface LineEndLabelOption extends SeriesLabelOption {
9407 valueAnimation?: boolean;
9408}
9409interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackDataParams>, LineStateOptionMixin & {
9410 emphasis?: {
9411 lineStyle?: LineStyleOption | {
9412 width?: 'bolder';
9413 };
9414 areaStyle?: AreaStyleOption;
9415 };
9416 blur?: {
9417 lineStyle?: LineStyleOption;
9418 areaStyle?: AreaStyleOption;
9419 };
9420}>, LineStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
9421 type?: 'line';
9422 coordinateSystem?: 'cartesian2d' | 'polar';
9423 clip?: boolean;
9424 label?: SeriesLabelOption;
9425 endLabel?: LineEndLabelOption;
9426 lineStyle?: LineStyleOption;
9427 areaStyle?: AreaStyleOption & {
9428 origin?: 'auto' | 'start' | 'end';
9429 };
9430 step?: false | 'start' | 'end' | 'middle';
9431 smooth?: boolean | number;
9432 smoothMonotone?: 'x' | 'y' | 'none';
9433 connectNulls?: boolean;
9434 showSymbol?: boolean;
9435 showAllSymbol?: 'auto' | boolean;
9436 data?: (LineDataValue | LineDataItemOption)[];
9437}
9438
9439interface ScatterStateOption<TCbParams = never> {
9440 itemStyle?: ItemStyleOption<TCbParams>;
9441 label?: SeriesLabelOption;
9442}
9443interface ScatterStatesOptionMixin {
9444 emphasis?: {
9445 focus?: DefaultEmphasisFocus;
9446 scale?: boolean;
9447 };
9448}
9449interface ScatterDataItemOption extends SymbolOptionMixin, ScatterStateOption, StatesOptionMixin<ScatterStateOption, ScatterStatesOptionMixin>, OptionDataItemObject<OptionDataValue> {
9450}
9451interface ScatterSeriesOption extends SeriesOption<ScatterStateOption<CallbackDataParams>, ScatterStatesOptionMixin>, ScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SeriesLargeOptionMixin, SeriesStackOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
9452 type?: 'scatter';
9453 coordinateSystem?: string;
9454 cursor?: string;
9455 clip?: boolean;
9456 data?: (ScatterDataItemOption | OptionDataValue | OptionDataValue[])[] | ArrayLike<number>;
9457}
9458
9459interface PieItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
9460 borderRadius?: (number | string)[] | number | string;
9461}
9462interface PieCallbackDataParams extends CallbackDataParams {
9463 percent: number;
9464}
9465interface PieStateOption<TCbParams = never> {
9466 itemStyle?: PieItemStyleOption<TCbParams>;
9467 label?: PieLabelOption;
9468 labelLine?: PieLabelLineOption;
9469}
9470interface PieLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
9471 rotate?: number | boolean | 'radial' | 'tangential';
9472 alignTo?: 'none' | 'labelLine' | 'edge';
9473 edgeDistance?: string | number;
9474 /**
9475 * @deprecated Use `edgeDistance` instead
9476 */
9477 margin?: string | number;
9478 bleedMargin?: number;
9479 distanceToLabelLine?: number;
9480 position?: SeriesLabelOption['position'] | 'outer' | 'inner' | 'center' | 'outside';
9481}
9482interface PieLabelLineOption extends LabelLineOption {
9483 /**
9484 * Max angle between labelLine and surface normal.
9485 * 0 - 180
9486 */
9487 maxSurfaceAngle?: number;
9488}
9489interface ExtraStateOption {
9490 emphasis?: {
9491 focus?: DefaultEmphasisFocus;
9492 scale?: boolean;
9493 scaleSize?: number;
9494 };
9495}
9496interface PieDataItemOption extends OptionDataItemObject<OptionDataValueNumeric>, PieStateOption, StatesOptionMixin<PieStateOption, ExtraStateOption> {
9497 cursor?: string;
9498}
9499interface PieSeriesOption extends Omit<SeriesOption<PieStateOption<PieCallbackDataParams>, ExtraStateOption>, 'labelLine'>, PieStateOption<PieCallbackDataParams>, CircleLayoutOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
9500 type?: 'pie';
9501 roseType?: 'radius' | 'area';
9502 clockwise?: boolean;
9503 startAngle?: number;
9504 minAngle?: number;
9505 minShowLabelAngle?: number;
9506 selectedOffset?: number;
9507 avoidLabelOverlap?: boolean;
9508 percentPrecision?: number;
9509 stillShowZeroSum?: boolean;
9510 animationType?: 'expansion' | 'scale';
9511 animationTypeUpdate?: 'transition' | 'expansion';
9512 showEmptyCircle?: boolean;
9513 emptyCircleStyle?: PieItemStyleOption;
9514 data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | PieDataItemOption)[];
9515}
9516
9517declare type RadarSeriesDataValue = OptionDataValue[];
9518interface RadarStatesMixin {
9519 emphasis?: DefaultStatesMixinEmpasis;
9520}
9521interface RadarSeriesStateOption<TCbParams = never> {
9522 lineStyle?: LineStyleOption;
9523 areaStyle?: AreaStyleOption;
9524 label?: SeriesLabelOption;
9525 itemStyle?: ItemStyleOption<TCbParams>;
9526}
9527interface RadarSeriesDataItemOption extends SymbolOptionMixin, RadarSeriesStateOption<CallbackDataParams>, StatesOptionMixin<RadarSeriesStateOption<CallbackDataParams>, RadarStatesMixin>, OptionDataItemObject<RadarSeriesDataValue> {
9528}
9529interface RadarSeriesOption extends SeriesOption<RadarSeriesStateOption, RadarStatesMixin>, RadarSeriesStateOption, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
9530 type?: 'radar';
9531 coordinateSystem?: 'radar';
9532 radarIndex?: number;
9533 radarId?: string;
9534 data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[];
9535}
9536
9537interface CurveLineStyleOption extends LineStyleOption {
9538 curveness?: number;
9539}
9540interface TreeSeriesStateOption<TCbParams = never> {
9541 itemStyle?: ItemStyleOption<TCbParams>;
9542 /**
9543 * Line style of the edge between node and it's parent.
9544 */
9545 lineStyle?: CurveLineStyleOption;
9546 label?: SeriesLabelOption;
9547}
9548interface TreeStatesMixin {
9549 emphasis?: {
9550 focus?: DefaultEmphasisFocus | 'ancestor' | 'descendant';
9551 scale?: boolean;
9552 };
9553}
9554interface TreeSeriesNodeItemOption extends SymbolOptionMixin<CallbackDataParams>, TreeSeriesStateOption<CallbackDataParams>, StatesOptionMixin<TreeSeriesStateOption<CallbackDataParams>, TreeStatesMixin>, OptionDataItemObject<OptionDataValue> {
9555 children?: TreeSeriesNodeItemOption[];
9556 collapsed?: boolean;
9557 link?: string;
9558 target?: string;
9559}
9560/**
9561 * Configuration of leaves nodes.
9562 */
9563interface TreeSeriesLeavesOption extends TreeSeriesStateOption, StatesOptionMixin<TreeSeriesStateOption, TreeStatesMixin> {
9564}
9565interface TreeSeriesOption extends SeriesOption<TreeSeriesStateOption, TreeStatesMixin>, TreeSeriesStateOption, SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin {
9566 type?: 'tree';
9567 layout?: 'orthogonal' | 'radial';
9568 edgeShape?: 'polyline' | 'curve';
9569 /**
9570 * Available when edgeShape is polyline
9571 */
9572 edgeForkPosition?: string | number;
9573 nodeScaleRatio?: number;
9574 /**
9575 * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.
9576 * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.
9577 */
9578 orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical';
9579 expandAndCollapse?: boolean;
9580 /**
9581 * The initial expanded depth of tree
9582 */
9583 initialTreeDepth?: number;
9584 leaves?: TreeSeriesLeavesOption;
9585 data?: TreeSeriesNodeItemOption[];
9586}
9587
9588declare type TreemapSeriesDataValue = number | number[];
9589interface BreadcrumbItemStyleOption extends ItemStyleOption {
9590 textStyle?: LabelOption;
9591}
9592interface TreemapSeriesLabelOption extends SeriesLabelOption {
9593 ellipsis?: boolean;
9594 formatter?: string | ((params: CallbackDataParams) => string);
9595}
9596interface TreemapSeriesItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
9597 borderRadius?: number | number[];
9598 colorAlpha?: number;
9599 colorSaturation?: number;
9600 borderColorSaturation?: number;
9601 gapWidth?: number;
9602}
9603interface TreePathInfo {
9604 name: string;
9605 dataIndex: number;
9606 value: TreemapSeriesDataValue;
9607}
9608interface TreemapSeriesCallbackDataParams extends CallbackDataParams {
9609 /**
9610 * @deprecated
9611 */
9612 treePathInfo?: TreePathInfo[];
9613 treeAncestors?: TreePathInfo[];
9614}
9615interface ExtraStateOption$1 {
9616 emphasis?: {
9617 focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
9618 };
9619}
9620interface TreemapStateOption<TCbParams = never> {
9621 itemStyle?: TreemapSeriesItemStyleOption<TCbParams>;
9622 label?: TreemapSeriesLabelOption;
9623 upperLabel?: TreemapSeriesLabelOption;
9624}
9625interface TreemapSeriesVisualOption {
9626 /**
9627 * Which dimension will be applied with the visual properties.
9628 */
9629 visualDimension?: number | string;
9630 /**
9631 * @deprecated Use colorBy instead
9632 */
9633 colorMappingBy?: 'value' | 'index' | 'id';
9634 visualMin?: number;
9635 visualMax?: number;
9636 colorAlpha?: number[] | 'none';
9637 colorSaturation?: number[] | 'none';
9638 /**
9639 * A node will not be shown when its area size is smaller than this value (unit: px square).
9640 */
9641 visibleMin?: number;
9642 /**
9643 * Children will not be shown when area size of a node is smaller than this value (unit: px square).
9644 */
9645 childrenVisibleMin?: number;
9646}
9647interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
9648 color?: ColorString[] | 'none';
9649 decal?: DecalObject[] | 'none';
9650}
9651interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
9652 id?: OptionId;
9653 name?: OptionName;
9654 value?: TreemapSeriesDataValue;
9655 children?: TreemapSeriesNodeItemOption[];
9656 color?: ColorString[] | 'none';
9657 decal?: DecalObject[] | 'none';
9658}
9659interface TreemapSeriesOption extends SeriesOption<TreemapStateOption<TreemapSeriesCallbackDataParams>, ExtraStateOption$1>, TreemapStateOption<TreemapSeriesCallbackDataParams>, BoxLayoutOptionMixin, RoamOptionMixin, TreemapSeriesVisualOption {
9660 type?: 'treemap';
9661 /**
9662 * configuration in echarts2
9663 * @deprecated
9664 */
9665 size?: (number | string)[];
9666 /**
9667 * If sort in desc order.
9668 * Default to be desc. asc has strange effect
9669 */
9670 sort?: boolean | 'asc' | 'desc';
9671 /**
9672 * Size of clipped window when zooming. 'origin' or 'fullscreen'
9673 */
9674 clipWindow?: 'origin' | 'fullscreen';
9675 squareRatio?: number;
9676 /**
9677 * Nodes on depth from root are regarded as leaves.
9678 * Count from zero (zero represents only view root).
9679 */
9680 leafDepth?: number;
9681 drillDownIcon?: string;
9682 /**
9683 * Be effective when using zoomToNode. Specify the proportion of the
9684 * target node area in the view area.
9685 */
9686 zoomToNodeRatio?: number;
9687 /**
9688 * Leaf node click behaviour: 'zoomToNode', 'link', false.
9689 * If leafDepth is set and clicking a node which has children but
9690 * be on left depth, the behaviour would be changing root. Otherwise
9691 * use behavious defined above.
9692 */
9693 nodeClick?: 'zoomToNode' | 'link';
9694 breadcrumb?: BoxLayoutOptionMixin & {
9695 show?: boolean;
9696 height?: number;
9697 emptyItemWidth?: number;
9698 itemStyle?: BreadcrumbItemStyleOption;
9699 emphasis?: {
9700 itemStyle?: BreadcrumbItemStyleOption;
9701 };
9702 };
9703 levels?: TreemapSeriesLevelOption[];
9704 data?: TreemapSeriesNodeItemOption[];
9705}
9706
9707declare type GraphDataValue = OptionDataValue | OptionDataValue[];
9708interface GraphEdgeLineStyleOption extends LineStyleOption {
9709 curveness?: number;
9710}
9711interface GraphNodeStateOption<TCbParams = never> {
9712 itemStyle?: ItemStyleOption<TCbParams>;
9713 label?: SeriesLabelOption;
9714}
9715interface ExtraEmphasisState {
9716 focus?: DefaultEmphasisFocus | 'adjacency';
9717}
9718interface GraphNodeStatesMixin {
9719 emphasis?: ExtraEmphasisState;
9720}
9721interface GraphEdgeStatesMixin {
9722 emphasis?: ExtraEmphasisState;
9723}
9724interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOption, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
9725 id?: string;
9726 name?: string;
9727 value?: GraphDataValue;
9728 /**
9729 * Fixed x position
9730 */
9731 x?: number;
9732 /**
9733 * Fixed y position
9734 */
9735 y?: number;
9736 /**
9737 * If this node is fixed during force layout.
9738 */
9739 fixed?: boolean;
9740 /**
9741 * Index or name of category
9742 */
9743 category?: number | string;
9744 draggable?: boolean;
9745}
9746interface GraphEdgeStateOption {
9747 lineStyle?: GraphEdgeLineStyleOption;
9748 label?: SeriesLineLabelOption;
9749}
9750interface GraphEdgeItemOption extends GraphEdgeStateOption, StatesOptionMixin<GraphEdgeStateOption, GraphEdgeStatesMixin>, GraphEdgeItemObject<OptionDataValueNumeric> {
9751 value?: number;
9752 /**
9753 * Symbol of both line ends
9754 */
9755 symbol?: string | string[];
9756 symbolSize?: number | number[];
9757 ignoreForceLayout?: boolean;
9758}
9759interface GraphCategoryItemOption extends SymbolOptionMixin, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
9760 name?: string;
9761 value?: OptionDataValue;
9762}
9763interface GraphSeriesOption extends SeriesOption<GraphNodeStateOption<CallbackDataParams>, GraphNodeStatesMixin>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, RoamOptionMixin, BoxLayoutOptionMixin {
9764 type?: 'graph';
9765 coordinateSystem?: string;
9766 legendHoverLink?: boolean;
9767 layout?: 'none' | 'force' | 'circular';
9768 data?: (GraphNodeItemOption | GraphDataValue)[];
9769 nodes?: (GraphNodeItemOption | GraphDataValue)[];
9770 edges?: GraphEdgeItemOption[];
9771 links?: GraphEdgeItemOption[];
9772 categories?: GraphCategoryItemOption[];
9773 /**
9774 * @deprecated
9775 */
9776 focusNodeAdjacency?: boolean;
9777 /**
9778 * Symbol size scale ratio in roam
9779 */
9780 nodeScaleRatio?: 0.6;
9781 draggable?: boolean;
9782 edgeSymbol?: string | string[];
9783 edgeSymbolSize?: number | number[];
9784 edgeLabel?: SeriesLineLabelOption;
9785 label?: SeriesLabelOption;
9786 itemStyle?: ItemStyleOption<CallbackDataParams>;
9787 lineStyle?: GraphEdgeLineStyleOption;
9788 emphasis?: {
9789 focus?: Exclude<GraphNodeItemOption['emphasis'], undefined>['focus'];
9790 scale?: boolean;
9791 label?: SeriesLabelOption;
9792 edgeLabel?: SeriesLabelOption;
9793 itemStyle?: ItemStyleOption;
9794 lineStyle?: LineStyleOption;
9795 };
9796 blur?: {
9797 label?: SeriesLabelOption;
9798 edgeLabel?: SeriesLabelOption;
9799 itemStyle?: ItemStyleOption;
9800 lineStyle?: LineStyleOption;
9801 };
9802 select?: {
9803 label?: SeriesLabelOption;
9804 edgeLabel?: SeriesLabelOption;
9805 itemStyle?: ItemStyleOption;
9806 lineStyle?: LineStyleOption;
9807 };
9808 circular?: {
9809 rotateLabel?: boolean;
9810 };
9811 force?: {
9812 initLayout?: 'circular' | 'none';
9813 repulsion?: number | number[];
9814 gravity?: number;
9815 friction?: number;
9816 edgeLength?: number | number[];
9817 layoutAnimation?: boolean;
9818 };
9819}
9820
9821declare type GaugeColorStop = [number, ColorString];
9822interface LabelFormatter$1 {
9823 (value: number): string;
9824}
9825interface PointerOption {
9826 icon?: string;
9827 show?: boolean;
9828 /**
9829 * If pointer shows above title and detail
9830 */
9831 showAbove?: boolean;
9832 keepAspect?: boolean;
9833 itemStyle?: ItemStyleOption;
9834 /**
9835 * Can be percent
9836 */
9837 offsetCenter?: (number | string)[];
9838 length?: number | string;
9839 width?: number;
9840}
9841interface AnchorOption {
9842 show?: boolean;
9843 showAbove?: boolean;
9844 size?: number;
9845 icon?: string;
9846 offsetCenter?: (number | string)[];
9847 keepAspect?: boolean;
9848 itemStyle?: ItemStyleOption;
9849}
9850interface ProgressOption {
9851 show?: boolean;
9852 overlap?: boolean;
9853 width?: number;
9854 roundCap?: boolean;
9855 clip?: boolean;
9856 itemStyle?: ItemStyleOption;
9857}
9858interface TitleOption$1 extends LabelOption {
9859 /**
9860 * [x, y] offset
9861 */
9862 offsetCenter?: (number | string)[];
9863 formatter?: LabelFormatter$1 | string;
9864 /**
9865 * If do value animtion.
9866 */
9867 valueAnimation?: boolean;
9868}
9869interface DetailOption extends LabelOption {
9870 /**
9871 * [x, y] offset
9872 */
9873 offsetCenter?: (number | string)[];
9874 formatter?: LabelFormatter$1 | string;
9875 /**
9876 * If do value animtion.
9877 */
9878 valueAnimation?: boolean;
9879}
9880interface GaugeStatesMixin {
9881 emphasis?: DefaultStatesMixinEmpasis;
9882}
9883interface GaugeStateOption<TCbParams = never> {
9884 itemStyle?: ItemStyleOption<TCbParams>;
9885}
9886interface GaugeDataItemOption extends GaugeStateOption, StatesOptionMixin<GaugeStateOption<CallbackDataParams>, GaugeStatesMixin> {
9887 name?: string;
9888 value?: OptionDataValueNumeric;
9889 pointer?: PointerOption;
9890 progress?: ProgressOption;
9891 title?: TitleOption$1;
9892 detail?: DetailOption;
9893}
9894interface GaugeSeriesOption extends SeriesOption<GaugeStateOption, GaugeStatesMixin>, GaugeStateOption<CallbackDataParams>, CircleLayoutOptionMixin, SeriesEncodeOptionMixin {
9895 type?: 'gauge';
9896 radius?: number | string;
9897 startAngle?: number;
9898 endAngle?: number;
9899 clockwise?: boolean;
9900 min?: number;
9901 max?: number;
9902 splitNumber?: number;
9903 itemStyle?: ItemStyleOption;
9904 axisLine?: {
9905 show?: boolean;
9906 roundCap?: boolean;
9907 lineStyle?: Omit<LineStyleOption, 'color'> & {
9908 color?: GaugeColorStop[];
9909 };
9910 };
9911 progress?: ProgressOption;
9912 splitLine?: {
9913 show?: boolean;
9914 /**
9915 * Can be percent
9916 */
9917 length?: number;
9918 distance?: number;
9919 lineStyle?: LineStyleOption;
9920 };
9921 axisTick?: {
9922 show?: boolean;
9923 splitNumber?: number;
9924 /**
9925 * Can be percent
9926 */
9927 length?: number | string;
9928 distance?: number;
9929 lineStyle?: LineStyleOption;
9930 };
9931 axisLabel?: LabelOption & {
9932 formatter?: LabelFormatter$1 | string;
9933 };
9934 pointer?: PointerOption;
9935 anchor?: AnchorOption;
9936 title?: TitleOption$1;
9937 detail?: DetailOption;
9938 data?: (OptionDataValueNumeric | GaugeDataItemOption)[];
9939}
9940
9941declare type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
9942 position?: LabelOption['position'] | 'outer' | 'inner' | 'center' | 'rightTop' | 'rightBottom' | 'leftTop' | 'leftBottom';
9943};
9944interface FunnelStatesMixin {
9945 emphasis?: DefaultStatesMixinEmpasis;
9946}
9947interface FunnelCallbackDataParams extends CallbackDataParams {
9948 percent: number;
9949}
9950interface FunnelStateOption<TCbParams = never> {
9951 itemStyle?: ItemStyleOption<TCbParams>;
9952 label?: FunnelLabelOption;
9953 labelLine?: LabelLineOption;
9954}
9955interface FunnelDataItemOption extends FunnelStateOption, StatesOptionMixin<FunnelStateOption, FunnelStatesMixin>, OptionDataItemObject<OptionDataValueNumeric> {
9956 itemStyle?: ItemStyleOption & {
9957 width?: number | string;
9958 height?: number | string;
9959 };
9960}
9961interface FunnelSeriesOption extends SeriesOption<FunnelStateOption<FunnelCallbackDataParams>, FunnelStatesMixin>, FunnelStateOption<FunnelCallbackDataParams>, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
9962 type?: 'funnel';
9963 min?: number;
9964 max?: number;
9965 /**
9966 * Absolute number or percent string
9967 */
9968 minSize?: number | string;
9969 maxSize?: number | string;
9970 sort?: 'ascending' | 'descending' | 'none';
9971 orient?: LayoutOrient;
9972 gap?: number;
9973 funnelAlign?: HorizontalAlign | VerticalAlign;
9974 data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | FunnelDataItemOption)[];
9975}
9976
9977declare type ParallelSeriesDataValue = OptionDataValue[];
9978interface ParallelStatesMixin {
9979 emphasis?: DefaultStatesMixinEmpasis;
9980}
9981interface ParallelStateOption<TCbParams = never> {
9982 lineStyle?: LineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
9983 label?: SeriesLabelOption;
9984}
9985interface ParallelSeriesDataItemOption extends ParallelStateOption, StatesOptionMixin<ParallelStateOption, ParallelStatesMixin> {
9986 value?: ParallelSeriesDataValue[];
9987}
9988interface ParallelSeriesOption extends SeriesOption<ParallelStateOption<CallbackDataParams>, ParallelStatesMixin>, ParallelStateOption<CallbackDataParams>, SeriesEncodeOptionMixin {
9989 type?: 'parallel';
9990 coordinateSystem?: string;
9991 parallelIndex?: number;
9992 parallelId?: string;
9993 inactiveOpacity?: number;
9994 activeOpacity?: number;
9995 smooth?: boolean | number;
9996 realtime?: boolean;
9997 tooltip?: SeriesTooltipOption;
9998 parallelAxisDefault?: ParallelAxisOption;
9999 data?: (ParallelSeriesDataValue | ParallelSeriesDataItemOption)[];
10000}
10001
10002declare type FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges';
10003interface SankeyNodeStateOption<TCbParams = never> {
10004 label?: SeriesLabelOption;
10005 itemStyle?: ItemStyleOption<TCbParams>;
10006}
10007interface SankeyEdgeStateOption {
10008 lineStyle?: SankeyEdgeStyleOption;
10009}
10010interface SankeyBothStateOption<TCbParams> extends SankeyNodeStateOption<TCbParams>, SankeyEdgeStateOption {
10011}
10012interface SankeyEdgeStyleOption extends LineStyleOption {
10013 curveness?: number;
10014}
10015interface ExtraStateOption$2 {
10016 emphasis?: {
10017 focus?: DefaultEmphasisFocus | 'adjacency';
10018 };
10019}
10020interface SankeyNodeItemOption extends SankeyNodeStateOption, StatesOptionMixin<SankeyNodeStateOption, ExtraStateOption$2>, OptionDataItemObject<OptionDataValue> {
10021 id?: string;
10022 localX?: number;
10023 localY?: number;
10024 depth?: number;
10025 draggable?: boolean;
10026 focusNodeAdjacency?: FocusNodeAdjacency;
10027}
10028interface SankeyEdgeItemOption extends SankeyEdgeStateOption, StatesOptionMixin<SankeyEdgeStateOption, ExtraStateOption$2>, GraphEdgeItemObject<OptionDataValueNumeric> {
10029 focusNodeAdjacency?: FocusNodeAdjacency;
10030}
10031interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStateOption {
10032 depth: number;
10033}
10034interface SankeySeriesOption extends SeriesOption<SankeyBothStateOption<CallbackDataParams>, ExtraStateOption$2>, SankeyBothStateOption<CallbackDataParams>, BoxLayoutOptionMixin {
10035 type?: 'sankey';
10036 /**
10037 * color will be linear mapped.
10038 */
10039 color?: ColorString[];
10040 coordinateSystem?: 'view';
10041 orient?: LayoutOrient;
10042 /**
10043 * The width of the node
10044 */
10045 nodeWidth?: number;
10046 /**
10047 * The vertical distance between two nodes
10048 */
10049 nodeGap?: number;
10050 /**
10051 * Control if the node can move or not
10052 */
10053 draggable?: boolean;
10054 /**
10055 * Will be allEdges if true.
10056 * @deprecated
10057 */
10058 focusNodeAdjacency?: FocusNodeAdjacency;
10059 /**
10060 * The number of iterations to change the position of the node
10061 */
10062 layoutIterations?: number;
10063 nodeAlign?: 'justify' | 'left' | 'right';
10064 data?: SankeyNodeItemOption[];
10065 nodes?: SankeyNodeItemOption[];
10066 edges?: SankeyEdgeItemOption[];
10067 links?: SankeyEdgeItemOption[];
10068 levels?: SankeyLevelOption[];
10069}
10070
10071declare type BoxplotDataValue = OptionDataValueNumeric[];
10072interface BoxplotStateOption<TCbParams = never> {
10073 itemStyle?: ItemStyleOption<TCbParams>;
10074 label?: SeriesLabelOption;
10075}
10076interface BoxplotDataItemOption extends BoxplotStateOption, StatesOptionMixin<BoxplotStateOption, ExtraStateOption$3> {
10077 value: BoxplotDataValue;
10078}
10079interface ExtraStateOption$3 {
10080 emphasis?: {
10081 focus?: DefaultEmphasisFocus;
10082 scale?: boolean;
10083 };
10084}
10085interface BoxplotSeriesOption extends SeriesOption<BoxplotStateOption<CallbackDataParams>, ExtraStateOption$3>, BoxplotStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {
10086 type?: 'boxplot';
10087 coordinateSystem?: 'cartesian2d';
10088 layout?: LayoutOrient;
10089 /**
10090 * [min, max] can be percent of band width.
10091 */
10092 boxWidth?: (string | number)[];
10093 data?: (BoxplotDataValue | BoxplotDataItemOption)[];
10094}
10095
10096declare type CandlestickDataValue = OptionDataValue[];
10097interface CandlestickItemStyleOption extends ItemStyleOption {
10098 color0?: ZRColor;
10099 borderColor0?: ColorString;
10100}
10101interface CandlestickStateOption {
10102 itemStyle?: CandlestickItemStyleOption;
10103 label?: SeriesLabelOption;
10104}
10105interface CandlestickDataItemOption extends CandlestickStateOption, StatesOptionMixin<CandlestickStateOption, ExtraStateOption$4> {
10106 value: CandlestickDataValue;
10107}
10108interface ExtraStateOption$4 {
10109 emphasis?: {
10110 focus?: DefaultEmphasisFocus;
10111 scale?: boolean;
10112 };
10113}
10114interface CandlestickSeriesOption extends SeriesOption<CandlestickStateOption, ExtraStateOption$4>, CandlestickStateOption, SeriesOnCartesianOptionMixin, SeriesLargeOptionMixin, SeriesEncodeOptionMixin {
10115 type?: 'candlestick';
10116 coordinateSystem?: 'cartesian2d';
10117 layout?: LayoutOrient;
10118 clip?: boolean;
10119 barMaxWidth?: number | string;
10120 barMinWidth?: number | string;
10121 barWidth?: number | string;
10122 data?: (CandlestickDataValue | CandlestickDataItemOption)[];
10123}
10124
10125interface RippleEffectOption {
10126 period?: number;
10127 /**
10128 * Scale of ripple
10129 */
10130 scale?: number;
10131 brushType?: 'fill' | 'stroke';
10132 color?: ZRColor;
10133 /**
10134 * ripple number
10135 */
10136 number?: number;
10137}
10138interface SymbolDrawStateOption {
10139 itemStyle?: ItemStyleOption;
10140 label?: LabelOption;
10141}
10142interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>, StatesOptionMixin<SymbolDrawStateOption, {
10143 emphasis?: {
10144 focus?: DefaultEmphasisFocus;
10145 scale?: boolean;
10146 };
10147}>, SymbolDrawStateOption {
10148 cursor?: string;
10149 rippleEffect?: RippleEffectOption;
10150}
10151
10152declare type ScatterDataValue = OptionDataValue | OptionDataValue[];
10153interface EffectScatterStatesOptionMixin {
10154 emphasis?: {
10155 focus?: DefaultEmphasisFocus;
10156 scale?: boolean;
10157 };
10158}
10159interface EffectScatterStateOption<TCbParams = never> {
10160 itemStyle?: ItemStyleOption<TCbParams>;
10161 label?: SeriesLabelOption;
10162}
10163interface EffectScatterDataItemOption extends SymbolOptionMixin, EffectScatterStateOption, StatesOptionMixin<EffectScatterStateOption, EffectScatterStatesOptionMixin> {
10164 name?: string;
10165 value?: ScatterDataValue;
10166 rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
10167}
10168interface EffectScatterSeriesOption extends SeriesOption<EffectScatterStateOption<CallbackDataParams>, EffectScatterStatesOptionMixin>, EffectScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
10169 type?: 'effectScatter';
10170 coordinateSystem?: string;
10171 effectType?: 'ripple';
10172 /**
10173 * When to show the effect
10174 */
10175 showEffectOn?: 'render' | 'emphasis';
10176 clip?: boolean;
10177 /**
10178 * Ripple effect config
10179 */
10180 rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
10181 data?: (EffectScatterDataItemOption | ScatterDataValue)[];
10182}
10183
10184interface LineDrawStateOption {
10185 lineStyle?: LineStyleOption;
10186 label?: LineLabelOption;
10187}
10188interface LineDrawModelOption extends LineDrawStateOption, StatesOptionMixin<LineDrawStateOption, StatesMixinBase> {
10189 effect?: {
10190 show?: boolean;
10191 period?: number;
10192 delay?: number | ((idx: number) => number);
10193 /**
10194 * If move with constant speed px/sec
10195 * period will be ignored if this property is > 0,
10196 */
10197 constantSpeed?: number;
10198 symbol?: string;
10199 symbolSize?: number | number[];
10200 loop?: boolean;
10201 /**
10202 * Length of trail, 0 - 1
10203 */
10204 trailLength?: number;
10205 /**
10206 * Default to be same with lineStyle.color
10207 */
10208 color?: ColorString;
10209 };
10210}
10211
10212declare type LinesCoords = number[][];
10213declare type LinesValue = OptionDataValue | OptionDataValue[];
10214interface LinesLineStyleOption<TClr> extends LineStyleOption<TClr> {
10215 curveness?: number;
10216}
10217interface LinesStatesMixin {
10218 emphasis?: DefaultStatesMixinEmpasis;
10219}
10220interface LinesStateOption<TCbParams = never> {
10221 lineStyle?: LinesLineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
10222 label?: SeriesLineLabelOption;
10223}
10224interface LinesDataItemOption extends LinesStateOption<CallbackDataParams>, StatesOptionMixin<LinesStateOption<CallbackDataParams>, LinesStatesMixin> {
10225 name?: string;
10226 fromName?: string;
10227 toName?: string;
10228 symbol?: string[] | string;
10229 symbolSize?: number[] | number;
10230 coords?: LinesCoords;
10231 value?: LinesValue;
10232 effect?: LineDrawModelOption['effect'];
10233}
10234interface LinesSeriesOption extends SeriesOption<LinesStateOption, LinesStatesMixin>, LinesStateOption, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {
10235 type?: 'lines';
10236 coordinateSystem?: string;
10237 symbol?: string[] | string;
10238 symbolSize?: number[] | number;
10239 effect?: LineDrawModelOption['effect'];
10240 /**
10241 * If lines are polyline
10242 * polyline not support curveness, label, animation
10243 */
10244 polyline?: boolean;
10245 /**
10246 * If clip the overflow.
10247 * Available when coordinateSystem is cartesian or polar.
10248 */
10249 clip?: boolean;
10250 data?: LinesDataItemOption[] | ArrayLike<number>;
10251 dimensions?: DimensionDefinitionLoose | DimensionDefinitionLoose[];
10252}
10253
10254declare type HeatmapDataValue = OptionDataValue[];
10255interface HeatmapStateOption<TCbParams = never> {
10256 itemStyle?: ItemStyleOption<TCbParams>;
10257 label?: SeriesLabelOption;
10258}
10259interface FunnelStatesMixin$1 {
10260 emphasis?: DefaultStatesMixinEmpasis;
10261}
10262interface HeatmapDataItemOption extends HeatmapStateOption, StatesOptionMixin<HeatmapStateOption, FunnelStatesMixin$1> {
10263 value: HeatmapDataValue;
10264}
10265interface HeatmapSeriesOption extends SeriesOption<HeatmapStateOption<CallbackDataParams>, FunnelStatesMixin$1>, HeatmapStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin, SeriesEncodeOptionMixin {
10266 type?: 'heatmap';
10267 coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar';
10268 blurSize?: number;
10269 pointSize?: number;
10270 maxOpacity?: number;
10271 minOpacity?: number;
10272 data?: (HeatmapDataItemOption | HeatmapDataValue)[];
10273}
10274
10275interface PictorialBarStateOption {
10276 itemStyle?: ItemStyleOption;
10277 label?: SeriesLabelOption;
10278}
10279interface PictorialBarSeriesSymbolOption {
10280 /**
10281 * Customized bar shape
10282 */
10283 symbol?: string;
10284 /**
10285 * Can be ['100%', '100%'], null means auto.
10286 * The percent will be relative to category width. If no repeat.
10287 * Will be relative to symbolBoundingData.
10288 */
10289 symbolSize?: (number | string)[] | number | string;
10290 symbolRotate?: number;
10291 /**
10292 * Default to be auto
10293 */
10294 symbolPosition?: 'start' | 'end' | 'center';
10295 /**
10296 * Can be percent offset relative to the symbolSize
10297 */
10298 symbolOffset?: (number | string)[] | number | string;
10299 /**
10300 * start margin and end margin. Can be a number or a percent string relative to symbolSize.
10301 * Auto margin by default.
10302 */
10303 symbolMargin?: (number | string)[] | number | string;
10304 /**
10305 * true: means auto calculate repeat times and cut by data.
10306 * a number: specifies repeat times, and do not cut by data.
10307 * 'fixed': means auto calculate repeat times but do not cut by data.
10308 *
10309 * Otherwise means no repeat
10310 */
10311 symbolRepeat?: boolean | number | 'fixed';
10312 /**
10313 * From start to end or end to start.
10314 */
10315 symbolRepeatDirection?: 'start' | 'end';
10316 symbolClip?: boolean;
10317 /**
10318 * It will define the size of graphic elements.
10319 */
10320 symbolBoundingData?: number | number[];
10321 symbolPatternSize?: number;
10322}
10323interface ExtraStateOption$5 {
10324 emphasis?: {
10325 focus?: DefaultEmphasisFocus;
10326 scale?: boolean;
10327 };
10328}
10329interface PictorialBarDataItemOption extends PictorialBarSeriesSymbolOption, AnimationOptionMixin, PictorialBarStateOption, StatesOptionMixin<PictorialBarStateOption, ExtraStateOption$5>, OptionDataItemObject<OptionDataValue> {
10330 z?: number;
10331 cursor?: string;
10332}
10333interface PictorialBarSeriesOption extends BaseBarSeriesOption<PictorialBarStateOption, ExtraStateOption$5>, PictorialBarStateOption, PictorialBarSeriesSymbolOption, SeriesStackOptionMixin {
10334 type?: 'pictorialBar';
10335 coordinateSystem?: 'cartesian2d';
10336 data?: (PictorialBarDataItemOption | OptionDataValue | OptionDataValue[])[];
10337}
10338
10339interface ThemeRiverSeriesLabelOption extends SeriesLabelOption {
10340 margin?: number;
10341}
10342declare type ThemerRiverDataItem = [OptionDataValueDate, OptionDataValueNumeric, string];
10343interface ThemeRiverStatesMixin {
10344 emphasis?: DefaultStatesMixinEmpasis;
10345}
10346interface ThemeRiverStateOption<TCbParams = never> {
10347 label?: ThemeRiverSeriesLabelOption;
10348 itemStyle?: ItemStyleOption<TCbParams>;
10349}
10350interface ThemeRiverSeriesOption extends SeriesOption<ThemeRiverStateOption<CallbackDataParams>, ThemeRiverStatesMixin>, ThemeRiverStateOption<CallbackDataParams>, SeriesOnSingleOptionMixin, BoxLayoutOptionMixin {
10351 type?: 'themeRiver';
10352 color?: ZRColor[];
10353 coordinateSystem?: 'singleAxis';
10354 /**
10355 * gap in axis's orthogonal orientation
10356 */
10357 boundaryGap?: (string | number)[];
10358 /**
10359 * [date, value, name]
10360 */
10361 data?: ThemerRiverDataItem[];
10362}
10363
10364interface SunburstItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
10365 borderRadius?: (number | string)[] | number | string;
10366}
10367interface SunburstLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
10368 rotate?: 'radial' | 'tangential' | number;
10369 minAngle?: number;
10370 silent?: boolean;
10371 position?: SeriesLabelOption['position'] | 'outside';
10372}
10373interface SunburstStatesMixin {
10374 emphasis?: {
10375 focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
10376 };
10377}
10378interface SunburstStateOption<TCbParams = never> {
10379 itemStyle?: SunburstItemStyleOption<TCbParams>;
10380 label?: SunburstLabelOption;
10381}
10382interface SunburstSeriesLevelOption extends SunburstStateOption, StatesOptionMixin<SunburstStateOption, SunburstStatesMixin> {
10383 radius?: (number | string)[];
10384 /**
10385 * @deprecated use radius instead
10386 */
10387 r?: number | string;
10388 /**
10389 * @deprecated use radius instead
10390 */
10391 r0?: number | string;
10392 highlight?: {
10393 itemStyle?: SunburstItemStyleOption;
10394 label?: SunburstLabelOption;
10395 };
10396}
10397interface SortParam {
10398 dataIndex: number;
10399 depth: number;
10400 height: number;
10401 getValue(): number;
10402}
10403interface SunburstSeriesOption extends SeriesOption<SunburstStateOption, SunburstStatesMixin>, SunburstStateOption, SunburstColorByMixin, CircleLayoutOptionMixin {
10404 type?: 'sunburst';
10405 clockwise?: boolean;
10406 startAngle?: number;
10407 minAngle?: number;
10408 /**
10409 * If still show when all data zero.
10410 */
10411 stillShowZeroSum?: boolean;
10412 /**
10413 * Policy of highlighting pieces when hover on one
10414 * Valid values: 'none' (for not downplay others), 'descendant',
10415 * 'ancestor', 'self'
10416 */
10417 nodeClick?: 'rootToNode' | 'link';
10418 renderLabelForZeroData?: boolean;
10419 levels?: SunburstSeriesLevelOption[];
10420 animationType?: 'expansion' | 'scale';
10421 sort?: 'desc' | 'asc' | ((a: SortParam, b: SortParam) => number);
10422}
10423
10424declare const TRANSFORM_PROPS$1: {
10425 readonly x: 1;
10426 readonly y: 1;
10427 readonly scaleX: 1;
10428 readonly scaleY: 1;
10429 readonly originX: 1;
10430 readonly originY: 1;
10431 readonly rotation: 1;
10432};
10433declare type TransformProp$1 = keyof typeof TRANSFORM_PROPS$1;
10434interface GraphicComponentBaseElementOption extends Partial<Pick<Element, TransformProp$1 | 'silent' | 'ignore' | 'draggable' | 'textConfig' | 'onclick' | 'ondblclick' | 'onmouseover' | 'onmouseout' | 'onmousemove' | 'onmousewheel' | 'onmousedown' | 'onmouseup' | 'oncontextmenu' | 'ondrag' | 'ondragstart' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondrop'>>,
10435/**
10436 * left/right/top/bottom: (like 12, '22%', 'center', default undefined)
10437 * If left/rigth is set, shape.x/shape.cx/position will not be used.
10438 * If top/bottom is set, shape.y/shape.cy/position will not be used.
10439 * This mechanism is useful when you want to position a group/element
10440 * against the right side or the center of this container.
10441 */
10442Partial<Pick<BoxLayoutOptionMixin, 'left' | 'right' | 'top' | 'bottom'>> {
10443 /**
10444 * element type, mandatory.
10445 * Only can be omit if call setOption not at the first time and perform merge.
10446 */
10447 type?: string;
10448 id?: OptionId;
10449 name?: string;
10450 parentId?: OptionId;
10451 parentOption?: GraphicComponentElementOption;
10452 children?: GraphicComponentElementOption[];
10453 hv?: [boolean, boolean];
10454 /**
10455 * bounding: (enum: 'all' (default) | 'raw')
10456 * Specify how to calculate boundingRect when locating.
10457 * 'all': Get uioned and transformed boundingRect
10458 * from both itself and its descendants.
10459 * This mode simplies confining a group of elements in the bounding
10460 * of their ancester container (e.g., using 'right: 0').
10461 * 'raw': Only use the boundingRect of itself and before transformed.
10462 * This mode is similar to css behavior, which is useful when you
10463 * want an element to be able to overflow its container. (Consider
10464 * a rotated circle needs to be located in a corner.)
10465 */
10466 bounding?: 'raw' | 'all';
10467 /**
10468 * info: custom info. enables user to mount some info on elements and use them
10469 * in event handlers. Update them only when user specified, otherwise, remain.
10470 */
10471 info?: GraphicExtraElementInfo;
10472 textContent?: GraphicComponentTextOption;
10473 textConfig?: ElementTextConfig;
10474 $action?: 'merge' | 'replace' | 'remove';
10475 tooltip?: CommonTooltipOption<unknown>;
10476}
10477interface GraphicComponentDisplayableOption extends GraphicComponentBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible' | 'cursor'>> {
10478 style?: ZRStyleProps;
10479}
10480interface GraphicComponentGroupOption extends GraphicComponentBaseElementOption {
10481 type?: 'group';
10482 /**
10483 * width/height: (can only be pixel value, default 0)
10484 * Only be used to specify contianer(group) size, if needed. And
10485 * can not be percentage value (like '33%'). See the reason in the
10486 * layout algorithm below.
10487 */
10488 width?: number;
10489 height?: number;
10490 children: GraphicComponentElementOption[];
10491}
10492interface GraphicComponentZRPathOption extends GraphicComponentDisplayableOption {
10493 shape?: PathProps['shape'];
10494}
10495interface GraphicComponentImageOption extends GraphicComponentDisplayableOption {
10496 type?: 'image';
10497 style?: ImageStyleProps;
10498}
10499interface GraphicComponentTextOption extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'> {
10500 type?: 'text';
10501 style?: TextStyleProps;
10502}
10503declare type GraphicComponentElementOption = GraphicComponentGroupOption | GraphicComponentZRPathOption | GraphicComponentImageOption | GraphicComponentTextOption;
10504declare type GraphicExtraElementInfo = Dictionary<unknown>;
10505declare type GraphicComponentLooseOption = (GraphicComponentOption | GraphicComponentElementOption) & {
10506 mainType?: 'graphic';
10507};
10508interface GraphicComponentOption extends ComponentOption {
10509 elements?: GraphicComponentElementOption[];
10510}
10511
10512declare const ICON_TYPES: readonly ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
10513declare type IconType = typeof ICON_TYPES[number];
10514interface ToolboxBrushFeatureOption extends ToolboxFeatureOption {
10515 type?: IconType[];
10516 icon?: {
10517 [key in IconType]?: string;
10518 };
10519 title?: {
10520 [key in IconType]?: string;
10521 };
10522}
10523
10524interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {
10525 readOnly?: boolean;
10526 optionToContent?: (option: ECUnitOption) => string | HTMLElement;
10527 contentToOption?: (viewMain: HTMLDivElement, oldOption: ECUnitOption) => ECUnitOption;
10528 icon?: string;
10529 title?: string;
10530 lang?: string[];
10531 backgroundColor?: ColorString;
10532 textColor?: ColorString;
10533 textareaColor?: ColorString;
10534 textareaBorderColor?: ColorString;
10535 buttonColor?: ColorString;
10536 buttonTextColor?: ColorString;
10537}
10538
10539declare const ICON_TYPES$1: readonly ["zoom", "back"];
10540declare type IconType$1 = typeof ICON_TYPES$1[number];
10541interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
10542 type?: IconType$1[];
10543 icon?: {
10544 [key in IconType$1]?: string;
10545 };
10546 title?: {
10547 [key in IconType$1]?: string;
10548 };
10549 filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
10550 xAxisIndex?: ModelFinderIndexQuery;
10551 yAxisIndex?: ModelFinderIndexQuery;
10552 xAxisId?: ModelFinderIdQuery;
10553 yAxisId?: ModelFinderIdQuery;
10554 brushStyle?: ItemStyleOption;
10555}
10556
10557declare const ICON_TYPES$2: readonly ["line", "bar", "stack"];
10558declare const TITLE_TYPES: readonly ["line", "bar", "stack", "tiled"];
10559declare type IconType$2 = typeof ICON_TYPES$2[number];
10560declare type TitleType = typeof TITLE_TYPES[number];
10561interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {
10562 type?: IconType$2[];
10563 /**
10564 * Icon group
10565 */
10566 icon?: {
10567 [key in IconType$2]?: string;
10568 };
10569 title?: {
10570 [key in TitleType]?: string;
10571 };
10572 option?: {
10573 [key in IconType$2]?: SeriesOption;
10574 };
10575 /**
10576 * Map of seriesType: seriesIndex
10577 */
10578 seriesIndex?: {
10579 line?: number;
10580 bar?: number;
10581 };
10582}
10583
10584interface ToolboxRestoreFeatureOption extends ToolboxFeatureOption {
10585 icon?: string;
10586 title?: string;
10587}
10588
10589interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
10590 icon?: string;
10591 title?: string;
10592 type?: 'png' | 'jpg';
10593 backgroundColor?: ZRColor;
10594 connectedBackgroundColor?: ZRColor;
10595 name?: string;
10596 excludeComponents?: string[];
10597 pixelRatio?: number;
10598 lang?: string[];
10599}
10600
10601interface ToolboxComponentOption extends ToolboxOption {
10602 feature?: {
10603 brush?: ToolboxBrushFeatureOption;
10604 dataView?: ToolboxDataViewFeatureOption;
10605 dataZoom?: ToolboxDataZoomFeatureOption;
10606 magicType?: ToolboxMagicTypeFeatureOption;
10607 restore?: ToolboxRestoreFeatureOption;
10608 saveAsImage?: ToolboxSaveAsImageFeatureOption;
10609 [key: string]: ToolboxFeatureOption | {
10610 [key: string]: any;
10611 } | undefined;
10612 };
10613}
10614
10615declare type DataZoomComponentOption = SliderDataZoomOption | InsideDataZoomOption;
10616
10617declare type VisualMapComponentOption = ContinousVisualMapOption | PiecewiseVisualMapOption;
10618
10619declare type LegendComponentOption = LegendOption | ScrollableLegendOption;
10620
10621declare type SeriesInjectedOption = {
10622 markArea?: MarkAreaOption;
10623 markLine?: MarkLineOption;
10624 markPoint?: MarkPointOption;
10625 tooltip?: SeriesTooltipOption;
10626};
10627declare type LineSeriesOption$1 = LineSeriesOption & SeriesInjectedOption;
10628declare type BarSeriesOption$1 = BarSeriesOption & SeriesInjectedOption;
10629declare type ScatterSeriesOption$1 = ScatterSeriesOption & SeriesInjectedOption;
10630declare type PieSeriesOption$1 = PieSeriesOption & SeriesInjectedOption;
10631declare type RadarSeriesOption$1 = RadarSeriesOption & SeriesInjectedOption;
10632declare type MapSeriesOption$1 = MapSeriesOption & SeriesInjectedOption;
10633declare type TreeSeriesOption$1 = TreeSeriesOption & SeriesInjectedOption;
10634declare type TreemapSeriesOption$1 = TreemapSeriesOption & SeriesInjectedOption;
10635declare type GraphSeriesOption$1 = GraphSeriesOption & SeriesInjectedOption;
10636declare type GaugeSeriesOption$1 = GaugeSeriesOption & SeriesInjectedOption;
10637declare type FunnelSeriesOption$1 = FunnelSeriesOption & SeriesInjectedOption;
10638declare type ParallelSeriesOption$1 = ParallelSeriesOption & SeriesInjectedOption;
10639declare type SankeySeriesOption$1 = SankeySeriesOption & SeriesInjectedOption;
10640declare type BoxplotSeriesOption$1 = BoxplotSeriesOption & SeriesInjectedOption;
10641declare type CandlestickSeriesOption$1 = CandlestickSeriesOption & SeriesInjectedOption;
10642declare type EffectScatterSeriesOption$1 = EffectScatterSeriesOption & SeriesInjectedOption;
10643declare type LinesSeriesOption$1 = LinesSeriesOption & SeriesInjectedOption;
10644declare type HeatmapSeriesOption$1 = HeatmapSeriesOption & SeriesInjectedOption;
10645declare type PictorialBarSeriesOption$1 = PictorialBarSeriesOption & SeriesInjectedOption;
10646declare type ThemeRiverSeriesOption$1 = ThemeRiverSeriesOption & SeriesInjectedOption;
10647declare type SunburstSeriesOption$1 = SunburstSeriesOption & SeriesInjectedOption;
10648declare type CustomSeriesOption$1 = CustomSeriesOption & SeriesInjectedOption;
10649/**
10650 * A map from series 'type' to series option
10651 * It's used for declaration merging in echarts extensions.
10652 * For example:
10653 * ```ts
10654 * import echarts from 'echarts';
10655 * declare module 'echarts/types/dist/echarts' {
10656 * interface RegisteredSeriesOption {
10657 * wordCloud: WordCloudSeriesOption
10658 * }
10659 * }
10660 * ```
10661 */
10662interface RegisteredSeriesOption {
10663 line: LineSeriesOption$1;
10664 bar: BarSeriesOption$1;
10665 scatter: ScatterSeriesOption$1;
10666 pie: PieSeriesOption$1;
10667 radar: RadarSeriesOption$1;
10668 map: MapSeriesOption$1;
10669 tree: TreeSeriesOption$1;
10670 treemap: TreemapSeriesOption$1;
10671 graph: GraphSeriesOption$1;
10672 gauge: GaugeSeriesOption$1;
10673 funnel: FunnelSeriesOption$1;
10674 parallel: ParallelSeriesOption$1;
10675 sankey: SankeySeriesOption$1;
10676 boxplot: BoxplotSeriesOption$1;
10677 candlestick: CandlestickSeriesOption$1;
10678 effectScatter: EffectScatterSeriesOption$1;
10679 lines: LinesSeriesOption$1;
10680 heatmap: HeatmapSeriesOption$1;
10681 pictorialBar: PictorialBarSeriesOption$1;
10682 themeRiver: ThemeRiverSeriesOption$1;
10683 sunburst: SunburstSeriesOption$1;
10684 custom: CustomSeriesOption$1;
10685}
10686declare type Values<T> = T[keyof T];
10687declare type SeriesOption$1 = Values<RegisteredSeriesOption>;
10688interface EChartsOption extends ECBasicOption {
10689 dataset?: DatasetOption | DatasetOption[];
10690 aria?: AriaOption;
10691 title?: TitleOption | TitleOption[];
10692 grid?: GridOption | GridOption[];
10693 radar?: RadarOption | RadarOption[];
10694 polar?: PolarOption | PolarOption[];
10695 geo?: GeoOption | GeoOption[];
10696 angleAxis?: AngleAxisOption | AngleAxisOption[];
10697 radiusAxis?: RadiusAxisOption | RadiusAxisOption[];
10698 xAxis?: XAXisOption | XAXisOption[];
10699 yAxis?: YAXisOption | YAXisOption[];
10700 singleAxis?: SingleAxisOption | SingleAxisOption[];
10701 parallel?: ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[];
10702 parallelAxis?: ParallelAxisOption | ParallelAxisOption[];
10703 calendar?: CalendarOption | CalendarOption[];
10704 toolbox?: ToolboxComponentOption | ToolboxComponentOption[];
10705 tooltip?: TooltipOption | TooltipOption[];
10706 axisPointer?: AxisPointerOption | AxisPointerOption[];
10707 brush?: BrushOption | BrushOption[];
10708 timeline?: TimelineOption | SliderTimelineOption;
10709 legend?: LegendComponentOption | (LegendComponentOption)[];
10710 dataZoom?: DataZoomComponentOption | (DataZoomComponentOption)[];
10711 visualMap?: VisualMapComponentOption | (VisualMapComponentOption)[];
10712 graphic?: GraphicComponentLooseOption | GraphicComponentLooseOption[];
10713 series?: SeriesOption$1 | SeriesOption$1[];
10714 options?: EChartsOption[];
10715 baseOption?: EChartsOption;
10716}
10717
10718export { AngleAxisOption as AngleAxisComponentOption, AnimationDelayCallback, AnimationDelayCallbackParam as AnimationDelayCallbackParams, AnimationDurationCallback, AriaOption as AriaComponentOption, Axis, AxisPointerOption as AxisPointerComponentOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption as BrushComponentOption, CalendarOption as CalendarComponentOption, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ZRColor as Color, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption as ContinousVisualMapComponentOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption as DatasetComponentOption, CallbackDataParams as DefaultLabelFormatterCallbackParams, EChartsType as ECharts, ECBasicOption as EChartsCoreOption, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption as GeoComponentOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption as GraphicComponentOption, GridOption as GridComponentOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, ImagePatternObject, InsideDataZoomOption as InsideDataZoomComponentOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesSeriesOption$1 as LinesSeriesOption, SeriesData as List, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption as MarkAreaComponentOption, MarkLineOption as MarkLineComponentOption, MarkPointOption as MarkPointComponentOption, Model, PRIORITY, ParallelCoordinateSystemOption as ParallelComponentOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption as PiecewiseVisualMapComponentOption, LegendOption as PlainLegendComponentOption, PolarOption as PolarComponentOption, RadarOption as RadarComponentOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption as RadiusAxisComponentOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption as ScrollableLegendComponentOption, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption as SingleAxisComponentOption, SliderDataZoomOption as SliderDataZoomComponentOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption as TimelineComponentOption, TitleOption as TitleComponentOption, ToolboxComponentOption, TooltipFormatterCallback as TooltipComponentFormatterCallback, TopLevelFormatterParams as TooltipComponentFormatterCallbackParams, TooltipOption as TooltipComponentOption, TooltipPositionCallback as TooltipComponentPositionCallback, TooltipPositionCallbackParams as TooltipComponentPositionCallbackParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption as XAXisComponentOption, YAXisOption as YAXisComponentOption, color_d as color, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d as graphic, helper_d as helper, init$1 as init, brushSingle as innerDrawElementOnCanvas, matrix_d as matrix, number_d as number, parseGeoJSON, parseGeoJSON as parseGeoJson, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, throttle, time_d as time, use, util_d$1 as util, vector_d as vector, version$1 as version, util_d as zrUtil, zrender_d as zrender };
\No newline at end of file