UNPKG

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