UNPKG

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