UNPKG

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