declare type VectorArray = number[]; declare function create$1(x?: number, y?: number): VectorArray; declare function copy$1(out: T, v: VectorArray): T; declare function clone$2(v: VectorArray): VectorArray; declare function set(out: T, a: number, b: number): T; declare function add(out: T, v1: VectorArray, v2: VectorArray): T; declare function scaleAndAdd(out: T, v1: VectorArray, v2: VectorArray, a: number): T; declare function sub(out: T, v1: VectorArray, v2: VectorArray): T; declare function len(v: VectorArray): number; declare const length: typeof len; declare function lenSquare(v: VectorArray): number; declare const lengthSquare: typeof lenSquare; declare function mul$1(out: T, v1: VectorArray, v2: VectorArray): T; declare function div(out: T, v1: VectorArray, v2: VectorArray): T; declare function dot(v1: VectorArray, v2: VectorArray): number; declare function scale$1(out: T, v: VectorArray, s: number): T; declare function normalize(out: T, v: VectorArray): T; declare function distance(v1: VectorArray, v2: VectorArray): number; declare const dist: typeof distance; declare function distanceSquare(v1: VectorArray, v2: VectorArray): number; declare const distSquare: typeof distanceSquare; declare function negate(out: T, v: VectorArray): T; declare function lerp(out: T, v1: VectorArray, v2: VectorArray, t: number): T; declare function applyTransform(out: T, v: VectorArray, m: MatrixArray): T; declare function min(out: T, v1: VectorArray, v2: VectorArray): T; declare function max(out: T, v1: VectorArray, v2: VectorArray): T; type vector_d_VectorArray = VectorArray; declare const vector_d_add: typeof add; declare const vector_d_applyTransform: typeof applyTransform; declare const vector_d_dist: typeof dist; declare const vector_d_distSquare: typeof distSquare; declare const vector_d_distance: typeof distance; declare const vector_d_distanceSquare: typeof distanceSquare; declare const vector_d_div: typeof div; declare const vector_d_dot: typeof dot; declare const vector_d_len: typeof len; declare const vector_d_lenSquare: typeof lenSquare; declare const vector_d_length: typeof length; declare const vector_d_lengthSquare: typeof lengthSquare; declare const vector_d_lerp: typeof lerp; declare const vector_d_max: typeof max; declare const vector_d_min: typeof min; declare const vector_d_negate: typeof negate; declare const vector_d_normalize: typeof normalize; declare const vector_d_scaleAndAdd: typeof scaleAndAdd; declare const vector_d_set: typeof set; declare const vector_d_sub: typeof sub; declare namespace vector_d { export { type vector_d_VectorArray as VectorArray, vector_d_add as add, vector_d_applyTransform as applyTransform, clone$2 as clone, copy$1 as copy, create$1 as create, vector_d_dist as dist, vector_d_distSquare as distSquare, vector_d_distance as distance, vector_d_distanceSquare as distanceSquare, vector_d_div as div, vector_d_dot as dot, vector_d_len as len, vector_d_lenSquare as lenSquare, vector_d_length as length, vector_d_lengthSquare as lengthSquare, vector_d_lerp as lerp, vector_d_max as max, vector_d_min as min, mul$1 as mul, vector_d_negate as negate, vector_d_normalize as normalize, scale$1 as scale, vector_d_scaleAndAdd as scaleAndAdd, vector_d_set as set, vector_d_sub as sub }; } declare type MatrixArray = number[]; declare function create(): MatrixArray; declare function identity(out: MatrixArray): MatrixArray; declare function copy(out: MatrixArray, m: MatrixArray): MatrixArray; declare function mul(out: MatrixArray, m1: MatrixArray, m2: MatrixArray): MatrixArray; declare function translate(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray; declare function rotate(out: MatrixArray, a: MatrixArray, rad: number, pivot?: VectorArray): MatrixArray; declare function scale(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray; declare function invert(out: MatrixArray, a: MatrixArray): MatrixArray | null; declare function clone$1(a: MatrixArray): MatrixArray; type matrix_d_MatrixArray = MatrixArray; declare const matrix_d_copy: typeof copy; declare const matrix_d_create: typeof create; declare const matrix_d_identity: typeof identity; declare const matrix_d_invert: typeof invert; declare const matrix_d_mul: typeof mul; declare const matrix_d_rotate: typeof rotate; declare const matrix_d_scale: typeof scale; declare const matrix_d_translate: typeof translate; declare namespace matrix_d { export { type matrix_d_MatrixArray as MatrixArray, clone$1 as clone, matrix_d_copy as copy, matrix_d_create as create, matrix_d_identity as identity, matrix_d_invert as invert, matrix_d_mul as mul, matrix_d_rotate as rotate, matrix_d_scale as scale, matrix_d_translate as translate }; } interface PointLike { x: number; y: number; } declare class Point { x: number; y: number; constructor(x?: number, y?: number); copy(other: PointLike): this; clone(): Point; set(x: number, y: number): this; equal(other: PointLike): boolean; add(other: PointLike): this; scale(scalar: number): void; scaleAndAdd(other: PointLike, scalar: number): void; sub(other: PointLike): this; dot(other: PointLike): number; len(): number; lenSquare(): number; normalize(): this; distance(other: PointLike): number; distanceSquare(other: Point): number; negate(): this; transform(m: MatrixArray): this; toArray(out: number[]): number[]; fromArray(input: number[]): void; static set(p: PointLike, x: number, y: number): void; static copy(p: PointLike, p2: PointLike): void; static len(p: PointLike): number; static lenSquare(p: PointLike): number; static dot(p0: PointLike, p1: PointLike): number; static add(out: PointLike, p0: PointLike, p1: PointLike): void; static sub(out: PointLike, p0: PointLike, p1: PointLike): void; static scale(out: PointLike, p0: PointLike, scalar: number): void; static scaleAndAdd(out: PointLike, p0: PointLike, p1: PointLike, scalar: number): void; static lerp(out: PointLike, p0: PointLike, p1: PointLike, t: number): void; } declare class BoundingRect { x: number; y: number; width: number; height: number; constructor(x: number, y: number, width: number, height: number); union(other: BoundingRect): void; applyTransform(m: MatrixArray): void; calculateTransform(b: RectLike): MatrixArray; intersect(b: RectLike, mtv?: PointLike): boolean; contain(x: number, y: number): boolean; clone(): BoundingRect; copy(other: RectLike): void; plain(): RectLike; isFinite(): boolean; isZero(): boolean; static create(rect: RectLike): BoundingRect; static copy(target: RectLike, source: RectLike): void; static applyTransform(target: RectLike, source: RectLike, m: MatrixArray): void; } declare type RectLike = { x: number; y: number; width: number; height: number; }; declare type Dictionary = { [key: string]: T; }; declare type ArrayLike$1 = { [key: number]: T; length: number; }; declare type ImageLike = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; declare type TextVerticalAlign = 'top' | 'middle' | 'bottom'; declare type TextAlign = 'left' | 'center' | 'right'; declare type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number; declare type FontStyle = 'normal' | 'italic' | 'oblique'; declare type BuiltinTextPosition = 'left' | 'right' | 'top' | 'bottom' | 'inside' | 'insideLeft' | 'insideRight' | 'insideTop' | 'insideBottom' | 'insideTopLeft' | 'insideTopRight' | 'insideBottomLeft' | 'insideBottomRight'; declare type ZREventProperties = { zrX: number; zrY: number; zrDelta: number; zrEventControl: 'no_globalout' | 'only_globalout'; zrByTouch: boolean; }; declare type ZRRawMouseEvent = MouseEvent & ZREventProperties; declare type ZRRawTouchEvent = TouchEvent & ZREventProperties; declare type ZRRawPointerEvent = TouchEvent & ZREventProperties; declare type ZRRawEvent = ZRRawMouseEvent | ZRRawTouchEvent | ZRRawPointerEvent; declare type ElementEventName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseover' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu' | 'drag' | 'dragstart' | 'dragend' | 'dragenter' | 'dragleave' | 'dragover' | 'drop' | 'globalout'; declare type ElementEventNameWithOn = 'onclick' | 'ondblclick' | 'onmousewheel' | 'onmouseout' | 'onmouseup' | 'onmousedown' | 'onmousemove' | 'oncontextmenu' | 'ondrag' | 'ondragstart' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondrop'; declare type PropType = TObj[TProp]; declare type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]; declare type MapToType, S> = { [P in keyof T]: T[P] extends Dictionary ? MapToType : S; }; declare type KeyOfDistributive = T extends unknown ? keyof T : never; declare type WithThisType any, This> = (this: This, ...args: Parameters) => ReturnType; declare type easingFunc = (percent: number) => number; declare type AnimationEasing = keyof typeof easingFuncs | easingFunc; declare const easingFuncs: { linear(k: number): number; quadraticIn(k: number): number; quadraticOut(k: number): number; quadraticInOut(k: number): number; cubicIn(k: number): number; cubicOut(k: number): number; cubicInOut(k: number): number; quarticIn(k: number): number; quarticOut(k: number): number; quarticInOut(k: number): number; quinticIn(k: number): number; quinticOut(k: number): number; quinticInOut(k: number): number; sinusoidalIn(k: number): number; sinusoidalOut(k: number): number; sinusoidalInOut(k: number): number; exponentialIn(k: number): number; exponentialOut(k: number): number; exponentialInOut(k: number): number; circularIn(k: number): number; circularOut(k: number): number; circularInOut(k: number): number; elasticIn(k: number): number; elasticOut(k: number): number; elasticInOut(k: number): number; backIn(k: number): number; backOut(k: number): number; backInOut(k: number): number; bounceIn(k: number): number; bounceOut(k: number): number; bounceInOut(k: number): number; }; declare type EventCallbackSingleParam = EvtParam extends any ? (params: EvtParam) => boolean | void : never; declare type EventCallback = EvtParams extends any[] ? (...args: EvtParams) => boolean | void : never; declare type EventQuery = string | Object; declare type CbThis$1 = unknown extends Ctx ? Impl : Ctx; declare type DefaultEventDefinition = Dictionary>; interface EventProcessor { normalizeQuery?: (query: EventQuery) => EventQuery; filter?: (eventType: keyof EvtDef, query: EventQuery) => boolean; afterTrigger?: (eventType: keyof EvtDef) => void; } declare class Eventful { private _$handlers; protected _$eventProcessor: EventProcessor; constructor(eventProcessors?: EventProcessor); on(event: EvtNm, handler: WithThisType>, context?: Ctx): this; on(event: EvtNm, query: EventQuery, handler: WithThisType>, context?: Ctx): this; isSilent(eventName: keyof EvtDef): boolean; off(eventType?: keyof EvtDef, handler?: Function): this; trigger(eventType: EvtNm, ...args: Parameters): this; triggerWithContext(type: keyof EvtDef, ...args: any[]): this; } interface Stage { update?: () => void; } interface AnimationOption$1 { stage?: Stage; } declare class Animation extends Eventful { stage: Stage; private _head; private _tail; private _running; private _time; private _pausedTime; private _pauseStart; private _paused; constructor(opts?: AnimationOption$1); addClip(clip: Clip): void; addAnimator(animator: Animator): void; removeClip(clip: Clip): void; removeAnimator(animator: Animator): void; update(notTriggerFrameAndStageUpdate?: boolean): void; _startLoop(): void; start(): void; stop(): void; pause(): void; resume(): void; clear(): void; isFinished(): boolean; animate(target: T, options: { loop?: boolean; }): Animator; } declare type OnframeCallback$1 = (percent: number) => void; declare type ondestroyCallback = () => void; declare type onrestartCallback = () => void; interface ClipProps { life?: number; delay?: number; loop?: boolean; easing?: AnimationEasing; onframe?: OnframeCallback$1; ondestroy?: ondestroyCallback; onrestart?: onrestartCallback; } declare class Clip { private _life; private _delay; private _inited; private _startTime; private _pausedTime; private _paused; animation: Animation; loop: boolean; easing: AnimationEasing; easingFunc: (p: number) => number; next: Clip; prev: Clip; onframe: OnframeCallback$1; ondestroy: ondestroyCallback; onrestart: onrestartCallback; constructor(opts: ClipProps); step(globalTime: number, deltaTime: number): boolean; pause(): void; resume(): void; setEasing(easing: AnimationEasing): void; } declare type ValueType = 0 | 1 | 2 | 3 | 4 | 5 | 6; declare type Keyframe = { time: number; value: unknown; percent: number; rawValue: unknown; easing?: AnimationEasing; easingFunc?: (percent: number) => number; additiveValue?: unknown; }; declare class Track { keyframes: Keyframe[]; propName: string; valType: ValueType; discrete: boolean; _invalid: boolean; private _finished; private _needsSort; private _additiveTrack; private _additiveValue; private _lastFr; private _lastFrP; constructor(propName: string); isFinished(): boolean; setFinished(): void; needsAnimate(): boolean; getAdditiveTrack(): Track; addKeyframe(time: number, rawValue: unknown, easing?: AnimationEasing): Keyframe; prepare(maxTime: number, additiveTrack?: Track): void; step(target: any, percent: number): void; private _addToTarget; } declare type DoneCallback = () => void; declare type AbortCallback = () => void; declare type OnframeCallback = (target: T, percent: number) => void; declare class Animator { animation?: Animation; targetName?: string; scope?: string; __fromStateTransition?: string; private _tracks; private _trackKeys; private _target; private _loop; private _delay; private _maxTime; private _force; private _paused; private _started; private _allowDiscrete; private _additiveAnimators; private _doneCbs; private _onframeCbs; private _abortedCbs; private _clip; constructor(target: T, loop: boolean, allowDiscreteAnimation?: boolean, additiveTo?: Animator[]); getMaxTime(): number; getDelay(): number; getLoop(): boolean; getTarget(): T; changeTarget(target: T): void; when(time: number, props: Dictionary, easing?: AnimationEasing): this; whenWithKeys(time: number, props: Dictionary, propNames: string[], easing?: AnimationEasing): this; pause(): void; resume(): void; isPaused(): boolean; duration(duration: number): this; private _doneCallback; private _abortedCallback; private _setTracksFinished; private _getAdditiveTrack; start(easing?: AnimationEasing): this; stop(forwardToLast?: boolean): void; delay(time: number): this; during(cb: OnframeCallback): this; done(cb: DoneCallback): this; aborted(cb: AbortCallback): this; getClip(): Clip; getTrack(propName: string): Track; getTracks(): Track[]; stopTracks(propNames: string[], forwardToLast?: boolean): boolean; saveTo(target: T, trackKeys?: readonly string[], firstOrLast?: boolean): void; __changeFinalValue(finalProps: Dictionary, trackKeys?: readonly string[]): void; } interface CommonStyleProps { shadowBlur?: number; shadowOffsetX?: number; shadowOffsetY?: number; shadowColor?: string; opacity?: number; blend?: string; } interface DisplayableProps extends ElementProps { style?: Dictionary; zlevel?: number; z?: number; z2?: number; culling?: boolean; cursor?: string; rectHover?: boolean; progressive?: boolean; incremental?: boolean; ignoreCoarsePointer?: boolean; batch?: boolean; invisible?: boolean; } declare type DisplayableKey = keyof DisplayableProps; declare type DisplayablePropertyType = PropType; declare type DisplayableStatePropNames = ElementStatePropNames | 'style' | 'z' | 'z2' | 'invisible'; declare type DisplayableState = Pick & ElementCommonState; interface Displayable { animate(key?: '', loop?: boolean): Animator; animate(key: 'style', loop?: boolean): Animator; getState(stateName: string): DisplayableState; ensureState(stateName: string): DisplayableState; states: Dictionary; stateProxy: (stateName: string) => DisplayableState; } declare class Displayable extends Element { invisible: boolean; z: number; z2: number; zlevel: number; culling: boolean; cursor: string; rectHover: boolean; incremental: boolean; ignoreCoarsePointer?: boolean; style: Dictionary; protected _normalState: DisplayableState; protected _rect: BoundingRect; protected _paintRect: BoundingRect; protected _prevPaintRect: BoundingRect; dirtyRectTolerance: number; useHoverLayer?: boolean; __hoverStyle?: CommonStyleProps; __clipPaths?: Path[]; __canvasFillGradient: CanvasGradient; __canvasStrokeGradient: CanvasGradient; __canvasFillPattern: CanvasPattern; __canvasStrokePattern: CanvasPattern; __svgEl: SVGElement; constructor(props?: Props); protected _init(props?: Props): void; beforeBrush(): void; afterBrush(): void; innerBeforeBrush(): void; innerAfterBrush(): void; shouldBePainted(viewWidth: number, viewHeight: number, considerClipPath: boolean, considerAncestors: boolean): boolean; contain(x: number, y: number): boolean; traverse(cb: (this: Context, el: this) => void, context?: Context): void; rectContain(x: number, y: number): boolean; getPaintRect(): BoundingRect; setPrevPaintRect(paintRect: BoundingRect): void; getPrevPaintRect(): BoundingRect; animateStyle(loop: boolean): Animator; updateDuringAnimation(targetKey: string): void; attrKV(key: DisplayableKey, value: DisplayablePropertyType): void; setStyle(obj: Props['style']): this; setStyle(obj: T, value: Props['style'][T]): this; dirtyStyle(notRedraw?: boolean): void; dirty(): void; styleChanged(): boolean; styleUpdated(): void; createStyle(obj?: Props['style']): Props["style"]; useStyle(obj: Props['style']): void; isStyleObject(obj: Props['style']): any; protected _innerSaveToNormal(toState: DisplayableState): void; protected _applyStateObj(stateName: string, state: DisplayableState, normalState: DisplayableState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void; protected _mergeStates(states: DisplayableState[]): DisplayableState; protected _mergeStyle(targetStyle: CommonStyleProps, sourceStyle: CommonStyleProps): CommonStyleProps; getAnimationStyleProps(): MapToType; protected static initDefaultProps: void; } interface ExtendedCanvasRenderingContext2D extends CanvasRenderingContext2D { dpr?: number; } declare class PathProxy { dpr: number; data: number[] | Float32Array; private _version; private _saveData; private _pendingPtX; private _pendingPtY; private _pendingPtDist; private _ctx; private _xi; private _yi; private _x0; private _y0; private _len; private _pathSegLen; private _pathLen; private _ux; private _uy; static CMD: { M: number; L: number; C: number; Q: number; A: number; Z: number; R: number; }; constructor(notSaveData?: boolean); increaseVersion(): void; getVersion(): number; setScale(sx: number, sy: number, segmentIgnoreThreshold?: number): void; setDPR(dpr: number): void; setContext(ctx: ExtendedCanvasRenderingContext2D): void; getContext(): ExtendedCanvasRenderingContext2D; beginPath(): this; reset(): void; moveTo(x: number, y: number): this; lineTo(x: number, y: number): this; bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): this; quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): this; arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise?: boolean): this; arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this; rect(x: number, y: number, w: number, h: number): this; closePath(): this; fill(ctx: CanvasRenderingContext2D): void; stroke(ctx: CanvasRenderingContext2D): void; len(): number; setData(data: Float32Array | number[]): void; appendPath(path: PathProxy | PathProxy[]): void; addData(cmd: number, a?: number, b?: number, c?: number, d?: number, e?: number, f?: number, g?: number, h?: number): void; private _drawPendingPt; private _expandData; toStatic(): void; getBoundingRect(): BoundingRect; private _calculateLength; rebuildPath(ctx: PathRebuilder, percent: number): void; clone(): PathProxy; private static initDefaultProps; } interface PathRebuilder { moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; bezierCurveTo(x: number, y: number, x2: number, y2: number, x3: number, y3: number): void; quadraticCurveTo(x: number, y: number, x2: number, y2: number): void; arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean): void; ellipse(cx: number, cy: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise: boolean): void; rect(x: number, y: number, width: number, height: number): void; closePath(): void; } declare type SVGVNodeAttrs = Record; interface SVGVNode { tag: string; attrs: SVGVNodeAttrs; children?: SVGVNode[]; text?: string; elm?: Node; key: string; } declare type ImagePatternRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; interface PatternObjectBase { id?: number; type?: 'pattern'; x?: number; y?: number; rotation?: number; scaleX?: number; scaleY?: number; } interface ImagePatternObject extends PatternObjectBase { image: ImageLike | string; repeat?: ImagePatternRepeat; imageWidth?: number; imageHeight?: number; } interface SVGPatternObject extends PatternObjectBase { svgElement?: SVGVNode; svgWidth?: number; svgHeight?: number; } declare type PatternObject = ImagePatternObject | SVGPatternObject; interface GradientObject { id?: number; type: string; colorStops: GradientColorStop[]; global?: boolean; } interface GradientColorStop { offset: number; color: string; } declare class Gradient { id?: number; type: string; colorStops: GradientColorStop[]; global: boolean; constructor(colorStops: GradientColorStop[]); addColorStop(offset: number, color: string): void; } interface LinearGradientObject extends GradientObject { type: 'linear'; x: number; y: number; x2: number; y2: number; } declare class LinearGradient extends Gradient { type: 'linear'; x: number; y: number; x2: number; y2: number; constructor(x: number, y: number, x2: number, y2: number, colorStops?: GradientColorStop[], globalCoord?: boolean); } interface RadialGradientObject extends GradientObject { type: 'radial'; x: number; y: number; r: number; } declare class RadialGradient extends Gradient { type: 'radial'; x: number; y: number; r: number; constructor(x: number, y: number, r: number, colorStops?: GradientColorStop[], globalCoord?: boolean); } interface PathStyleProps extends CommonStyleProps { fill?: string | PatternObject | LinearGradientObject | RadialGradientObject; stroke?: string | PatternObject | LinearGradientObject | RadialGradientObject; decal?: PatternObject; strokePercent?: number; strokeNoScale?: boolean; fillOpacity?: number; strokeOpacity?: number; lineDash?: false | number[] | 'solid' | 'dashed' | 'dotted'; lineDashOffset?: number; lineWidth?: number; lineCap?: CanvasLineCap; lineJoin?: CanvasLineJoin; miterLimit?: number; strokeFirst?: boolean; } interface PathProps extends DisplayableProps { strokeContainThreshold?: number; segmentIgnoreThreshold?: number; subPixelOptimize?: boolean; style?: PathStyleProps; shape?: Dictionary; autoBatch?: boolean; __value?: (string | number)[] | (string | number); buildPath?: (ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary, inBatch?: boolean) => void; } declare type PathKey = keyof PathProps; declare type PathPropertyType = PropType; declare type PathStatePropNames = DisplayableStatePropNames | 'shape'; declare type PathState = Pick & { hoverLayer?: boolean; }; interface Path { animate(key?: '', loop?: boolean): Animator; animate(key: 'style', loop?: boolean): Animator; animate(key: 'shape', loop?: boolean): Animator; getState(stateName: string): PathState; ensureState(stateName: string): PathState; states: Dictionary; stateProxy: (stateName: string) => PathState; } declare class Path extends Displayable { path: PathProxy; strokeContainThreshold: number; segmentIgnoreThreshold: number; subPixelOptimize: boolean; style: PathStyleProps; autoBatch: boolean; private _rectStroke; protected _normalState: PathState; protected _decalEl: Path; shape: Dictionary; constructor(opts?: Props); update(): void; getDecalElement(): Path; protected _init(props?: Props): void; protected getDefaultStyle(): Props['style']; protected getDefaultShape(): {}; protected canBeInsideText(): boolean; protected getInsideTextFill(): "#333" | "#ccc" | "#eee"; protected getInsideTextStroke(textFill?: string): string; buildPath(ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary, inBatch?: boolean): void; pathUpdated(): void; getUpdatedPathProxy(inBatch?: boolean): PathProxy; createPathProxy(): void; hasStroke(): boolean; hasFill(): boolean; getBoundingRect(): BoundingRect; contain(x: number, y: number): boolean; dirtyShape(): void; dirty(): void; animateShape(loop: boolean): Animator; updateDuringAnimation(targetKey: string): void; attrKV(key: PathKey, value: PathPropertyType): void; setShape(obj: Props['shape']): this; setShape(obj: T, value: Props['shape'][T]): this; shapeChanged(): boolean; createStyle(obj?: Props['style']): Props["style"]; protected _innerSaveToNormal(toState: PathState): void; protected _applyStateObj(stateName: string, state: PathState, normalState: PathState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void; protected _mergeStates(states: PathState[]): PathState; getAnimationStyleProps(): MapToType; isZeroArea(): boolean; static extend>(defaultProps: { type?: string; shape?: Shape; style?: PathStyleProps; beforeBrush?: Displayable['beforeBrush']; afterBrush?: Displayable['afterBrush']; getBoundingRect?: Displayable['getBoundingRect']; calculateTextPosition?: Element['calculateTextPosition']; buildPath(this: Path, ctx: CanvasRenderingContext2D | PathProxy, shape: Shape, inBatch?: boolean): void; init?(this: Path, opts: PathProps): void; }): { new (opts?: PathProps & { shape: Shape; }): Path; }; protected static initDefaultProps: void; } declare class Transformable { parent: Transformable; x: number; y: number; scaleX: number; scaleY: number; skewX: number; skewY: number; rotation: number; anchorX: number; anchorY: number; originX: number; originY: number; globalScaleRatio: number; transform: MatrixArray; invTransform: MatrixArray; getLocalTransform(m?: MatrixArray): MatrixArray; setPosition(arr: number[]): void; setScale(arr: number[]): void; setSkew(arr: number[]): void; setOrigin(arr: number[]): void; needLocalTransform(): boolean; updateTransform(): void; private _resolveGlobalScaleRatio; getComputedTransform(): MatrixArray; setLocalTransform(m: VectorArray): void; decomposeTransform(): void; getGlobalScale(out?: VectorArray): VectorArray; transformCoordToLocal(x: number, y: number): number[]; transformCoordToGlobal(x: number, y: number): number[]; getLineScale(): number; copyTransform(source: Transformable): void; static getLocalTransform(target: Transformable, m?: MatrixArray): MatrixArray; private static initDefaultProps; } declare const TRANSFORMABLE_PROPS: readonly ["x", "y", "originX", "originY", "anchorX", "anchorY", "rotation", "scaleX", "scaleY", "skewX", "skewY"]; declare type TransformProp = (typeof TRANSFORMABLE_PROPS)[number]; declare const nativeSlice: (start?: number, end?: number) => any[]; declare function guid(): number; declare function logError(...args: any[]): void; declare function clone(source: T): T; declare function merge, S extends Dictionary>(target: T, source: S, overwrite?: boolean): T & S; declare function merge(target: T, source: S, overwrite?: boolean): T | S; declare function mergeAll(targetAndSources: any[], overwrite?: boolean): any; declare function extend, S extends Dictionary>(target: T, source: S): T & S; declare function defaults, S extends Dictionary>(target: T, source: S, overlay?: boolean): T & S; declare const createCanvas: () => HTMLCanvasElement; declare function indexOf(array: T[] | readonly T[] | ArrayLike$1, value: T): number; declare function inherits(clazz: Function, baseClazz: Function): void; declare function mixin(target: T | Function, source: S | Function, override?: boolean): void; declare function isArrayLike(data: any): data is ArrayLike$1; declare function each | any[] | readonly any[] | ArrayLike$1, Context>(arr: I, cb: (this: Context, value: I extends (infer T)[] | readonly (infer T)[] | ArrayLike$1 ? T : I extends Dictionary ? I extends Record ? T : unknown : unknown, index?: I extends any[] | readonly any[] | ArrayLike$1 ? number : keyof I & string, arr?: I) => void, context?: Context): void; declare function map(arr: readonly T[], cb: (this: Context, val: T, index?: number, arr?: readonly T[]) => R, context?: Context): R[]; declare function reduce(arr: readonly T[], cb: (this: Context, previousValue: S, currentValue: T, currentIndex?: number, arr?: readonly T[]) => S, memo?: S, context?: Context): S; declare function filter(arr: readonly T[], cb: (this: Context, value: T, index: number, arr: readonly T[]) => boolean, context?: Context): T[]; declare function find(arr: readonly T[], cb: (this: Context, value: T, index?: number, arr?: readonly T[]) => boolean, context?: Context): T; declare function keys(obj: T): (KeyOfDistributive & string)[]; declare type Bind1 = F extends (this: Ctx, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Bind2 = F extends (this: Ctx, a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Bind3 = F extends (this: Ctx, a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Bind4 = F extends (this: Ctx, a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Bind5 = F extends (this: Ctx, a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type BindFunc = (this: Ctx, ...arg: any[]) => any; interface FunctionBind { , Ctx>(func: F, ctx: Ctx): Bind1; , Ctx, T1 extends Parameters[0]>(func: F, ctx: Ctx, a: T1): Bind2; , Ctx, T1 extends Parameters[0], T2 extends Parameters[1]>(func: F, ctx: Ctx, a: T1, b: T2): Bind3; , Ctx, T1 extends Parameters[0], T2 extends Parameters[1], T3 extends Parameters[2]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3): Bind4; , Ctx, T1 extends Parameters[0], T2 extends Parameters[1], T3 extends Parameters[2], T4 extends Parameters[3]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3, d: T4): Bind5; } declare const bind: FunctionBind; declare type Curry1 = F extends (a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Curry2 = F extends (a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Curry3 = F extends (a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type Curry4 = F extends (a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown; declare type CurryFunc = (...arg: any[]) => any; declare function curry[0]>(func: F, a: T1): Curry1; declare function curry[0], T2 extends Parameters[1]>(func: F, a: T1, b: T2): Curry2; declare function curry[0], T2 extends Parameters[1], T3 extends Parameters[2]>(func: F, a: T1, b: T2, c: T3): Curry3; declare function curry[0], T2 extends Parameters[1], T3 extends Parameters[2], T4 extends Parameters[3]>(func: F, a: T1, b: T2, c: T3, d: T4): Curry4; declare function isArray(value: any): value is any[]; declare function isFunction(value: any): value is Function; declare function isString(value: any): value is string; declare function isStringSafe(value: any): value is string; declare function isNumber(value: any): value is number; declare function isObject(value: T): value is (object & T); declare function isBuiltInObject(value: any): boolean; declare function isTypedArray(value: any): boolean; declare function isDom(value: any): value is HTMLElement; declare function isGradientObject(value: any): value is GradientObject; declare function isImagePatternObject(value: any): value is ImagePatternObject; declare function isRegExp(value: unknown): value is RegExp; declare function eqNaN(value: any): boolean; declare function retrieve(...args: T[]): T; declare function retrieve2(value0: T, value1: R): T | R; declare function retrieve3(value0: T, value1: R, value2: W): T | R | W; declare type SliceParams = Parameters; declare function slice(arr: ArrayLike$1, ...args: SliceParams): T[]; declare function normalizeCssArray$1(val: number | number[]): number[]; declare function assert(condition: any, message?: string): void; declare function trim(str: string): string; declare function setAsPrimitive(obj: any): void; declare function isPrimitive(obj: any): boolean; interface MapInterface { delete(key: KEY): boolean; has(key: KEY): boolean; get(key: KEY): T | undefined; set(key: KEY, value: T): this; keys(): KEY[]; forEach(callback: (value: T, key: KEY) => void): void; } declare class HashMap { data: MapInterface; constructor(obj?: HashMap | { [key in KEY]?: T; } | KEY[]); hasKey(key: KEY): boolean; get(key: KEY): T; set(key: KEY, value: T): T; each(cb: (this: Context, value?: T, key?: KEY) => void, context?: Context): void; keys(): KEY[]; removeKey(key: KEY): void; } declare function createHashMap(obj?: HashMap | { [key in KEY]?: T; } | KEY[]): HashMap; declare function concatArray(a: ArrayLike$1, b: ArrayLike$1): ArrayLike$1; declare function createObject(proto?: object, properties?: T): T; declare function disableUserSelect(dom: HTMLElement): void; declare function hasOwn(own: object, prop: string): boolean; declare function noop(): void; declare const RADIAN_TO_DEGREE: number; type util_d_Bind1 = Bind1; type util_d_Bind2 = Bind2; type util_d_Bind3 = Bind3; type util_d_Bind4 = Bind4; type util_d_Bind5 = Bind5; type util_d_Curry1 = Curry1; type util_d_Curry2 = Curry2; type util_d_Curry3 = Curry3; type util_d_Curry4 = Curry4; type util_d_HashMap = HashMap; declare const util_d_HashMap: typeof HashMap; declare const util_d_RADIAN_TO_DEGREE: typeof RADIAN_TO_DEGREE; declare const util_d_assert: typeof assert; declare const util_d_bind: typeof bind; declare const util_d_clone: typeof clone; declare const util_d_concatArray: typeof concatArray; declare const util_d_createCanvas: typeof createCanvas; declare const util_d_createHashMap: typeof createHashMap; declare const util_d_createObject: typeof createObject; declare const util_d_curry: typeof curry; declare const util_d_defaults: typeof defaults; declare const util_d_disableUserSelect: typeof disableUserSelect; declare const util_d_each: typeof each; declare const util_d_eqNaN: typeof eqNaN; declare const util_d_extend: typeof extend; declare const util_d_filter: typeof filter; declare const util_d_find: typeof find; declare const util_d_guid: typeof guid; declare const util_d_hasOwn: typeof hasOwn; declare const util_d_indexOf: typeof indexOf; declare const util_d_inherits: typeof inherits; declare const util_d_isArray: typeof isArray; declare const util_d_isArrayLike: typeof isArrayLike; declare const util_d_isBuiltInObject: typeof isBuiltInObject; declare const util_d_isDom: typeof isDom; declare const util_d_isFunction: typeof isFunction; declare const util_d_isGradientObject: typeof isGradientObject; declare const util_d_isImagePatternObject: typeof isImagePatternObject; declare const util_d_isNumber: typeof isNumber; declare const util_d_isObject: typeof isObject; declare const util_d_isPrimitive: typeof isPrimitive; declare const util_d_isRegExp: typeof isRegExp; declare const util_d_isString: typeof isString; declare const util_d_isStringSafe: typeof isStringSafe; declare const util_d_isTypedArray: typeof isTypedArray; declare const util_d_keys: typeof keys; declare const util_d_logError: typeof logError; declare const util_d_map: typeof map; declare const util_d_merge: typeof merge; declare const util_d_mergeAll: typeof mergeAll; declare const util_d_mixin: typeof mixin; declare const util_d_noop: typeof noop; declare const util_d_reduce: typeof reduce; declare const util_d_retrieve: typeof retrieve; declare const util_d_retrieve2: typeof retrieve2; declare const util_d_retrieve3: typeof retrieve3; declare const util_d_setAsPrimitive: typeof setAsPrimitive; declare const util_d_slice: typeof slice; declare const util_d_trim: typeof trim; declare namespace util_d { export { type util_d_Bind1 as Bind1, type util_d_Bind2 as Bind2, type util_d_Bind3 as Bind3, type util_d_Bind4 as Bind4, type util_d_Bind5 as Bind5, type util_d_Curry1 as Curry1, type util_d_Curry2 as Curry2, type util_d_Curry3 as Curry3, type util_d_Curry4 as Curry4, util_d_HashMap as HashMap, util_d_RADIAN_TO_DEGREE as RADIAN_TO_DEGREE, util_d_assert as assert, util_d_bind as bind, util_d_clone as clone, util_d_concatArray as concatArray, util_d_createCanvas as createCanvas, util_d_createHashMap as createHashMap, util_d_createObject as createObject, util_d_curry as curry, util_d_defaults as defaults, util_d_disableUserSelect as disableUserSelect, util_d_each as each, util_d_eqNaN as eqNaN, util_d_extend as extend, util_d_filter as filter, util_d_find as find, util_d_guid as guid, util_d_hasOwn as hasOwn, util_d_indexOf as indexOf, util_d_inherits as inherits, util_d_isArray as isArray, util_d_isArrayLike as isArrayLike, util_d_isBuiltInObject as isBuiltInObject, util_d_isDom as isDom, util_d_isFunction as isFunction, util_d_isGradientObject as isGradientObject, util_d_isImagePatternObject as isImagePatternObject, util_d_isNumber as isNumber, util_d_isObject as isObject, util_d_isPrimitive as isPrimitive, util_d_isRegExp as isRegExp, util_d_isString as isString, util_d_isStringSafe as isStringSafe, util_d_isTypedArray as isTypedArray, util_d_keys as keys, util_d_logError as logError, util_d_map as map, util_d_merge as merge, util_d_mergeAll as mergeAll, util_d_mixin as mixin, util_d_noop as noop, normalizeCssArray$1 as normalizeCssArray, util_d_reduce as reduce, util_d_retrieve as retrieve, util_d_retrieve2 as retrieve2, util_d_retrieve3 as retrieve3, util_d_setAsPrimitive as setAsPrimitive, util_d_slice as slice, util_d_trim as trim }; } interface PainterBase { type: string; root?: HTMLElement; ssrOnly?: boolean; resize(width?: number | string, height?: number | string): void; refresh(): void; clear(): void; renderToString?(): string; getType: () => string; getWidth(): number; getHeight(): number; dispose(): void; getViewportRoot: () => HTMLElement; getViewportRootOffset: () => { offsetLeft: number; offsetTop: number; }; refreshHover(): void; configLayer(zlevel: number, config: Dictionary): void; setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void; } interface HandlerProxyInterface extends Eventful { handler: Handler; dispose: () => void; setCursor: (cursorStyle?: string) => void; } declare function shapeCompareFunc(a: Displayable, b: Displayable): number; declare class Storage { private _roots; private _displayList; private _displayListLen; traverse(cb: (this: T, el: Element) => void, context?: T): void; getDisplayList(update?: boolean, includeIgnore?: boolean): Displayable[]; updateDisplayList(includeIgnore?: boolean): void; private _updateAndAddDisplayable; addRoot(el: Element): void; delRoot(el: Element | Element[]): void; delAllRoots(): void; getRoots(): Element[]; dispose(): void; displayableSortFunc: typeof shapeCompareFunc; } declare class HoveredResult { x: number; y: number; target: Displayable; topTarget: Displayable; constructor(x?: number, y?: number); } declare type HandlerName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu'; declare class Handler extends Eventful { storage: Storage; painter: PainterBase; painterRoot: HTMLElement; proxy: HandlerProxyInterface; private _hovered; private _gestureMgr; private _draggingMgr; private _pointerSize; _downEl: Element; _upEl: Element; _downPoint: [number, number]; constructor(storage: Storage, painter: PainterBase, proxy: HandlerProxyInterface, painterRoot: HTMLElement, pointerSize: number); setHandlerProxy(proxy: HandlerProxyInterface): void; mousemove(event: ZRRawEvent): void; mouseout(event: ZRRawEvent): void; resize(): void; dispatch(eventName: HandlerName, eventArgs?: any): void; dispose(): void; setCursorStyle(cursorStyle: string): void; dispatchToElement(targetInfo: { target?: Element; topTarget?: Element; }, eventName: ElementEventName, event: ZRRawEvent): void; findHover(x: number, y: number, exclude?: Displayable): HoveredResult; processGesture(event: ZRRawEvent, stage?: 'start' | 'end' | 'change'): void; click: (event: ZRRawEvent) => void; mousedown: (event: ZRRawEvent) => void; mouseup: (event: ZRRawEvent) => void; mousewheel: (event: ZRRawEvent) => void; dblclick: (event: ZRRawEvent) => void; contextmenu: (event: ZRRawEvent) => void; } interface LayerConfig { clearColor?: string | GradientObject | ImagePatternObject; motionBlur?: boolean; lastFrameAlpha?: number; } /*! * ZRender, a high performance 2d drawing library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. * * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ declare type PainterBaseCtor = { new (dom: HTMLElement, storage: Storage, ...args: any[]): PainterBase; }; declare class ZRender { dom?: HTMLElement; id: number; storage: Storage; painter: PainterBase; handler: Handler; animation: Animation; private _sleepAfterStill; private _stillFrameAccum; private _needsRefresh; private _needsRefreshHover; private _disposed; private _darkMode; private _backgroundColor; constructor(id: number, dom?: HTMLElement, opts?: ZRenderInitOpt); add(el: Element): void; remove(el: Element): void; configLayer(zLevel: number, config: LayerConfig): void; setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void; getBackgroundColor(): string | GradientObject | PatternObject; setDarkMode(darkMode: boolean): void; isDarkMode(): boolean; refreshImmediately(fromInside?: boolean): void; refresh(): void; flush(): void; private _flush; setSleepAfterStill(stillFramesCount: number): void; wakeUp(): void; refreshHover(): void; refreshHoverImmediately(): void; resize(opts?: { width?: number | string; height?: number | string; }): void; clearAnimation(): void; getWidth(): number | undefined; getHeight(): number | undefined; setCursorStyle(cursorStyle: string): void; findHover(x: number, y: number): { target: Displayable; topTarget: Displayable; } | undefined; on(eventName: ElementEventName, eventHandler: ElementEventCallback, context?: Ctx): this; on(eventName: string, eventHandler: WithThisType, unknown extends Ctx ? ZRenderType : Ctx>, context?: Ctx): this; off(eventName?: string, eventHandler?: EventCallback): void; trigger(eventName: string, event?: unknown): void; clear(): void; dispose(): void; } interface ZRenderInitOpt { renderer?: string; devicePixelRatio?: number; width?: number | string; height?: number | string; useDirtyRect?: boolean; useCoarsePointer?: 'auto' | boolean; pointerSize?: number; ssr?: boolean; } declare function init$1(dom?: HTMLElement | null, opts?: ZRenderInitOpt): ZRender; declare function dispose$1(zr: ZRender): void; declare function disposeAll(): void; declare function getInstance(id: number): ZRender; declare function registerPainter(name: string, Ctor: PainterBaseCtor): void; declare type ElementSSRData = HashMap; declare type ElementSSRDataGetter = (el: Element) => HashMap; declare function getElementSSRData(el: Element): ElementSSRData; declare function registerSSRDataGetter(getter: ElementSSRDataGetter): void; declare const version$1 = "5.6.0"; interface ZRenderType extends ZRender { } type zrender_d_ElementSSRData = ElementSSRData; type zrender_d_ElementSSRDataGetter = ElementSSRDataGetter; type zrender_d_ZRenderInitOpt = ZRenderInitOpt; type zrender_d_ZRenderType = ZRenderType; declare const zrender_d_disposeAll: typeof disposeAll; declare const zrender_d_getElementSSRData: typeof getElementSSRData; declare const zrender_d_getInstance: typeof getInstance; declare const zrender_d_registerPainter: typeof registerPainter; declare const zrender_d_registerSSRDataGetter: typeof registerSSRDataGetter; declare namespace zrender_d { export { type zrender_d_ElementSSRData as ElementSSRData, type zrender_d_ElementSSRDataGetter as ElementSSRDataGetter, type zrender_d_ZRenderInitOpt as ZRenderInitOpt, type zrender_d_ZRenderType as ZRenderType, dispose$1 as dispose, zrender_d_disposeAll as disposeAll, zrender_d_getElementSSRData as getElementSSRData, zrender_d_getInstance as getInstance, init$1 as init, zrender_d_registerPainter as registerPainter, zrender_d_registerSSRDataGetter as registerSSRDataGetter, version$1 as version }; } interface TSpanStyleProps extends PathStyleProps { x?: number; y?: number; text?: string; font?: string; fontSize?: number; fontWeight?: FontWeight; fontStyle?: FontStyle; fontFamily?: string; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; } interface TSpanProps extends DisplayableProps { style?: TSpanStyleProps; } declare class TSpan extends Displayable { style: TSpanStyleProps; hasStroke(): boolean; hasFill(): boolean; createStyle(obj?: TSpanStyleProps): TSpanStyleProps; setBoundingRect(rect: BoundingRect): void; getBoundingRect(): BoundingRect; protected static initDefaultProps: void; } interface ImageStyleProps extends CommonStyleProps { image?: string | ImageLike; x?: number; y?: number; width?: number; height?: number; sx?: number; sy?: number; sWidth?: number; sHeight?: number; } interface ImageProps extends DisplayableProps { style?: ImageStyleProps; onload?: (image: ImageLike) => void; } declare class ZRImage extends Displayable { style: ImageStyleProps; __image: ImageLike; __imageSrc: string; onload: (image: ImageLike) => void; createStyle(obj?: ImageStyleProps): ImageStyleProps; private _getSize; getWidth(): number; getHeight(): number; getAnimationStyleProps(): MapToType; getBoundingRect(): BoundingRect; } declare class RectShape { r?: number | number[]; x: number; y: number; width: number; height: number; } interface RectProps extends PathProps { shape?: Partial; } declare class Rect extends Path { shape: RectShape; constructor(opts?: RectProps); getDefaultShape(): RectShape; buildPath(ctx: CanvasRenderingContext2D, shape: RectShape): void; isZeroArea(): boolean; } interface TextStylePropsPart { text?: string; fill?: string; stroke?: string; strokeNoScale?: boolean; opacity?: number; fillOpacity?: number; strokeOpacity?: number; lineWidth?: number; lineDash?: false | number[]; lineDashOffset?: number; borderDash?: false | number[]; borderDashOffset?: number; font?: string; textFont?: string; fontStyle?: FontStyle; fontWeight?: FontWeight; fontFamily?: string; fontSize?: number | string; align?: TextAlign; verticalAlign?: TextVerticalAlign; lineHeight?: number; width?: number | string; height?: number; tag?: string; textShadowColor?: string; textShadowBlur?: number; textShadowOffsetX?: number; textShadowOffsetY?: number; backgroundColor?: string | { image: ImageLike | string; }; padding?: number | number[]; margin?: number; borderColor?: string; borderWidth?: number; borderRadius?: number | number[]; shadowColor?: string; shadowBlur?: number; shadowOffsetX?: number; shadowOffsetY?: number; } interface TextStyleProps extends TextStylePropsPart { text?: string; x?: number; y?: number; width?: number; rich?: Dictionary; overflow?: 'break' | 'breakAll' | 'truncate' | 'none'; lineOverflow?: 'truncate'; ellipsis?: string; placeholder?: string; truncateMinChar?: number; } interface TextProps extends DisplayableProps { style?: TextStyleProps; zlevel?: number; z?: number; z2?: number; culling?: boolean; cursor?: string; } declare type TextState = Pick & ElementCommonState; declare type DefaultTextStyle = Pick & { autoStroke?: boolean; }; interface ZRText { animate(key?: '', loop?: boolean): Animator; animate(key: 'style', loop?: boolean): Animator; getState(stateName: string): TextState; ensureState(stateName: string): TextState; states: Dictionary; stateProxy: (stateName: string) => TextState; } declare class ZRText extends Displayable implements GroupLike { type: string; style: TextStyleProps; overlap: 'hidden' | 'show' | 'blur'; innerTransformable: Transformable; private _children; private _childCursor; private _defaultStyle; constructor(opts?: TextProps); childrenRef(): (ZRImage | Rect | TSpan)[]; update(): void; updateTransform(): void; getLocalTransform(m?: MatrixArray): MatrixArray; getComputedTransform(): MatrixArray; private _updateSubTexts; addSelfToZr(zr: ZRenderType): void; removeSelfFromZr(zr: ZRenderType): void; getBoundingRect(): BoundingRect; setDefaultTextStyle(defaultTextStyle: DefaultTextStyle): void; setTextContent(textContent: never): void; protected _mergeStyle(targetStyle: TextStyleProps, sourceStyle: TextStyleProps): TextStyleProps; private _mergeRich; getAnimationStyleProps(): MapToType; private _getOrCreateChild; private _updatePlainTexts; private _updateRichTexts; private _placeToken; private _renderBackground; static makeFont(style: TextStylePropsPart): string; } interface TextPositionCalculationResult { x: number; y: number; align: TextAlign; verticalAlign: TextVerticalAlign; } declare class PolylineShape { points: VectorArray[]; percent?: number; smooth?: number; smoothConstraint?: VectorArray[]; } interface PolylineProps extends PathProps { shape?: Partial; } declare class Polyline extends Path { shape: PolylineShape; constructor(opts?: PolylineProps); getDefaultStyle(): { stroke: string; fill: string; }; getDefaultShape(): PolylineShape; buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape): void; } interface ElementAnimateConfig { duration?: number; delay?: number; easing?: AnimationEasing; during?: (percent: number) => void; done?: Function; aborted?: Function; scope?: string; force?: boolean; additive?: boolean; setToFinal?: boolean; } interface ElementTextConfig { position?: BuiltinTextPosition | (number | string)[]; rotation?: number; layoutRect?: RectLike; offset?: number[]; origin?: (number | string)[] | 'center'; distance?: number; local?: boolean; insideFill?: string; insideStroke?: string; outsideFill?: string; outsideStroke?: string; inside?: boolean; } interface ElementTextGuideLineConfig { anchor?: Point; showAbove?: boolean; candidates?: ('left' | 'top' | 'right' | 'bottom')[]; } interface ElementEvent { type: ElementEventName; event: ZRRawEvent; target: Element; topTarget: Element; cancelBubble: boolean; offsetX: number; offsetY: number; gestureEvent: string; pinchX: number; pinchY: number; pinchScale: number; wheelDelta: number; zrByTouch: boolean; which: number; stop: (this: ElementEvent) => void; } declare type ElementEventCallback = (this: CbThis, e: ElementEvent) => boolean | void; declare type CbThis = unknown extends Ctx ? Impl : Ctx; interface ElementEventHandlerProps { onclick: ElementEventCallback; ondblclick: ElementEventCallback; onmouseover: ElementEventCallback; onmouseout: ElementEventCallback; onmousemove: ElementEventCallback; onmousewheel: ElementEventCallback; onmousedown: ElementEventCallback; onmouseup: ElementEventCallback; oncontextmenu: ElementEventCallback; ondrag: ElementEventCallback; ondragstart: ElementEventCallback; ondragend: ElementEventCallback; ondragenter: ElementEventCallback; ondragleave: ElementEventCallback; ondragover: ElementEventCallback; ondrop: ElementEventCallback; } interface ElementProps extends Partial, Partial> { name?: string; ignore?: boolean; isGroup?: boolean; draggable?: boolean | 'horizontal' | 'vertical'; silent?: boolean; ignoreClip?: boolean; globalScaleRatio?: number; textConfig?: ElementTextConfig; textContent?: ZRText; clipPath?: Path; drift?: Element['drift']; extra?: Dictionary; anid?: string; } declare const PRIMARY_STATES_KEYS: ["x" | "y" | "originX" | "originY" | "anchorX" | "anchorY" | "rotation" | "scaleX" | "scaleY" | "skewX" | "skewY", "ignore"]; declare type ElementStatePropNames = (typeof PRIMARY_STATES_KEYS)[number] | 'textConfig'; declare type ElementState = Pick & ElementCommonState; declare type ElementCommonState = { hoverLayer?: boolean; }; declare type ElementCalculateTextPosition = (out: TextPositionCalculationResult, style: ElementTextConfig, rect: RectLike) => TextPositionCalculationResult; interface Element extends Transformable, Eventful<{ [key in ElementEventName]: (e: ElementEvent) => void | boolean; } & { [key in string]: (...args: any) => void | boolean; }>, ElementEventHandlerProps { } declare class Element { id: number; type: string; name: string; ignore: boolean; silent: boolean; isGroup: boolean; draggable: boolean | 'horizontal' | 'vertical'; dragging: boolean; parent: Group; animators: Animator[]; ignoreClip: boolean; __hostTarget: Element; __zr: ZRenderType; __dirty: number; __isRendered: boolean; __inHover: boolean; private _clipPath?; private _textContent?; private _textGuide?; textConfig?: ElementTextConfig; textGuideLineConfig?: ElementTextGuideLineConfig; anid: string; extra: Dictionary; currentStates?: string[]; prevStates?: string[]; states: Dictionary; stateTransition: ElementAnimateConfig; stateProxy?: (stateName: string, targetStates?: string[]) => ElementState; protected _normalState: ElementState; private _innerTextDefaultStyle; constructor(props?: Props); protected _init(props?: Props): void; drift(dx: number, dy: number, e?: ElementEvent): void; beforeUpdate(): void; afterUpdate(): void; update(): void; updateInnerText(forceUpdate?: boolean): void; protected canBeInsideText(): boolean; protected getInsideTextFill(): string | undefined; protected getInsideTextStroke(textFill: string): string | undefined; protected getOutsideFill(): string | undefined; protected getOutsideStroke(textFill: string): string; traverse(cb: (this: Context, el: Element) => void, context?: Context): void; protected attrKV(key: string, value: unknown): void; hide(): void; show(): void; attr(keyOrObj: Props): this; attr(keyOrObj: T, value: Props[T]): this; saveCurrentToNormalState(toState: ElementState): void; protected _innerSaveToNormal(toState: ElementState): void; protected _savePrimaryToNormal(toState: Dictionary, normalState: Dictionary, primaryKeys: readonly string[]): void; hasState(): boolean; getState(name: string): ElementState; ensureState(name: string): ElementState; clearStates(noAnimation?: boolean): void; useState(stateName: string, keepCurrentStates?: boolean, noAnimation?: boolean, forceUseHoverLayer?: boolean): ElementState; useStates(states: string[], noAnimation?: boolean, forceUseHoverLayer?: boolean): void; isSilent(): boolean; private _updateAnimationTargets; removeState(state: string): void; replaceState(oldState: string, newState: string, forceAdd: boolean): void; toggleState(state: string, enable: boolean): void; protected _mergeStates(states: ElementState[]): ElementState; protected _applyStateObj(stateName: string, state: ElementState, normalState: ElementState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void; private _attachComponent; private _detachComponent; getClipPath(): Path; setClipPath(clipPath: Path): void; removeClipPath(): void; getTextContent(): ZRText; setTextContent(textEl: ZRText): void; setTextConfig(cfg: ElementTextConfig): void; removeTextConfig(): void; removeTextContent(): void; getTextGuideLine(): Polyline; setTextGuideLine(guideLine: Polyline): void; removeTextGuideLine(): void; markRedraw(): void; dirty(): void; private _toggleHoverLayerFlag; addSelfToZr(zr: ZRenderType): void; removeSelfFromZr(zr: ZRenderType): void; animate(key?: string, loop?: boolean, allowDiscreteAnimation?: boolean): Animator; addAnimator(animator: Animator, key: string): void; updateDuringAnimation(key: string): void; stopAnimation(scope?: string, forwardToLast?: boolean): this; animateTo(target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType): void; animateFrom(target: Props, cfg: ElementAnimateConfig, animationProps?: MapToType): void; protected _transitionState(stateName: string, target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType): void; getBoundingRect(): BoundingRect; getPaintRect(): BoundingRect; calculateTextPosition: ElementCalculateTextPosition; protected static initDefaultProps: void; } interface GroupProps extends ElementProps { } declare class Group extends Element { readonly isGroup = true; private _children; constructor(opts?: GroupProps); childrenRef(): Element[]; children(): Element[]; childAt(idx: number): Element; childOfName(name: string): Element; childCount(): number; add(child: Element): Group; addBefore(child: Element, nextSibling: Element): this; replace(oldChild: Element, newChild: Element): this; replaceAt(child: Element, index: number): this; _doAdd(child: Element): void; remove(child: Element): this; removeAll(): this; eachChild(cb: (this: Context, el: Element, index?: number) => void, context?: Context): this; traverse(cb: (this: T, el: Element) => boolean | void, context?: T): this; addSelfToZr(zr: ZRenderType): void; removeSelfFromZr(zr: ZRenderType): void; getBoundingRect(includeChildren?: Element[]): BoundingRect; } interface GroupLike extends Element { childrenRef(): Element[]; } declare type AreaStyleProps = Pick; declare class AreaStyleMixin { getAreaStyle(this: Model, excludes?: readonly (keyof AreaStyleOption)[], includes?: readonly (keyof AreaStyleOption)[]): AreaStyleProps; } declare class CircleShape { cx: number; cy: number; r: number; } interface CircleProps extends PathProps { shape?: Partial; } declare class Circle extends Path { shape: CircleShape; constructor(opts?: CircleProps); getDefaultShape(): CircleShape; buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape): void; } declare class EllipseShape { cx: number; cy: number; rx: number; ry: number; } interface EllipseProps extends PathProps { shape?: Partial; } declare class Ellipse extends Path { shape: EllipseShape; constructor(opts?: EllipseProps); getDefaultShape(): EllipseShape; buildPath(ctx: CanvasRenderingContext2D, shape: EllipseShape): void; } declare class SectorShape { cx: number; cy: number; r0: number; r: number; startAngle: number; endAngle: number; clockwise: boolean; cornerRadius: number | number[]; } interface SectorProps extends PathProps { shape?: Partial; } declare class Sector extends Path { shape: SectorShape; constructor(opts?: SectorProps); getDefaultShape(): SectorShape; buildPath(ctx: CanvasRenderingContext2D, shape: SectorShape): void; isZeroArea(): boolean; } declare class RingShape { cx: number; cy: number; r: number; r0: number; } interface RingProps extends PathProps { shape?: Partial; } declare class Ring extends Path { shape: RingShape; constructor(opts?: RingProps); getDefaultShape(): RingShape; buildPath(ctx: CanvasRenderingContext2D, shape: RingShape): void; } declare class PolygonShape { points: VectorArray[]; smooth?: number; smoothConstraint?: VectorArray[]; } interface PolygonProps extends PathProps { shape?: Partial; } declare class Polygon extends Path { shape: PolygonShape; constructor(opts?: PolygonProps); getDefaultShape(): PolygonShape; buildPath(ctx: CanvasRenderingContext2D, shape: PolygonShape): void; } declare class LineShape { x1: number; y1: number; x2: number; y2: number; percent: number; } interface LineProps extends PathProps { shape?: Partial; } declare class Line extends Path { shape: LineShape; constructor(opts?: LineProps); getDefaultStyle(): { stroke: string; fill: string; }; getDefaultShape(): LineShape; buildPath(ctx: CanvasRenderingContext2D, shape: LineShape): void; pointAt(p: number): VectorArray; } declare class BezierCurveShape { x1: number; y1: number; x2: number; y2: number; cpx1: number; cpy1: number; cpx2?: number; cpy2?: number; percent: number; } interface BezierCurveProps extends PathProps { shape?: Partial; } declare class BezierCurve extends Path { shape: BezierCurveShape; constructor(opts?: BezierCurveProps); getDefaultStyle(): { stroke: string; fill: string; }; getDefaultShape(): BezierCurveShape; buildPath(ctx: CanvasRenderingContext2D, shape: BezierCurveShape): void; pointAt(t: number): number[]; tangentAt(t: number): number[]; } declare class ArcShape { cx: number; cy: number; r: number; startAngle: number; endAngle: number; clockwise?: boolean; } interface ArcProps extends PathProps { shape?: Partial; } declare class Arc extends Path { shape: ArcShape; constructor(opts?: ArcProps); getDefaultStyle(): { stroke: string; fill: string; }; getDefaultShape(): ArcShape; buildPath(ctx: CanvasRenderingContext2D, shape: ArcShape): void; } interface CompoundPathShape { paths: Path[]; } declare class CompoundPath extends Path { type: string; shape: CompoundPathShape; private _updatePathDirty; beforeBrush(): void; buildPath(ctx: PathProxy | CanvasRenderingContext2D, shape: CompoundPathShape): void; afterBrush(): void; getBoundingRect(): BoundingRect; } declare type Constructor = new (...args: any) => any; interface ClassManager { registerClass: (clz: Constructor) => Constructor; getClass: (componentMainType: ComponentMainType, subType?: ComponentSubType, throwWhenNotFound?: boolean) => Constructor; getClassesByMainType: (componentType: ComponentMainType) => Constructor[]; hasClass: (componentType: ComponentFullType) => boolean; getAllClassMainTypes: () => ComponentMainType[]; hasSubTypes: (componentType: ComponentFullType) => boolean; } interface SubTypeDefaulter { (option: ComponentOption): ComponentSubType; } interface SubTypeDefaulterManager { registerSubTypeDefaulter: (componentType: string, defaulter: SubTypeDefaulter) => void; determineSubType: (componentType: string, option: ComponentOption) => string; } declare type DiffKeyGetter = (this: DataDiffer, value: unknown, index: number) => string; declare type DiffCallbackAdd = (newIndex: number) => void; declare type DiffCallbackUpdate = (newIndex: number, oldIndex: number) => void; declare type DiffCallbackRemove = (oldIndex: number) => void; declare type DiffCallbackUpdateManyToOne = (newIndex: number, oldIndex: number[]) => void; declare type DiffCallbackUpdateOneToMany = (newIndex: number[], oldIndex: number) => void; declare type DiffCallbackUpdateManyToMany = (newIndex: number[], oldIndex: number[]) => void; declare type DataDiffMode = 'oneToOne' | 'multiple'; declare class DataDiffer { private _old; private _new; private _oldKeyGetter; private _newKeyGetter; private _add; private _update; private _updateManyToOne; private _updateOneToMany; private _updateManyToMany; private _remove; private _diffModeMultiple; readonly context: CTX; /** * @param context Can be visited by this.context in callback. */ constructor(oldArr: ArrayLike$1, newArr: ArrayLike$1, oldKeyGetter?: DiffKeyGetter, newKeyGetter?: DiffKeyGetter, context?: CTX, diffMode?: DataDiffMode); /** * Callback function when add a data */ add(func: DiffCallbackAdd): this; /** * Callback function when update a data */ update(func: DiffCallbackUpdate): this; /** * Callback function when update a data and only work in `cbMode: 'byKey'`. */ updateManyToOne(func: DiffCallbackUpdateManyToOne): this; /** * Callback function when update a data and only work in `cbMode: 'byKey'`. */ updateOneToMany(func: DiffCallbackUpdateOneToMany): this; /** * Callback function when update a data and only work in `cbMode: 'byKey'`. */ updateManyToMany(func: DiffCallbackUpdateManyToMany): this; /** * Callback function when remove a data */ remove(func: DiffCallbackRemove): this; execute(): void; private _executeOneToOne; /** * For example, consider the case: * oldData: [o0, o1, o2, o3, o4, o5, o6, o7], * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8], * Where: * o0, o1, n0 has key 'a' (many to one) * o5, n4, n5, n6 has key 'b' (one to many) * o2, n1 has key 'c' (one to one) * n2, n3 has key 'd' (add) * o3, o4 has key 'e' (remove) * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove) * Then: * (The order of the following directives are not ensured.) * this._updateManyToOne(n0, [o0, o1]); * this._updateOneToMany([n4, n5, n6], o5); * this._update(n1, o2); * this._remove(o3); * this._remove(o4); * this._remove(o6); * this._remove(o7); * this._add(n2); * this._add(n3); * this._add(n7); * this._add(n8); */ private _executeMultiple; private _performRestAdd; private _initIndexMap; } interface PaletteMixin extends Pick, 'get'> { } declare class PaletteMixin { getColorFromPalette(this: PaletteMixin, name: string, scope?: any, requestNum?: number): ZRColor; clearColorPalette(this: PaletteMixin): void; } declare const _default$1: { time: { month: string[]; monthAbbr: string[]; dayOfWeek: string[]; dayOfWeekAbbr: string[]; }; legend: { selector: { all: string; inverse: string; }; }; toolbox: { brush: { title: { rect: string; polygon: string; lineX: string; lineY: string; keep: string; clear: string; }; }; dataView: { title: string; lang: string[]; }; dataZoom: { title: { zoom: string; back: string; }; }; magicType: { title: { line: string; bar: string; stack: string; tiled: string; }; }; restore: { title: string; }; saveAsImage: { title: string; lang: string[]; }; }; series: { typeNames: { pie: string; bar: string; line: string; scatter: string; effectScatter: string; radar: string; tree: string; treemap: string; boxplot: string; candlestick: string; k: string; heatmap: string; map: string; parallel: string; lines: string; graph: string; sankey: string; funnel: string; gauge: string; pictorialBar: string; themeRiver: string; sunburst: string; custom: string; chart: string; }; }; aria: { general: { withTitle: string; withoutTitle: string; }; series: { single: { prefix: string; withName: string; withoutName: string; }; multiple: { prefix: string; withName: string; withoutName: string; separator: { middle: string; end: string; }; }; }; data: { allData: string; partialData: string; withName: string; withoutName: string; separator: { middle: string; end: string; }; }; }; }; declare type LocaleOption = typeof _default$1; declare function registerLocale(locale: string, localeObj: LocaleOption): void; interface UpdateLifecycleTransitionSeriesFinder { seriesIndex?: ModelFinderIndexQuery; seriesId?: ModelFinderIdQuery; dimension: DimensionLoose; } interface UpdateLifecycleTransitionItem { from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[]; to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[]; } declare type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[]; interface UpdateLifecycleParams { updatedSeries?: SeriesModel[]; /** * If this update is from setOption and option is changed. */ optionChanged?: boolean; seriesTransition?: UpdateLifecycleTransitionOpt; } interface LifecycleEvents { 'afterinit': [EChartsType]; 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams]; 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams]; 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams]; 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams]; 'afterupdate': [GlobalModel, ExtensionAPI]; } declare abstract class Region { readonly name: string; readonly type: 'geoJSON' | 'geoSVG'; protected _center: number[]; protected _rect: BoundingRect; constructor(name: string); setCenter(center: number[]): void; /** * Get center point in data unit. That is, * for GeoJSONRegion, the unit is lat/lng, * for GeoSVGRegion, the unit is SVG local coord. */ getCenter(): number[]; abstract calcCenter(): number[]; } declare class GeoJSONPolygonGeometry { readonly type = "polygon"; exterior: number[][]; interiors?: number[][][]; constructor(exterior: number[][], interiors: number[][][]); } declare class GeoJSONLineStringGeometry { readonly type = "linestring"; points: number[][][]; constructor(points: number[][][]); } declare class GeoJSONRegion extends Region { readonly type = "geoJSON"; readonly geometries: (GeoJSONPolygonGeometry | GeoJSONLineStringGeometry)[]; properties: GeoJSON['features'][0]['properties']; constructor(name: string, geometries: GeoJSONRegion['geometries'], cp: GeoJSON['features'][0]['properties']['cp']); calcCenter(): number[]; getBoundingRect(projection?: GeoProjection): BoundingRect; contain(coord: number[]): boolean; /** * Transform the raw coords to target bounding. * @param x * @param y * @param width * @param height */ transformTo(x: number, y: number, width: number, height: number): void; cloneShallow(name: string): GeoJSONRegion; } declare type GeoSVGSourceInput = string | Document | SVGElement; declare type GeoJSONSourceInput = string | GeoJSON | GeoJSONCompressed; interface NameMap { [regionName: string]: string; } interface GeoSpecialAreas { [areaName: string]: { left: number; top: number; width?: number; height?: number; }; } interface GeoJSON extends GeoJSONFeatureCollection { } interface GeoJSONCompressed extends GeoJSONFeatureCollection { UTF8Encoding?: boolean; UTF8Scale?: number; } interface GeoJSONFeatureCollection { type: 'FeatureCollection'; features: GeoJSONFeature[]; } interface GeoJSONFeature { type: 'Feature'; id?: string | number; properties: { name?: string; cp?: number[]; [key: string]: any; }; geometry: G; } declare type GeoJSONGeometry = GeoJSONGeometryPoint | GeoJSONGeometryMultiPoint | GeoJSONGeometryLineString | GeoJSONGeometryMultiLineString | GeoJSONGeometryPolygon | GeoJSONGeometryMultiPolygon; declare type GeoJSONGeometryCompressed = GeoJSONGeometryPolygonCompressed | GeoJSONGeometryMultiPolygonCompressed | GeoJSONGeometryLineStringCompressed | GeoJSONGeometryMultiLineStringCompressed; interface GeoJSONGeometryPoint { type: 'Point'; coordinates: number[]; } interface GeoJSONGeometryMultiPoint { type: 'MultiPoint'; coordinates: number[][]; } interface GeoJSONGeometryLineString { type: 'LineString'; coordinates: number[][]; } interface GeoJSONGeometryLineStringCompressed { type: 'LineString'; coordinates: string; encodeOffsets: number[]; } interface GeoJSONGeometryMultiLineString { type: 'MultiLineString'; coordinates: number[][][]; } interface GeoJSONGeometryMultiLineStringCompressed { type: 'MultiLineString'; coordinates: string[]; encodeOffsets: number[][]; } interface GeoJSONGeometryPolygon { type: 'Polygon'; coordinates: number[][][]; } interface GeoJSONGeometryPolygonCompressed { type: 'Polygon'; coordinates: string[]; encodeOffsets: number[][]; } interface GeoJSONGeometryMultiPolygon { type: 'MultiPolygon'; coordinates: number[][][][]; } interface GeoJSONGeometryMultiPolygonCompressed { type: 'MultiPolygon'; coordinates: string[][]; encodeOffsets: number[][][]; } interface GeoResource { readonly type: 'geoJSON' | 'geoSVG'; load(nameMap: NameMap, nameProperty: string): { boundingRect: BoundingRect; regions: Region[]; regionsMap: HashMap; }; } /** * Geo stream interface compatitable with d3-geo * See the API detail in https://github.com/d3/d3-geo#streams */ interface ProjectionStream { point(x: number, y: number): void; lineStart(): void; lineEnd(): void; polygonStart(): void; polygonEnd(): void; /** * Not supported yet. */ sphere(): void; } interface GeoProjection { project(point: number[]): number[]; unproject(point: number[]): number[]; /** * Projection stream compatitable to d3-geo projection stream. * * When rotate projection is used. It may have antimeridian artifacts. * So we need to introduce the fule projection stream to do antimeridian clipping. * * project will be ignored if projectStream is given. */ stream?(outStream: ProjectionStream): ProjectionStream; } declare class GeoJSONResource implements GeoResource { readonly type = "geoJSON"; private _geoJSON; private _specialAreas; private _mapName; private _parsedMap; constructor(mapName: string, geoJSON: GeoJSONSourceInput, specialAreas: GeoSpecialAreas); /** * @param nameMap can be null/undefined * @param nameProperty can be null/undefined */ load(nameMap: NameMap, nameProperty: string): { regions: GeoJSONRegion[]; boundingRect: BoundingRect; regionsMap: HashMap; }; private _parseToRegions; /** * Only for exporting to users. * **MUST NOT** used internally. */ getMapForUser(): { geoJson: GeoJSON | GeoJSONCompressed; geoJSON: GeoJSON | GeoJSONCompressed; specialAreas: GeoSpecialAreas; }; } declare type MapInput = GeoJSONMapInput | SVGMapInput; interface GeoJSONMapInput { geoJSON: GeoJSONSourceInput; specialAreas: GeoSpecialAreas; } interface SVGMapInput { svg: GeoSVGSourceInput; } declare const _default: { /** * Compatible with previous `echarts.registerMap`. * * @usage * ```js * * echarts.registerMap('USA', geoJson, specialAreas); * * echarts.registerMap('USA', { * geoJson: geoJson, * specialAreas: {...} * }); * echarts.registerMap('USA', { * geoJSON: geoJson, * specialAreas: {...} * }); * * echarts.registerMap('airport', { * svg: svg * } * ``` * * Note: * Do not support that register multiple geoJSON or SVG * one map name. Because different geoJSON and SVG have * different unit. It's not easy to make sure how those * units are mapping/normalize. * If intending to use multiple geoJSON or SVG, we can * use multiple geo coordinate system. */ registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void; getGeoResource(mapName: string): GeoResource; /** * Only for exporting to users. * **MUST NOT** used internally. */ getMapForUser: (mapName: string) => ReturnType; load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType; }; declare type ModelFinder$1 = ModelFinder; declare const version = "5.5.1"; declare const dependencies: { zrender: string; }; declare const PRIORITY: { PROCESSOR: { FILTER: number; SERIES_FILTER: number; STATISTIC: number; }; VISUAL: { LAYOUT: number; PROGRESSIVE_LAYOUT: number; GLOBAL: number; CHART: number; POST_CHART_LAYOUT: number; COMPONENT: number; BRUSH: number; CHART_ITEM: number; ARIA: number; DECAL: number; }; }; declare const IN_MAIN_PROCESS_KEY: "__flagInMainProcess"; declare const PENDING_UPDATE: "__pendingUpdate"; declare const STATUS_NEEDS_UPDATE_KEY: "__needsUpdateStatus"; declare const CONNECT_STATUS_KEY: "__connectUpdateStatus"; declare type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt; declare type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem; interface SetOptionOpts { notMerge?: boolean; lazyUpdate?: boolean; silent?: boolean; replaceMerge?: GlobalModelSetOptionOpts['replaceMerge']; transition?: SetOptionTransitionOpt; } interface ResizeOpts { width?: number | 'auto'; height?: number | 'auto'; animation?: AnimationOption; silent?: boolean; } interface PostIniter { (chart: EChartsType): void; } declare type RenderedEventParam = { elapsedTime: number; }; declare type ECEventDefinition = { [key in ZRElementEventName]: EventCallbackSingleParam; } & { rendered: EventCallbackSingleParam; finished: () => void | boolean; } & { [key: string]: (...args: unknown[]) => void | boolean; }; declare type EChartsInitOpts = { locale?: string | LocaleOption; renderer?: RendererType; devicePixelRatio?: number; useDirtyRect?: boolean; useCoarsePointer?: boolean; pointerSize?: number; ssr?: boolean; width?: number | string; height?: number | string; }; declare class ECharts extends Eventful { /** * @readonly */ id: string; /** * Group id * @readonly */ group: string; private _ssr; private _zr; private _dom; private _model; private _throttledZrFlush; private _theme; private _locale; private _chartsViews; private _chartsMap; private _componentsViews; private _componentsMap; private _coordSysMgr; private _api; private _scheduler; private _messageCenter; private _pendingActions; protected _$eventProcessor: never; private _disposed; private _loadingFX; private [PENDING_UPDATE]; private [IN_MAIN_PROCESS_KEY]; private [CONNECT_STATUS_KEY]; private [STATUS_NEEDS_UPDATE_KEY]; constructor(dom: HTMLElement, theme?: string | ThemeOption, opts?: EChartsInitOpts); private _onframe; getDom(): HTMLElement; getId(): string; getZr(): ZRenderType; isSSR(): boolean; /** * Usage: * chart.setOption(option, notMerge, lazyUpdate); * chart.setOption(option, { * notMerge: ..., * lazyUpdate: ..., * silent: ... * }); * * @param opts opts or notMerge. * @param opts.notMerge Default `false`. * @param opts.lazyUpdate Default `false`. Useful when setOption frequently. * @param opts.silent Default `false`. * @param opts.replaceMerge Default undefined. */ setOption(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void; setOption(option: Opt, opts?: SetOptionOpts): void; /** * @deprecated */ private setTheme; private getModel; getOption(): ECBasicOption; getWidth(): number; getHeight(): number; getDevicePixelRatio(): number; /** * Get canvas which has all thing rendered * @deprecated Use renderToCanvas instead. */ getRenderedCanvas(opts?: any): HTMLCanvasElement; renderToCanvas(opts?: { backgroundColor?: ZRColor; pixelRatio?: number; }): HTMLCanvasElement; renderToSVGString(opts?: { useViewBox?: boolean; }): string; /** * Get svg data url */ getSvgDataURL(): string; getDataURL(opts?: { type?: 'png' | 'jpeg' | 'svg'; pixelRatio?: number; backgroundColor?: ZRColor; excludeComponents?: ComponentMainType[]; }): string; getConnectedDataURL(opts?: { type?: 'png' | 'jpeg' | 'svg'; pixelRatio?: number; backgroundColor?: ZRColor; connectedBackgroundColor?: ZRColor; excludeComponents?: string[]; }): string; /** * Convert from logical coordinate system to pixel coordinate system. * See CoordinateSystem#convertToPixel. */ convertToPixel(finder: ModelFinder$1, value: ScaleDataValue): number; convertToPixel(finder: ModelFinder$1, value: ScaleDataValue[]): number[]; /** * Convert from pixel coordinate system to logical coordinate system. * See CoordinateSystem#convertFromPixel. */ convertFromPixel(finder: ModelFinder$1, value: number): number; convertFromPixel(finder: ModelFinder$1, value: number[]): number[]; /** * Is the specified coordinate systems or components contain the given pixel point. * @param {Array|number} value * @return {boolean} result */ containPixel(finder: ModelFinder$1, value: number[]): boolean; /** * Get visual from series or data. * @param finder * If string, e.g., 'series', means {seriesIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex / seriesId / seriesName, * dataIndex / dataIndexInside * } * If dataIndex is not specified, series visual will be fetched, * but not data item visual. * If all of seriesIndex, seriesId, seriesName are not specified, * visual will be fetched from first series. * @param visualType 'color', 'symbol', 'symbolSize' */ getVisual(finder: ModelFinder$1, visualType: string): string | number | number[] | PatternObject | LinearGradientObject | RadialGradientObject; /** * Get view of corresponding component model */ private getViewOfComponentModel; /** * Get view of corresponding series model */ private getViewOfSeriesModel; private _initEvents; isDisposed(): boolean; clear(): void; dispose(): void; /** * Resize the chart */ resize(opts?: ResizeOpts): void; /** * Show loading effect * @param name 'default' by default * @param cfg cfg of registered loading effect */ showLoading(cfg?: object): void; showLoading(name?: string, cfg?: object): void; /** * Hide loading effect */ hideLoading(): void; makeActionFromEvent(eventObj: ECActionEvent): Payload; /** * @param opt If pass boolean, means opt.silent * @param opt.silent Default `false`. Whether trigger events. * @param opt.flush Default `undefined`. * true: Flush immediately, and then pixel in canvas can be fetched * immediately. Caution: it might affect performance. * false: Not flush. * undefined: Auto decide whether perform flush. */ dispatchAction(payload: Payload, opt?: boolean | { silent?: boolean; flush?: boolean | undefined; }): void; updateLabelLayout(): void; appendData(params: { seriesIndex: number; data: any; }): void; private static internalField; } /** * @param opts.devicePixelRatio Use window.devicePixelRatio by default * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart. * @param opts.width Use clientWidth of the input `dom` by default. * Can be 'auto' (the same as null/undefined) * @param opts.height Use clientHeight of the input `dom` by default. * Can be 'auto' (the same as null/undefined) * @param opts.locale Specify the locale. * @param opts.useDirtyRect Enable dirty rectangle rendering or not. */ declare function init(dom?: HTMLElement | null, theme?: string | object | null, opts?: EChartsInitOpts): EChartsType; /** * @usage * (A) * ```js * let chart1 = echarts.init(dom1); * let chart2 = echarts.init(dom2); * chart1.group = 'xxx'; * chart2.group = 'xxx'; * echarts.connect('xxx'); * ``` * (B) * ```js * let chart1 = echarts.init(dom1); * let chart2 = echarts.init(dom2); * echarts.connect('xxx', [chart1, chart2]); * ``` */ declare function connect(groupId: string | EChartsType[]): string; declare function disconnect(groupId: string): void; /** * Alias and backward compatibility * @deprecated */ declare const disConnect: typeof disconnect; /** * Dispose a chart instance */ declare function dispose(chart: EChartsType | HTMLElement | string): void; declare function getInstanceByDom(dom: HTMLElement): EChartsType | undefined; declare function getInstanceById(key: string): EChartsType | undefined; /** * Register theme */ declare function registerTheme(name: string, theme: ThemeOption): void; /** * Register option preprocessor */ declare function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void; declare function registerProcessor(priority: number | StageHandler | StageHandlerOverallReset, processor?: StageHandler | StageHandlerOverallReset): void; /** * Register postIniter * @param {Function} postInitFunc */ declare function registerPostInit(postInitFunc: PostIniter): void; /** * Register postUpdater * @param {Function} postUpdateFunc */ declare function registerPostUpdate(postUpdateFunc: PostUpdater): void; declare function registerUpdateLifecycle(name: T, cb: (...args: LifecycleEvents[T]) => void): void; /** * @usage * registerAction('someAction', 'someEvent', function () { ... }); * registerAction('someAction', function () { ... }); * registerAction( * {type: 'someAction', event: 'someEvent', update: 'updateView'}, * function () { ... } * ); * * @param {(string|Object)} actionInfo * @param {string} actionInfo.type * @param {string} [actionInfo.event] * @param {string} [actionInfo.update] * @param {string} [eventName] * @param {Function} action */ declare function registerAction(type: string, eventName: string, action: ActionHandler): void; declare function registerAction(type: string, action: ActionHandler): void; declare function registerAction(actionInfo: ActionInfo, action: ActionHandler): void; declare function registerCoordinateSystem(type: string, coordSysCreator: CoordinateSystemCreator): void; /** * Get dimensions of specified coordinate system. * @param {string} type * @return {Array.} */ declare function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[]; /** * Layout is a special stage of visual encoding * Most visual encoding like color are common for different chart * But each chart has it's own layout algorithm */ declare function registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void; declare function registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void; declare function registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void; declare function registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void; declare function registerLoading(name: string, loadingFx: LoadingEffectCreator): void; /** * ZRender need a canvas context to do measureText. * But in node environment canvas may be created by node-canvas. * So we need to specify how to create a canvas instead of using document.createElement('canvas') * * * @deprecated use setPlatformAPI({ createCanvas }) instead. * * @example * let Canvas = require('canvas'); * let echarts = require('echarts'); * echarts.setCanvasCreator(function () { * // Small size is enough. * return new Canvas(32, 32); * }); */ declare function setCanvasCreator(creator: () => HTMLCanvasElement): void; declare type RegisterMapParams = Parameters; /** * The parameters and usage: see `geoSourceManager.registerMap`. * Compatible with previous `echarts.registerMap`. */ declare function registerMap(mapName: RegisterMapParams[0], geoJson: RegisterMapParams[1], specialAreas?: RegisterMapParams[2]): void; declare function getMap(mapName: string): any; declare const registerTransform: typeof registerExternalTransform; declare const dataTool: {}; interface EChartsType extends ECharts { } interface ComponentView { /** * Implement it if needed. */ updateTransform?(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | { update: true; }; /** * Pass only when return `true`. * Implement it if needed. */ filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean; /** * Find dispatchers for highlight/downplay by name. * If this methods provided, hover link (within the same name) is enabled in component. * That is, in component, a name can correspond to multiple dispatchers. * Those dispatchers can have no common ancestor. * The highlight/downplay state change will be applied on the * dispatchers and their descendents. * * @return Must return an array but not null/undefined. */ findHighDownDispatchers?(name: string): Element[]; focusBlurEnabled?: boolean; } declare class ComponentView { readonly group: ViewRootGroup; readonly uid: string; __model: ComponentModel; __alive: boolean; __id: string; constructor(); init(ecModel: GlobalModel, api: ExtensionAPI): void; render(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; dispose(ecModel: GlobalModel, api: ExtensionAPI): void; updateView(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; updateLayout(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; updateVisual(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Hook for toggle blur target series. * Can be used in marker for blur or leave blur the markers */ toggleBlurSeries(seriesModels: SeriesModel[], isBlur: boolean, ecModel: GlobalModel): void; /** * Traverse the new rendered elements. * * It will traverse the new added element in progressive rendering. * And traverse all in normal rendering. */ eachRendered(cb: (el: Element) => boolean | void): void; static registerClass: ClassManager['registerClass']; } interface TaskContext { outputData?: SeriesData; data?: SeriesData; payload?: Payload; model?: SeriesModel; } declare type TaskResetCallback = (this: Task, context: Ctx) => TaskResetCallbackReturn; declare type TaskResetCallbackReturn = void | (TaskProgressCallback | TaskProgressCallback[]) | { forceFirstProgress?: boolean; progress: TaskProgressCallback | TaskProgressCallback[]; }; declare type TaskProgressCallback = (this: Task, params: TaskProgressParams, context: Ctx) => void; declare type TaskProgressParams = { start: number; end: number; count: number; next?: TaskDataIteratorNext; }; declare type TaskPlanCallback = (this: Task, context: Ctx) => TaskPlanCallbackReturn; declare type TaskPlanCallbackReturn = 'reset' | false | null | undefined; declare type TaskCountCallback = (this: Task, context: Ctx) => number; declare type TaskOnDirtyCallback = (this: Task, context: Ctx) => void; declare type TaskDataIteratorNext = () => number; declare type TaskDefineParam = { reset?: TaskResetCallback; plan?: TaskPlanCallback; count?: TaskCountCallback; onDirty?: TaskOnDirtyCallback; }; declare type PerformArgs = { step?: number; skip?: boolean; modBy?: number; modDataCount?: number; }; declare class Task { private _reset; private _plan; private _count; private _onDirty; private _progress; private _callingProgress; private _dirty; private _modBy; private _modDataCount; private _upstream; private _downstream; private _dueEnd; private _outputDueEnd; private _settedOutputEnd; private _dueIndex; private _disposed; __pipeline: Pipeline; __idxInPipeline: number; __block: boolean; context: Ctx; constructor(define: TaskDefineParam); /** * @param step Specified step. * @param skip Skip customer perform call. * @param modBy Sampling window size. * @param modDataCount Sampling count. * @return whether unfinished. */ perform(performArgs?: PerformArgs): boolean; dirty(): void; private _doProgress; private _doReset; unfinished(): boolean; /** * @param downTask The downstream task. * @return The downstream task. */ pipe(downTask: Task): void; dispose(): void; getUpstream(): Task; getDownstream(): Task; setOutputEnd(end: number): void; } declare type GeneralTask = Task; declare type SeriesTask = Task; declare type Pipeline = { id: string; head: GeneralTask; tail: GeneralTask; threshold: number; progressiveEnabled: boolean; blockIndex: number; step: number; count: number; currentTask?: GeneralTask; context?: PipelineContext; }; declare type PipelineContext = { progressiveRender: boolean; modDataCount: number; large: boolean; }; declare type PerformStageTaskOpt = { block?: boolean; setDirty?: boolean; visualType?: StageHandlerInternal['visualType']; dirtyMap?: HashMap; }; interface SeriesTaskContext extends TaskContext { model?: SeriesModel; data?: SeriesData; view?: ChartView; ecModel?: GlobalModel; api?: ExtensionAPI; useClearVisual?: boolean; plan?: StageHandlerPlan; reset?: StageHandlerReset; scheduler?: Scheduler; payload?: Payload; resetDefines?: StageHandlerProgressExecutor[]; } interface OverallTaskContext extends TaskContext { ecModel: GlobalModel; api: ExtensionAPI; overallReset: StageHandlerOverallReset; scheduler: Scheduler; payload?: Payload; } declare class Scheduler { readonly ecInstance: EChartsType; readonly api: ExtensionAPI; unfinished: boolean; private _dataProcessorHandlers; private _visualHandlers; private _allHandlers; private _stageTaskMap; private _pipelineMap; constructor(ecInstance: EChartsType, api: ExtensionAPI, dataProcessorHandlers: StageHandlerInternal[], visualHandlers: StageHandlerInternal[]); restoreData(ecModel: GlobalModel, payload: Payload): void; getPerformArgs(task: GeneralTask, isBlock?: boolean): { step: number; modBy: number; modDataCount: number; }; getPipeline(pipelineId: string): Pipeline; /** * Current, progressive rendering starts from visual and layout. * Always detect render mode in the same stage, avoiding that incorrect * detection caused by data filtering. * Caution: * `updateStreamModes` use `seriesModel.getData()`. */ updateStreamModes(seriesModel: SeriesModel, view: ChartView): void; restorePipelines(ecModel: GlobalModel): void; prepareStageTasks(): void; prepareView(view: ChartView, model: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void; performDataProcessorTasks(ecModel: GlobalModel, payload?: Payload): void; performVisualTasks(ecModel: GlobalModel, payload?: Payload, opt?: PerformStageTaskOpt): void; private _performStageTasks; performSeriesTasks(ecModel: GlobalModel): void; plan(): void; updatePayload(task: Task, payload: Payload | 'remain'): void; private _createSeriesStageTask; private _createOverallStageTask; private _pipe; static wrapStageHandler(stageHandler: StageHandler | StageHandlerOverallReset, visualType: StageHandlerInternal['visualType']): StageHandlerInternal; } interface ChartView { /** * Rendering preparation in progressive mode. * Implement it if needed. */ incrementalPrepareRender(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Render in progressive mode. * Implement it if needed. * @param params See taskParams in `stream/task.js` */ incrementalRender(params: StageHandlerProgressParams, seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Update transform directly. * Implement it if needed. */ updateTransform(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | { update: true; }; /** * The view contains the given point. * Implement it if needed. */ containPoint(point: number[], seriesModel: SeriesModel): boolean; /** * Pass only when return `true`. * Implement it if needed. */ filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean; } declare class ChartView { type: string; readonly group: ViewRootGroup; readonly uid: string; readonly renderTask: SeriesTask; /** * Ignore label line update in global stage. Will handle it in chart itself. * Used in pie / funnel */ ignoreLabelLineUpdate: boolean; __alive: boolean; __model: SeriesModel; __id: string; static protoInitialize: void; constructor(); init(ecModel: GlobalModel, api: ExtensionAPI): void; render(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Highlight series or specified data item. */ highlight(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Downplay series or specified data item. */ downplay(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Remove self. */ remove(ecModel: GlobalModel, api: ExtensionAPI): void; /** * Dispose self. */ dispose(ecModel: GlobalModel, api: ExtensionAPI): void; updateView(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; updateLayout(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; updateVisual(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void; /** * Traverse the new rendered elements. * * It will traverse the new added element in progressive rendering. * And traverse all in normal rendering. */ eachRendered(cb: (el: Element) => boolean | void): void; static markUpdateMethod(payload: Payload, methodName: keyof ChartView): void; static registerClass: ClassManager['registerClass']; } declare const availableMethods: (keyof EChartsType)[]; interface ExtensionAPI extends Pick { } declare abstract class ExtensionAPI { constructor(ecInstance: EChartsType); abstract getCoordinateSystems(): CoordinateSystemMaster[]; abstract getComponentByElement(el: Element): ComponentModel; abstract enterEmphasis(el: Element, highlightDigit?: number): void; abstract leaveEmphasis(el: Element, highlightDigit?: number): void; abstract enterSelect(el: Element): void; abstract leaveSelect(el: Element): void; abstract enterBlur(el: Element): void; abstract leaveBlur(el: Element): void; abstract getViewOfComponentModel(componentModel: ComponentModel): ComponentView; abstract getViewOfSeriesModel(seriesModel: SeriesModel): ChartView; abstract getModel(): GlobalModel; } declare const AXIS_TYPES: { readonly value: 1; readonly category: 1; readonly time: 1; readonly log: 1; }; declare type OptionAxisType = keyof typeof AXIS_TYPES; interface AxisBaseOptionCommon extends ComponentOption, AnimationOptionMixin { type?: OptionAxisType; show?: boolean; inverse?: boolean; name?: string; nameLocation?: 'start' | 'middle' | 'end'; nameRotate?: number; nameTruncate?: { maxWidth?: number; ellipsis?: string; placeholder?: string; }; nameTextStyle?: AxisNameTextStyleOption; nameGap?: number; silent?: boolean; triggerEvent?: boolean; tooltip?: { show?: boolean; }; axisLabel?: AxisLabelBaseOption; axisPointer?: CommonAxisPointerOption; axisLine?: AxisLineOption; axisTick?: AxisTickOption; minorTick?: MinorTickOption; splitLine?: SplitLineOption; minorSplitLine?: MinorSplitLineOption; splitArea?: SplitAreaOption; /** * Min value of the axis. can be: * + ScaleDataValue * + 'dataMin': use the min value in data. * + null/undefined: auto decide min value (consider pretty look and boundaryGap). */ min?: ScaleDataValue | 'dataMin' | ((extent: { min: number; max: number; }) => ScaleDataValue); /** * Max value of the axis. can be: * + ScaleDataValue * + 'dataMax': use the max value in data. * + null/undefined: auto decide max value (consider pretty look and boundaryGap). */ max?: ScaleDataValue | 'dataMax' | ((extent: { min: number; max: number; }) => ScaleDataValue); startValue?: number; } interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon { boundaryGap?: [number | string, number | string]; /** * AxisTick and axisLabel and splitLine are calculated based on splitNumber. */ splitNumber?: number; /** * Interval specifies the span of the ticks is mandatorily. */ interval?: number; /** * Specify min interval when auto calculate tick interval. */ minInterval?: number; /** * Specify max interval when auto calculate tick interval. */ maxInterval?: number; /** * If align ticks to the first axis that is not use alignTicks * If all axes has alignTicks: true. The first one will be applied. * * Will be ignored if interval is set. */ alignTicks?: boolean; } interface CategoryAxisBaseOption extends AxisBaseOptionCommon { type?: 'category'; boundaryGap?: boolean; axisLabel?: AxisLabelOption<'category'> & { interval?: 'auto' | number | ((index: number, value: string) => boolean); }; data?: (OrdinalRawValue | { value: OrdinalRawValue; textStyle?: TextCommonOption; })[]; deduplication?: boolean; axisTick?: AxisBaseOptionCommon['axisTick'] & { alignWithLabel?: boolean; interval?: 'auto' | number | ((index: number, value: string) => boolean); }; } interface ValueAxisBaseOption extends NumericAxisBaseOptionCommon { type?: 'value'; axisLabel?: AxisLabelOption<'value'>; /** * Optional value can be: * + `false`: always include value 0. * + `true`: the axis may not contain zero position. */ scale?: boolean; } interface LogAxisBaseOption extends NumericAxisBaseOptionCommon { type?: 'log'; axisLabel?: AxisLabelOption<'log'>; logBase?: number; } interface TimeAxisBaseOption extends NumericAxisBaseOptionCommon { type?: 'time'; axisLabel?: AxisLabelOption<'time'>; } interface AxisNameTextStyleOption extends TextCommonOption { rich?: Dictionary; } interface AxisLineOption { show?: boolean | 'auto'; onZero?: boolean; onZeroAxisIndex?: number; symbol?: string | [string, string]; symbolSize?: number[]; symbolOffset?: string | number | (string | number)[]; lineStyle?: LineStyleOption; } interface AxisTickOption { show?: boolean | 'auto'; inside?: boolean; length?: number; lineStyle?: LineStyleOption; customValues?: (number | string | Date)[]; } declare type AxisLabelValueFormatter = (value: number, index: number) => string; declare type AxisLabelCategoryFormatter = (value: string, index: number) => string; declare type TimeAxisLabelUnitFormatter = AxisLabelValueFormatter | string[] | string; declare type TimeAxisLabelFormatterOption = string | ((value: number, index: number, extra: { level: number; }) => string) | { year?: TimeAxisLabelUnitFormatter; month?: TimeAxisLabelUnitFormatter; week?: TimeAxisLabelUnitFormatter; day?: TimeAxisLabelUnitFormatter; hour?: TimeAxisLabelUnitFormatter; minute?: TimeAxisLabelUnitFormatter; second?: TimeAxisLabelUnitFormatter; millisecond?: TimeAxisLabelUnitFormatter; inherit?: boolean; }; declare type LabelFormatters = { value: AxisLabelValueFormatter | string; log: AxisLabelValueFormatter | string; category: AxisLabelCategoryFormatter | string; time: TimeAxisLabelFormatterOption; }; interface AxisLabelBaseOption extends Omit { show?: boolean; inside?: boolean; rotate?: number; showMinLabel?: boolean; showMaxLabel?: boolean; alignMinLabel?: TextAlign; alignMaxLabel?: TextAlign; verticalAlignMinLabel?: TextVerticalAlign; verticalAlignMaxLabel?: TextVerticalAlign; margin?: number; rich?: Dictionary; /** * If hide overlapping labels. */ hideOverlap?: boolean; customValues?: (number | string | Date)[]; color?: ColorString | ((value?: string | number, index?: number) => ColorString); overflow?: TextStyleProps['overflow']; } interface AxisLabelOption extends AxisLabelBaseOption { formatter?: LabelFormatters[TType]; } interface MinorTickOption { show?: boolean; splitNumber?: number; length?: number; lineStyle?: LineStyleOption; } interface SplitLineOption { show?: boolean; interval?: 'auto' | number | ((index: number, value: string) => boolean); lineStyle?: LineStyleOption; } interface MinorSplitLineOption { show?: boolean; lineStyle?: LineStyleOption; } interface SplitAreaOption { show?: boolean; interval?: 'auto' | number | ((index: number, value: string) => boolean); areaStyle?: AreaStyleOption; } declare type AxisBaseOption = ValueAxisBaseOption | LogAxisBaseOption | CategoryAxisBaseOption | TimeAxisBaseOption | AxisBaseOptionCommon; interface AxisModelCommonMixin extends Pick, 'option'> { axis: Axis; } declare class AxisModelCommonMixin { getNeedCrossZero(): boolean; /** * Should be implemented by each axis model if necessary. * @return coordinate system model */ getCoordSysModel(): CoordinateSystemHostModel; } declare class OrdinalMeta { readonly categories: OrdinalRawValue[]; private _needCollect; private _deduplication; private _map; readonly uid: number; constructor(opt: { categories?: OrdinalRawValue[]; needCollect?: boolean; deduplication?: boolean; }); static createByAxisModel(axisModel: Model): OrdinalMeta; getOrdinal(category: OrdinalRawValue): OrdinalNumber; /** * @return The ordinal. If not found, return NaN. */ parseAndCollect(category: OrdinalRawValue | OrdinalNumber): OrdinalNumber; private _getOrCreateMap; } interface AxisModelExtendedInCreator { getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data']; getOrdinalMeta(): OrdinalMeta; } /** * Base Axis Model for xAxis, yAxis, angleAxis, radiusAxis. singleAxis */ interface AxisBaseModel extends ComponentModel, AxisModelCommonMixin, AxisModelExtendedInCreator { axis: Axis; } declare function createAxisLabels(axis: Axis): { labels: { level?: number; formattedLabel: string; rawLabel: string; tickValue: number; }[]; labelCategoryInterval?: number; }; /** * Calculate interval for category axis ticks and labels. * To get precise result, at least one of `getRotate` and `isHorizontal` * should be implemented in axis. */ declare function calculateCategoryInterval(axis: Axis): number; interface ScaleRawExtentResult { readonly min: number; readonly max: number; readonly minFixed: boolean; readonly maxFixed: boolean; readonly isBlank: boolean; } declare class ScaleRawExtentInfo { private _needCrossZero; private _isOrdinal; private _axisDataLen; private _boundaryGapInner; private _modelMinRaw; private _modelMaxRaw; private _modelMinNum; private _modelMaxNum; private _dataMin; private _dataMax; private _determinedMin; private _determinedMax; readonly frozen: boolean; constructor(scale: Scale, model: AxisBaseModel, originalExtent: number[]); /** * Parameters depending on outside (like model, user callback) * are prepared and fixed here. */ private _prepareParams; /** * Calculate extent by prepared parameters. * This method has no external dependency and can be called duplicatedly, * getting the same result. * If parameters changed, should call this method to recalcuate. */ calculate(): ScaleRawExtentResult; modifyDataMinMax(minMaxName: 'min' | 'max', val: number): void; setDeterminedMinMax(minMaxName: 'min' | 'max', val: number): void; freeze(): void; } declare abstract class Scale = Dictionary> { type: string; private _setting; protected _extent: [number, number]; private _isBlank; readonly rawExtentInfo: ScaleRawExtentInfo; constructor(setting?: SETTING); getSetting(name: KEY): SETTING[KEY]; /** * Parse input val to valid inner number. * Notice: This would be a trap here, If the implementation * of this method depends on extent, and this method is used * before extent set (like in dataZoom), it would be wrong. * Nevertheless, parse does not depend on extent generally. */ abstract parse(val: OptionDataValue): number; /** * Whether contain the given value. */ abstract contain(val: ScaleDataValue): boolean; /** * Normalize value to linear [0, 1], return 0.5 if extent span is 0. */ abstract normalize(val: ScaleDataValue): number; /** * Scale normalized value to extent. */ abstract scale(val: number): number; /** * Set extent from data */ unionExtent(other: [number, number]): void; /** * Set extent from data */ unionExtentFromData(data: SeriesData, dim: DimensionName | DimensionLoose): void; /** * Get extent * * Extent is always in increase order. */ getExtent(): [number, number]; /** * Set extent */ setExtent(start: number, end: number): void; /** * If value is in extent range */ isInExtentRange(value: number): boolean; /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ isBlank(): boolean; /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ setBlank(isBlank: boolean): void; /** * Update interval and extent of intervals for nice ticks * * @param splitNumber Approximated tick numbers. Optional. * The implementation of `niceTicks` should decide tick numbers * whether `splitNumber` is given. * @param minInterval Optional. * @param maxInterval Optional. */ abstract calcNiceTicks(splitNumber?: number, minInterval?: number, maxInterval?: number): void; abstract calcNiceExtent(opt?: { splitNumber?: number; fixMin?: boolean; fixMax?: boolean; minInterval?: number; maxInterval?: number; }): void; /** * @return label of the tick. */ abstract getLabel(tick: ScaleTick): string; abstract getTicks(): ScaleTick[]; abstract getMinorTicks(splitNumber: number): number[][]; static registerClass: ClassManager['registerClass']; static getClass: ClassManager['getClass']; } interface TickCoord { coord: number; tickValue?: ScaleTick['value']; } /** * Base class of Axis. */ declare class Axis { /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' */ type: OptionAxisType; readonly dim: DimensionName; scale: Scale; private _extent; model: AxisBaseModel; onBand: CategoryAxisBaseOption['boundaryGap']; inverse: AxisBaseOption['inverse']; constructor(dim: DimensionName, scale: Scale, extent: [number, number]); /** * If axis extent contain given coord */ contain(coord: number): boolean; /** * If axis extent contain given data */ containData(data: ScaleDataValue): boolean; /** * Get coord extent. */ getExtent(): [number, number]; /** * Get precision used for formatting */ getPixelPrecision(dataExtent?: [number, number]): number; /** * Set coord extent */ setExtent(start: number, end: number): void; /** * Convert data to coord. Data is the rank if it has an ordinal scale */ dataToCoord(data: ScaleDataValue, clamp?: boolean): number; /** * Convert coord to data. Data is the rank if it has an ordinal scale */ coordToData(coord: number, clamp?: boolean): number; /** * Convert pixel point to data in axis */ pointToData(point: number[], clamp?: boolean): number; /** * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, * `axis.getTicksCoords` considers `onBand`, which is used by * `boundaryGap:true` of category axis and splitLine and splitArea. * @param opt.tickModel default: axis.model.getModel('axisTick') * @param opt.clamp If `true`, the first and the last * tick must be at the axis end points. Otherwise, clip ticks * that outside the axis extent. */ getTicksCoords(opt?: { tickModel?: Model; clamp?: boolean; }): TickCoord[]; getMinorTicksCoords(): TickCoord[][]; getViewLabels(): ReturnType['labels']; getLabelModel(): Model; /** * Notice here we only get the default tick model. For splitLine * or splitArea, we should pass the splitLineModel or splitAreaModel * manually when calling `getTicksCoords`. * In GL, this method may be overridden to: * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` */ getTickModel(): Model; /** * Get width of band */ getBandWidth(): number; /** * Get axis rotate, by degree. */ getRotate: () => number; /** * Only be called in category axis. * Can be overridden, consider other axes like in 3D. * @return Auto interval for cateogry axis tick and label */ calculateCategoryInterval(): ReturnType; } /** * Add a comma each three digit. */ declare function addCommas(x: string | number): string; declare function toCamelCase(str: string, upperCaseFirst?: boolean): string; declare const normalizeCssArray: typeof normalizeCssArray$1; interface TplFormatterParam extends Dictionary { $vars: string[]; } /** * Template formatter * @param {Array.|Object} paramsList */ declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string; interface RichTextTooltipMarker { renderMode: TooltipRenderMode; content: string; style: Dictionary; } declare type TooltipMarker = string | RichTextTooltipMarker; declare type TooltipMarkerType = 'item' | 'subItem'; interface GetTooltipMarkerOpt { color?: ColorString; extraCssText?: string; type?: TooltipMarkerType; renderMode?: TooltipRenderMode; markerId?: string; } declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker; declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker; /** * @deprecated Use `time/format` instead. * ISO Date format * @param {string} tpl * @param {number} value * @param {boolean} [isUTC=false] Default in local time. * see `module:echarts/scale/Time` * and `module:echarts/util/number#parseDate`. * @inner */ declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string; /** * Capital first * @param {string} str * @return {string} */ declare function capitalFirst(str: string): string; /** * This is an abstract layer to insulate the upper usage of tooltip content * from the different backends according to different `renderMode` ('html' or 'richText'). * With the help of the abstract layer, it does not need to consider how to create and * assemble html or richText snippets when making tooltip content. * * @usage * * ```ts * class XxxSeriesModel { * formatTooltip( * dataIndex: number, * multipleSeries: boolean, * dataType: string * ) { * ... * return createTooltipMarkup('section', { * header: header, * blocks: [ * createTooltipMarkup('nameValue', { * name: name, * value: value, * noValue: value == null * }) * ] * }); * } * } * ``` */ declare type TooltipMarkupBlockFragment = TooltipMarkupSection | TooltipMarkupNameValueBlock; interface TooltipMarkupBlock { sortParam?: unknown; } interface TooltipMarkupSection extends TooltipMarkupBlock { type: 'section'; header?: unknown; noHeader?: boolean; blocks?: TooltipMarkupBlockFragment[]; sortBlocks?: boolean; valueFormatter?: CommonTooltipOption['valueFormatter']; } interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock { type: 'nameValue'; markerType?: TooltipMarkerType; markerColor?: ColorString; name?: string; value?: unknown | unknown[]; valueType?: DimensionType | DimensionType[]; noName?: boolean; noValue?: boolean; dataIndex?: number; valueFormatter?: CommonTooltipOption['valueFormatter']; } declare const dimPermutations: readonly [readonly ["x0", "y0"], readonly ["x1", "y0"], readonly ["x1", "y1"], readonly ["x0", "y1"]]; /** * BrushController is not only used in "brush component", * but is also used in "tooltip DataZoom", and other possible * further brush behavior related scenarios. * So `BrushController` should not depend on "brush component model". */ declare type BrushType = 'polygon' | 'rect' | 'lineX' | 'lineY'; /** * Only for drawing (after enabledBrush). * 'line', 'rect', 'polygon' or false * If passing false/null/undefined, disable brush. * If passing 'auto', determined by panel.defaultBrushType */ declare type BrushTypeUncertain = BrushType | false | 'auto'; declare type BrushMode = 'single' | 'multiple'; declare type BrushDimensionMinMax = number[]; declare type BrushAreaRange = BrushDimensionMinMax | BrushDimensionMinMax[]; interface BrushCoverConfig { brushType: BrushType; id?: string; range?: BrushAreaRange; panelId?: string; brushMode?: BrushMode; brushStyle?: Pick; transformable?: boolean; removeOnClick?: boolean; z?: number; } declare type BrushStyleKey = 'fill' | 'stroke' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor'; declare type ECSymbol = Path & { __isEmptyBrush?: boolean; setColor: (color: ZRColor, innerColor?: ZRColor) => void; getColor: () => ZRColor; }; /** * Create a symbol element with given symbol configuration: shape, x, y, width, height, color */ declare function createSymbol(symbolType: string, x: number, y: number, w: number, h: number, color?: ZRColor, keepAspect?: boolean): ECSymbol; declare type ItemStyleKeys = 'fill' | 'stroke' | 'decal' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit'; declare type ItemStyleProps = Pick; declare class ItemStyleMixin { getItemStyle(this: Model, excludes?: readonly (keyof ItemStyleOption)[], includes?: readonly (keyof ItemStyleOption)[]): ItemStyleProps; } declare type LineStyleKeys = 'lineWidth' | 'stroke' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit'; declare type LineStyleProps = Pick; declare class LineStyleMixin { getLineStyle(this: Model, excludes?: readonly (keyof LineStyleOption)[]): LineStyleProps; } declare type SelectorType = 'all' | 'inverse'; interface LegendSelectorButtonOption { type?: SelectorType; title?: string; } /** * T: the type to be extended * ET: extended type for keys of T * ST: special type for T to be extended */ declare type ExtendPropertyType = { [key in keyof T]: key extends keyof ST ? T[key] | ET | ST[key] : T[key] | ET; }; interface LegendItemStyleOption extends ExtendPropertyType { } interface LegendLineStyleOption extends ExtendPropertyType { inactiveColor?: ColorString; inactiveWidth?: number; } interface LegendStyleOption { /** * Icon of the legend items. * @default 'roundRect' */ icon?: string; /** * Color when legend item is not selected */ inactiveColor?: ColorString; /** * Border color when legend item is not selected */ inactiveBorderColor?: ColorString; /** * Border color when legend item is not selected */ inactiveBorderWidth?: number | 'auto'; /** * Legend label formatter */ formatter?: string | ((name: string) => string); itemStyle?: LegendItemStyleOption; lineStyle?: LegendLineStyleOption; textStyle?: LabelOption; symbolRotate?: number | 'inherit'; /** * @deprecated */ symbolKeepAspect?: boolean; } interface DataItem extends LegendStyleOption { name?: string; icon?: string; textStyle?: LabelOption; tooltip?: unknown; } interface LegendTooltipFormatterParams { componentType: 'legend'; legendIndex: number; name: string; $vars: ['name']; } interface LegendIconParams { itemWidth: number; itemHeight: number; /** * symbolType is from legend.icon, legend.data.icon, or series visual */ icon: string; iconRotate: number | 'inherit'; symbolKeepAspect: boolean; itemStyle: PathStyleProps; lineStyle: LineStyleProps; } interface LegendOption extends ComponentOption, LegendStyleOption, BoxLayoutOptionMixin, BorderOptionMixin { mainType?: 'legend'; show?: boolean; orient?: LayoutOrient; align?: 'auto' | 'left' | 'right'; backgroundColor?: ColorString; /** * Border radius of background rect * @default 0 */ borderRadius?: number | number[]; /** * Padding between legend item and border. * Support to be a single number or an array. * @default 5 */ padding?: number | number[]; /** * Gap between each legend item. * @default 10 */ itemGap?: number; /** * Width of legend symbol */ itemWidth?: number; /** * Height of legend symbol */ itemHeight?: number; selectedMode?: boolean | 'single' | 'multiple'; /** * selected map of each item. Default to be selected if item is not in the map */ selected?: Dictionary; /** * Buttons for all select or inverse select. * @example * selector: [{type: 'all or inverse', title: xxx}] * selector: true * selector: ['all', 'inverse'] */ selector?: (LegendSelectorButtonOption | SelectorType)[] | boolean; selectorLabel?: LabelOption; emphasis?: { selectorLabel?: LabelOption; }; /** * Position of selector buttons. */ selectorPosition?: 'auto' | 'start' | 'end'; /** * Gap between each selector button */ selectorItemGap?: number; /** * Gap between selector buttons group and legend main items. */ selectorButtonGap?: number; data?: (string | DataItem)[]; /** * Tooltip option */ tooltip?: CommonTooltipOption; } /** * The input to define brush areas. * (1) Can be created by user when calling dispatchAction. * (2) Can be created by `BrushController` * for brush behavior. area params are picked from `cover.__brushOptoin`. * In `BrushController`, "covers" are create or updated for each "area". */ interface BrushAreaParam extends ModelFinderObject { brushType: BrushCoverConfig['brushType']; id?: BrushCoverConfig['id']; range?: BrushCoverConfig['range']; panelId?: BrushCoverConfig['panelId']; coordRange?: BrushAreaRange; coordRanges?: BrushAreaRange[]; __rangeOffset?: { offset: BrushDimensionMinMax[] | BrushDimensionMinMax; xyMinMax: BrushDimensionMinMax[]; }; } /** * Generated by `brushModel.setAreas`, which merges * `area: BrushAreaParam` and `brushModel.option: BrushOption`. * See `generateBrushOption`. */ interface BrushAreaParamInternal extends BrushAreaParam { brushMode: BrushMode; brushStyle: BrushCoverConfig['brushStyle']; transformable: BrushCoverConfig['transformable']; removeOnClick: BrushCoverConfig['removeOnClick']; z: BrushCoverConfig['z']; __rangeOffset?: { offset: BrushDimensionMinMax | BrushDimensionMinMax[]; xyMinMax: BrushDimensionMinMax[]; }; } declare type BrushToolboxIconType = BrushType | 'keep' | 'clear'; interface BrushOption extends ComponentOption, ModelFinderObject { mainType?: 'brush'; toolbox?: BrushToolboxIconType[]; brushLink?: number[] | 'all' | 'none'; throttleType?: 'fixRate' | 'debounce'; throttleDelay?: number; inBrush?: VisualOptionFixed; outOfBrush?: VisualOptionFixed; brushType?: BrushTypeUncertain; brushStyle?: { borderWidth?: number; color?: ZRColor; borderColor?: ZRColor; }; transformable?: boolean; brushMode?: BrushMode; removeOnClick?: boolean; } interface BrushSelectableArea extends BrushAreaParamInternal { boundingRect: BoundingRect; selectors: BrushCommonSelectorsForSeries; } /** * This methods are corresponding to `BrushSelectorOnBrushType`, * but `area: BrushSelectableArea` is binded to each method. */ interface BrushCommonSelectorsForSeries { point(itemLayout: number[]): boolean; rect(itemLayout: RectLike): boolean; } /** * { * [coordSysId]: { * [stackId]: {bandWidth, offset, width} * } * } */ declare type BarWidthAndOffset = Dictionary>; interface BarGridLayoutOptionForCustomSeries { count: number; barWidth?: number | string; barMaxWidth?: number | string; barMinWidth?: number | string; barGap?: number | string; barCategoryGap?: number | string; } declare type BarGridLayoutResult = BarWidthAndOffset[string][string][]; interface TransitionOptionMixin> { transition?: (keyof T & string) | ((keyof T & string)[]) | 'all'; enterFrom?: T; leaveTo?: T; enterAnimation?: AnimationOption; updateAnimation?: AnimationOption; leaveAnimation?: AnimationOption; } interface TransitionBaseDuringAPI { setTransform(key: TransformProp, val: number): this; getTransform(key: TransformProp): number; setExtra(key: string, val: unknown): this; getExtra(key: string): unknown; } interface TransitionDuringAPI extends TransitionBaseDuringAPI { setShape(key: T, val: ShapeOpt[T]): this; getShape(key: T): ShapeOpt[T]; setStyle(key: T, val: StyleOpt[T]): this; getStyle(key: T): StyleOpt[T]; } declare type AnimationKeyframe> = T & { easing?: AnimationEasing; percent?: number; }; interface ElementKeyframeAnimationOption> extends AnimationOption { loop?: boolean; keyframes?: AnimationKeyframe[]; } declare type CustomExtraElementInfo = Dictionary; declare const STYLE_VISUAL_TYPE: { readonly color: "fill"; readonly borderColor: "stroke"; }; declare type StyleVisualProps = keyof typeof STYLE_VISUAL_TYPE; declare const NON_STYLE_VISUAL_PROPS: { readonly symbol: 1; readonly symbolSize: 1; readonly symbolKeepAspect: 1; readonly legendIcon: 1; readonly visualMeta: 1; readonly liftZ: 1; readonly decal: 1; }; declare type NonStyleVisualProps = keyof typeof NON_STYLE_VISUAL_PROPS; declare type ShapeMorphingOption = { /** * If do shape morphing animation when type is changed. * Only available on path. */ morph?: boolean; }; interface CustomBaseElementOption extends Partial> { type: string; id?: string; name?: string; info?: CustomExtraElementInfo; textContent?: CustomTextOption | false; clipPath?: CustomBaseZRPathOption | false; extra?: Dictionary & TransitionOptionMixin; during?(params: TransitionBaseDuringAPI): void; enterAnimation?: AnimationOption; updateAnimation?: AnimationOption; leaveAnimation?: AnimationOption; } interface CustomDisplayableOption extends CustomBaseElementOption, Partial> { style?: ZRStyleProps; during?(params: TransitionDuringAPI): void; /** * @deprecated */ styleEmphasis?: ZRStyleProps | false; emphasis?: CustomDisplayableOptionOnState; blur?: CustomDisplayableOptionOnState; select?: CustomDisplayableOptionOnState; } interface CustomDisplayableOptionOnState extends Partial> { style?: ZRStyleProps | false; } interface CustomGroupOption extends CustomBaseElementOption, TransitionOptionMixin { type: 'group'; width?: number; height?: number; diffChildrenByName?: boolean; children: CustomElementOption[]; $mergeChildren?: false | 'byName' | 'byIndex'; keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]; } interface CustomBaseZRPathOption extends CustomDisplayableOption, ShapeMorphingOption, TransitionOptionMixin { autoBatch?: boolean; shape?: T & TransitionOptionMixin; style?: PathProps['style'] & TransitionOptionMixin; during?(params: TransitionDuringAPI): void; keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]; } interface BuiltinShapes { circle: Partial; rect: Partial; sector: Partial; polygon: Partial; polyline: Partial; line: Partial; arc: Partial; bezierCurve: Partial; ring: Partial; ellipse: Partial; compoundPath: Partial; } interface CustomSVGPathShapeOption { pathData?: string; d?: string; layout?: 'center' | 'cover'; x?: number; y?: number; width?: number; height?: number; } interface CustomSVGPathOption extends CustomBaseZRPathOption { type: 'path'; } interface CustomBuitinPathOption extends CustomBaseZRPathOption { type: T; } declare type CreateCustomBuitinPathOption = T extends any ? CustomBuitinPathOption : never; declare type CustomPathOption = CreateCustomBuitinPathOption | CustomSVGPathOption; interface CustomImageOptionOnState extends CustomDisplayableOptionOnState { style?: ImageStyleProps; } interface CustomImageOption extends CustomDisplayableOption, TransitionOptionMixin { type: 'image'; style?: ImageStyleProps & TransitionOptionMixin; emphasis?: CustomImageOptionOnState; blur?: CustomImageOptionOnState; select?: CustomImageOptionOnState; keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]; } interface CustomTextOptionOnState extends CustomDisplayableOptionOnState { style?: TextStyleProps; } interface CustomTextOption extends CustomDisplayableOption, TransitionOptionMixin { type: 'text'; style?: TextStyleProps & TransitionOptionMixin; emphasis?: CustomTextOptionOnState; blur?: CustomTextOptionOnState; select?: CustomTextOptionOnState; keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]; } declare type CustomElementOption = CustomPathOption | CustomImageOption | CustomTextOption | CustomGroupOption; declare type CustomRootElementOption = CustomElementOption & { focus?: 'none' | 'self' | 'series' | ArrayLike; blurScope?: BlurScope; emphasisDisabled?: boolean; }; interface CustomSeriesRenderItemAPI extends CustomSeriesRenderItemCoordinateSystemAPI { getWidth(): number; getHeight(): number; getZr(): ZRenderType; getDevicePixelRatio(): number; value(dim: DimensionLoose, dataIndexInside?: number): ParsedValue; ordinalRawValue(dim: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue; /** * @deprecated */ style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps; /** * @deprecated */ styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps; visual(visualType: VT, dataIndexInside?: number): VT extends NonStyleVisualProps ? DefaultDataVisual[VT] : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]] : void; barLayout(opt: BarGridLayoutOptionForCustomSeries): BarGridLayoutResult; currentSeriesIndices(): number[]; font(opt: Pick): string; } interface CustomSeriesRenderItemParamsCoordSys { type: string; } interface CustomSeriesRenderItemCoordinateSystemAPI { coord(data: OptionDataValue | OptionDataValue[], clamp?: boolean): number[]; size?(dataSize: OptionDataValue | OptionDataValue[], dataItem?: OptionDataValue | OptionDataValue[]): number | number[]; } declare type WrapEncodeDefRet = Dictionary; interface CustomSeriesRenderItemParams { context: Dictionary; dataIndex: number; seriesId: string; seriesName: string; seriesIndex: number; coordSys: CustomSeriesRenderItemParamsCoordSys; encode: WrapEncodeDefRet; dataIndexInside: number; dataInsideLength: number; actionType?: string; } declare type CustomSeriesRenderItemReturn = CustomRootElementOption | undefined | null; declare type CustomSeriesRenderItem = (params: CustomSeriesRenderItemParams, api: CustomSeriesRenderItemAPI) => CustomSeriesRenderItemReturn; interface CustomSeriesOption extends SeriesOption, // don't support StateOption in custom series. SeriesEncodeOptionMixin, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnSingleOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin { type?: 'custom'; coordinateSystem?: string | 'none'; renderItem?: CustomSeriesRenderItem; /** * @deprecated */ itemStyle?: ItemStyleOption; /** * @deprecated */ label?: LabelOption; /** * @deprecated */ emphasis?: { /** * @deprecated */ itemStyle?: ItemStyleOption; /** * @deprecated */ label?: LabelOption; }; clip?: boolean; } declare type PrepareCustomInfo = (coordSys: CoordinateSystem) => { coordSys: CustomSeriesRenderItemParamsCoordSys; api: CustomSeriesRenderItemCoordinateSystemAPI; }; interface CoordinateSystemCreator { create: (ecModel: GlobalModel, api: ExtensionAPI) => CoordinateSystemMaster[]; dimensions?: DimensionName[]; getDimensionsInfo?: () => DimensionDefinitionLoose[]; } /** * The instance get from `CoordinateSystemManger` is `CoordinateSystemMaster`. */ interface CoordinateSystemMaster { dimensions: DimensionName[]; model?: ComponentModel; update?: (ecModel: GlobalModel, api: ExtensionAPI) => void; convertToPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[]; convertFromPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[]): number | number[]; containPoint(point: number[]): boolean; getAxes?: () => Axis[]; axisPointerEnabled?: boolean; getTooltipAxes?: (dim: DimensionName | 'auto') => { baseAxes: Axis[]; otherAxes: Axis[]; }; /** * Get layout rect or coordinate system */ getRect?: () => RectLike; } /** * For example: cartesian is CoordinateSystem. * series.coordinateSystem is CoordinateSystem. */ interface CoordinateSystem { type: string; /** * Master of coordinate system. For example: * Grid is master of cartesian. */ master?: CoordinateSystemMaster; dimensions: DimensionName[]; model?: ComponentModel; /** * @param data * @param reserved Defined by the coordinate system itself * @param out * @return {Array.} point Point in global pixel coordinate system. */ dataToPoint(data: ScaleDataValue | ScaleDataValue[], reserved?: any, out?: number[]): number[]; /** * Some coord sys (like Parallel) might do not have `pointToData`, * or the meaning of this kind of features is not clear yet. * @param point point Point in global pixel coordinate system. * @param clamp Clamp range * @return data */ pointToData?(point: number[], clamp?: boolean): number | number[]; containPoint(point: number[]): boolean; getAxes?: () => Axis[]; getAxis?: (dim?: DimensionName) => Axis; getBaseAxis?: () => Axis; getOtherAxis?: (baseAxis: Axis) => Axis; clampData?: (data: ScaleDataValue[], out?: number[]) => number[]; getRoamTransform?: () => MatrixArray; getArea?: (tolerance?: number) => CoordinateSystemClipArea; getBoundingRect?: () => BoundingRect; getAxesByScale?: (scaleType: string) => Axis[]; prepareCustoms?: PrepareCustomInfo; } /** * Like GridModel, PolarModel, ... */ interface CoordinateSystemHostModel extends ComponentModel { coordinateSystem?: CoordinateSystemMaster; } /** * Clip area will be returned by getArea of CoordinateSystem. * It is used to clip the graphic elements with the contain methods. */ interface CoordinateSystemClipArea { contain(x: number, y: number): boolean; } /** * LegendVisualProvider is an bridge that pick encoded color from data and * provide to the legend component. */ declare class LegendVisualProvider { private _getDataWithEncodedVisual; private _getRawData; constructor(getDataWithEncodedVisual: () => SeriesData, getRawData: () => SeriesData); getAllNames(): string[]; containName(name: string): boolean; indexOfName(name: string): number; getItemVisual(dataIndex: number, key: string): any; } declare function makeStyleMapper(properties: readonly string[][], ignoreParent?: boolean): (model: Model, excludes?: readonly string[], includes?: readonly string[]) => PathStyleProps; declare const SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled"; interface SeriesModel { /** * Convenient for override in extended class. * Implement it if needed. */ preventIncremental(): boolean; /** * See tooltip. * Implement it if needed. * @return Point of tooltip. null/undefined can be returned. */ getTooltipPosition(dataIndex: number): number[]; /** * Get data indices for show tooltip content. See tooltip. * Implement it if needed. */ getAxisTooltipData(dim: DimensionName[], value: ScaleDataValue, baseAxis: Axis): { dataIndices: number[]; nestestValue: any; }; /** * Get position for marker */ getMarkerPosition(value: ScaleDataValue[], dims?: typeof dimPermutations[number], startingAtTick?: boolean): number[]; /** * Get legend icon symbol according to each series type */ getLegendIcon(opt: LegendIconParams): ECSymbol | Group; /** * See `component/brush/selector.js` * Defined the brush selector for this series. */ brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean; enableAriaDecal(): void; } declare class SeriesModel extends ComponentModel { type: string; defaultOption: SeriesOption; seriesIndex: number; coordinateSystem: CoordinateSystem; dataTask: SeriesTask; pipelineContext: PipelineContext; legendVisualProvider: LegendVisualProvider; visualStyleAccessPath: string; visualDrawType: 'fill' | 'stroke'; visualStyleMapper: ReturnType; ignoreStyleOnData: boolean; hasSymbolVisual: boolean; defaultSymbol: string; legendIcon: string; [SERIES_UNIVERSAL_TRANSITION_PROP]: boolean; private _selectedDataIndicesMap; readonly preventUsingHoverLayer: boolean; static protoInitialize: void; init(option: Opt, parentModel: Model, ecModel: GlobalModel): void; /** * Util for merge default and theme to option */ mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void; mergeOption(newSeriesOption: Opt, ecModel: GlobalModel): void; fillDataTextStyle(data: ArrayLike): void; /** * Init a data structure from data related option in series * Must be overridden. */ getInitialData(option: Opt, ecModel: GlobalModel): SeriesData; /** * Append data to list */ appendData(params: { data: ArrayLike; }): void; /** * Consider some method like `filter`, `map` need make new data, * We should make sure that `seriesModel.getData()` get correct * data in the stream procedure. So we fetch data from upstream * each time `task.perform` called. */ getData(dataType?: SeriesDataType): SeriesData; getAllData(): ({ data: SeriesData; type?: SeriesDataType; })[]; setData(data: SeriesData): void; getEncode(): HashMap; getSourceManager(): SourceManager; getSource(): Source; /** * Get data before processed */ getRawData(): SeriesData; getColorBy(): ColorBy; isColorBySeries(): boolean; /** * Get base axis if has coordinate system and has axis. * By default use coordSys.getBaseAxis(); * Can be overridden for some chart. * @return {type} description */ getBaseAxis(): Axis; /** * Default tooltip formatter * * @param dataIndex * @param multipleSeries * @param dataType * @param renderMode valid values: 'html'(by default) and 'richText'. * 'html' is used for rendering tooltip in extra DOM form, and the result * string is used as DOM HTML content. * 'richText' is used for rendering tooltip in rich text form, for those where * DOM operation is not supported. * @return formatted tooltip with `html` and `markers` * Notice: The override method can also return string */ formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: SeriesDataType): ReturnType; isAnimationEnabled(): boolean; restoreData(): void; getColorFromPalette(name: string, scope: any, requestColorNum?: number): ZRColor; /** * Use `data.mapDimensionsAll(coordDim)` instead. * @deprecated */ coordDimToDataDim(coordDim: DimensionName): DimensionName[]; /** * Get progressive rendering count each step */ getProgressive(): number | false; /** * Get progressive rendering count each step */ getProgressiveThreshold(): number; select(innerDataIndices: number[], dataType?: SeriesDataType): void; unselect(innerDataIndices: number[], dataType?: SeriesDataType): void; toggleSelect(innerDataIndices: number[], dataType?: SeriesDataType): void; getSelectedDataIndices(): number[]; isSelected(dataIndex: number, dataType?: SeriesDataType): boolean; isUniversalTransitionEnabled(): boolean; private _innerSelect; private _initSelectedMapFromData; static registerClass(clz: Constructor): Constructor; } interface SeriesModel extends DataFormatMixin, PaletteMixin, DataHost { /** * Get dimension to render shadow in dataZoom component */ getShadowDim?(): string; } /** * Multi dimensional data store */ declare const dataCtors: { readonly float: ArrayConstructor | Float64ArrayConstructor; readonly int: ArrayConstructor | Int32ArrayConstructor; readonly ordinal: ArrayConstructor; readonly number: ArrayConstructor; readonly time: ArrayConstructor | Float64ArrayConstructor; }; declare type DataStoreDimensionType = keyof typeof dataCtors; declare type EachCb$1 = (...args: any) => void; declare type FilterCb$1 = (...args: any) => boolean; declare type MapCb = (...args: any) => ParsedValue | ParsedValue[]; declare type DimValueGetter = (this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: DimensionIndex) => ParsedValue; interface DataStoreDimensionDefine { /** * Default to be float. */ type?: DataStoreDimensionType; /** * Only used in SOURCE_FORMAT_OBJECT_ROWS and SOURCE_FORMAT_KEYED_COLUMNS to retrieve value * by "object property". * For example, in `[{bb: 124, aa: 543}, ...]`, "aa" and "bb" is "object property". * * Deliberately name it as "property" rather than "name" to prevent it from been used in * SOURCE_FORMAT_ARRAY_ROWS, because if it comes from series, it probably * can not be shared by different series. */ property?: string; /** * When using category axis. * Category strings will be collected and stored in ordinalMeta.categories. * And store will store the index of categories. */ ordinalMeta?: OrdinalMeta; /** * Offset for ordinal parsing and collect */ ordinalOffset?: number; } /** * Basically, DataStore API keep immutable. */ declare class DataStore { private _chunks; private _provider; private _rawExtent; private _extent; private _indices; private _count; private _rawCount; private _dimensions; private _dimValueGetter; private _calcDimNameToIdx; defaultDimValueGetter: DimValueGetter; /** * Initialize from data */ initData(provider: DataProvider, inputDimensions: DataStoreDimensionDefine[], dimValueGetter?: DimValueGetter): void; getProvider(): DataProvider; /** * Caution: even when a `source` instance owned by a series, the created data store * may still be shared by different sereis (the source hash does not use all `source` * props, see `sourceManager`). In this case, the `source` props that are not used in * hash (like `source.dimensionDefine`) probably only belongs to a certain series and * thus should not be fetch here. */ getSource(): Source; /** * @caution Only used in dataStack. */ ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex; collectOrdinalMeta(dimIdx: number, ordinalMeta: OrdinalMeta): void; getOrdinalMeta(dimIdx: number): OrdinalMeta; getDimensionProperty(dimIndex: DimensionIndex): DataStoreDimensionDefine['property']; /** * Caution: Can be only called on raw data (before `this._indices` created). */ appendData(data: ArrayLike): number[]; appendValues(values: any[][], minFillLen?: number): { start: number; end: number; }; private _initDataFromProvider; count(): number; /** * Get value. Return NaN if idx is out of range. */ get(dim: DimensionIndex, idx: number): ParsedValue; getValues(idx: number): ParsedValue[]; getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[]; /** * @param dim concrete dim */ getByRawIndex(dim: DimensionIndex, rawIdx: number): ParsedValue; /** * Get sum of data in one dimension */ getSum(dim: DimensionIndex): number; /** * Get median of data in one dimension */ getMedian(dim: DimensionIndex): number; /** * Retrieve the index with given raw data index. */ indexOfRawIndex(rawIndex: number): number; /** * Retrieve the index of nearest value. * @param dim * @param value * @param [maxDistance=Infinity] * @return If and only if multiple indices have * the same value, they are put to the result. */ indicesOfNearest(dim: DimensionIndex, value: number, maxDistance?: number): number[]; getIndices(): ArrayLike; /** * Data filter. */ filter(dims: DimensionIndex[], cb: FilterCb$1): DataStore; /** * Select data in range. (For optimization of filter) * (Manually inline code, support 5 million data filtering in data zoom.) */ selectRange(range: { [dimIdx: number]: [number, number]; }): DataStore; /** * Data mapping to a new List with given dimensions */ map(dims: DimensionIndex[], cb: MapCb): DataStore; /** * @caution Danger!! Only used in dataStack. */ modify(dims: DimensionIndex[], cb: MapCb): void; private _updateDims; /** * Large data down sampling using largest-triangle-three-buckets * @param {string} valueDimension * @param {number} targetCount */ lttbDownSample(valueDimension: DimensionIndex, rate: number): DataStore; /** * Large data down sampling on given dimension * @param sampleIndex Sample index for name and id */ downSample(dimension: DimensionIndex, rate: number, sampleValue: (frameValues: ArrayLike) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike, value: ParsedValueNumeric) => number): DataStore; /** * Data iteration * @param ctx default this * @example * list.each('x', function (x, idx) {}); * list.each(['x', 'y'], function (x, y, idx) {}); * list.each(function (idx) {}) */ each(dims: DimensionIndex[], cb: EachCb$1): void; /** * Get extent of data in one dimension */ getDataExtent(dim: DimensionIndex): [number, number]; /** * Get raw data index. * Do not initialize. * Default `getRawIndex`. And it can be changed. */ getRawIndex: (idx: number) => number; /** * Get raw data item */ getRawDataItem(idx: number): OptionDataItem; /** * Clone shallow. * * @param clonedDims Determine which dims to clone. Will share the data if not specified. */ clone(clonedDims?: DimensionIndex[], ignoreIndices?: boolean): DataStore; private _copyCommonProps; private _cloneIndices; private _getRawIdxIdentity; private _getRawIdx; private _updateGetRawIdx; private static internalField; } declare class SeriesDimensionDefine { /** * Dimension type. The enumerable values are the key of * Optional. */ type?: DimensionType; /** * Dimension name. * Mandatory. */ name: string; /** * The origin name in dimsDef, see source helper. * If displayName given, the tooltip will displayed vertically. * Optional. */ displayName?: string; tooltip?: boolean; /** * This dimension maps to the the dimension in dataStore by `storeDimIndex`. * Notice the facts: * 1. When there are too many dimensions in data store, seriesData only save the * used store dimensions. * 2. We use dimensionIndex but not name to reference store dimension * becuause the dataset dimension definition might has no name specified by users, * or names in sereis dimension definition might be different from dataset. */ storeDimIndex?: number; /** * Which coordSys dimension this dimension mapped to. * A `coordDim` can be a "coordSysDim" that the coordSys required * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`), * or an generated "extra coord name" if does not mapped to any "coordSysDim" * (That is determined by whether `isExtraCoord` is `true`). * Mandatory. */ coordDim?: string; /** * The index of this dimension in `series.encode[coordDim]`. * Mandatory. */ coordDimIndex?: number; /** * The format of `otherDims` is: * ```js * { * tooltip?: number * label?: number * itemName?: number * seriesName?: number * } * ``` * * A `series.encode` can specified these fields: * ```js * encode: { * // "3, 1, 5" is the index of data dimension. * tooltip: [3, 1, 5], * label: [0, 3], * ... * } * ``` * `otherDims` is the parse result of the `series.encode` above, like: * ```js * // Suppose the index of this data dimension is `3`. * this.otherDims = { * // `3` is at the index `0` of the `encode.tooltip` * tooltip: 0, * // `3` is at the index `1` of the `encode.label` * label: 1 * }; * ``` * * This prop should never be `null`/`undefined` after initialized. */ otherDims?: DataVisualDimensions; /** * Be `true` if this dimension is not mapped to any "coordSysDim" that the * "coordSys" required. * Mandatory. */ isExtraCoord?: boolean; /** * If this dimension if for calculated value like stacking */ isCalculationCoord?: boolean; defaultTooltip?: boolean; ordinalMeta?: OrdinalMeta; /** * Whether to create inverted indices. */ createInvertedIndices?: boolean; /** * @param opt All of the fields will be shallow copied. */ constructor(opt?: object | SeriesDimensionDefine); } /** * Represents the dimension requirement of a series. * * NOTICE: * When there are too many dimensions in dataset and many series, only the used dimensions * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`. * But users may query data by other unused dimension names. * In this case, users can only query data if and only if they have defined dimension names * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from * `source` dimensions. */ declare class SeriesDataSchema { /** * When there are too many dimensions, `dimensionDefineList` might only contain * used dimensions. * * CAUTION: * Should have been sorted by `storeDimIndex` asc. * * PENDING: * The item can still be modified outsite. * But MUST NOT add/remove item of this array. */ readonly dimensions: SeriesDimensionDefine[]; readonly source: Source; private _fullDimCount; private _dimNameMap; private _dimOmitted; constructor(opt: { source: Source; dimensions: SeriesDimensionDefine[]; fullDimensionCount: number; dimensionOmitted: boolean; }); isDimensionOmitted(): boolean; private _updateDimOmitted; /** * @caution Can only be used when `dimensionOmitted: true`. * * Get index by user defined dimension name (i.e., not internal generate name). * That is, get index from `dimensionsDefine`. * If no `dimensionsDefine`, or no name get, return -1. */ getSourceDimensionIndex(dimName: DimensionName): DimensionIndex; /** * @caution Can only be used when `dimensionOmitted: true`. * * Notice: may return `null`/`undefined` if user not specify dimension names. */ getSourceDimension(dimIndex: DimensionIndex): DimensionDefinition; makeStoreSchema(): { dimensions: DataStoreDimensionDefine[]; hash: string; }; makeOutputDimensionNames(): DimensionName[]; appendCalculationDimension(dimDef: SeriesDimensionDefine): void; } /** * [REQUIREMENT_MEMO]: * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option. * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and * `root-dataset`. Them on `series` has higher priority. * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might * confuse users: whether those props indicate how to visit the upstream source or visit * the transform result source, and some transforms has nothing to do with these props, * and some transforms might have multiple upstream. * (3) Transforms should specify `metaRawOption` in each output, just like they can be * declared in `root-dataset`. * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms. * That is for reducing complexity in transforms. * PENDING: Whether to provide transposition transform? * * [IMPLEMENTAION_MEMO]: * "sourceVisitConfig" are calculated from `metaRawOption` and `data`. * They will not be calculated until `source` is about to be visited (to prevent from * duplicate calcuation). `source` is visited only in series and input to transforms. * * [DIMENSION_INHERIT_RULE]: * By default the dimensions are inherited from ancestors, unless a transform return * a new dimensions definition. * Consider the case: * ```js * dataset: [{ * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...] * }, { * transform: { type: 'filter', ... } * }] * dataset: [{ * dimension: ['Product', 'Sales', 'Prise'], * source: [ ['Cookies', 321, 44.21], ...] * }, { * transform: { type: 'filter', ... } * }] * ``` * The two types of option should have the same behavior after transform. * * * [SCENARIO]: * (1) Provide source data directly: * ```js * series: { * encode: {...}, * dimensions: [...] * seriesLayoutBy: 'row', * data: [[...]] * } * ``` * (2) Series refer to dataset. * ```js * series: [{ * encode: {...} * // Ignore datasetIndex means `datasetIndex: 0` * // and the dimensions defination in dataset is used * }, { * encode: {...}, * seriesLayoutBy: 'column', * datasetIndex: 1 * }] * ``` * (3) dataset transform * ```js * dataset: [{ * source: [...] * }, { * source: [...] * }, { * // By default from 0. * transform: { type: 'filter', config: {...} } * }, { * // Piped. * transform: [ * { type: 'filter', config: {...} }, * { type: 'sort', config: {...} } * ] * }, { * id: 'regressionData', * fromDatasetIndex: 1, * // Third-party transform * transform: { type: 'ecStat:regression', config: {...} } * }, { * // retrieve the extra result. * id: 'regressionFormula', * fromDatasetId: 'regressionData', * fromTransformResult: 1 * }] * ``` */ declare class SourceManager { private _sourceHost; private _sourceList; private _storeList; private _upstreamSignList; private _versionSignBase; private _dirty; constructor(sourceHost: DatasetModel | SeriesModel); /** * Mark dirty. */ dirty(): void; private _setLocalSource; /** * For detecting whether the upstream source is dirty, so that * the local cached source (in `_sourceList`) should be discarded. */ private _getVersionSign; /** * Always return a source instance. Otherwise throw error. */ prepareSource(): void; private _createSource; private _applyTransform; private _isDirty; /** * @param sourceIndex By default 0, means "main source". * In most cases there is only one source. */ getSource(sourceIndex?: number): Source; /** * * Get a data store which can be shared across series. * Only available for series. * * @param seriesDimRequest Dimensions that are generated in series. * Should have been sorted by `storeDimIndex` asc. */ getSharedDataStore(seriesDimRequest: SeriesDataSchema): DataStore; private _innerGetDataStore; /** * PENDING: Is it fast enough? * If no upstream, return empty array. */ private _getUpstreamSourceManagers; private _getSourceMetaRawOption; } /** * This module is imported by echarts directly. * * Notice: * Always keep this file exists for backward compatibility. * Because before 4.1.0, dataset is an optional component, * some users may import this module manually. */ interface DatasetOption extends Pick, Pick { mainType?: 'dataset'; seriesLayoutBy?: SeriesLayoutBy; sourceHeader?: OptionSourceHeader; source?: OptionSourceData; fromDatasetIndex?: number; fromDatasetId?: string; transform?: DataTransformOption | PipedDataTransformOption; fromTransformResult?: number; } declare class DatasetModel extends ComponentModel { type: string; static type: string; static defaultOption: DatasetOption; private _sourceManager; init(option: Opts, parentModel: Model, ecModel: GlobalModel): void; mergeOption(newOption: Opts, ecModel: GlobalModel): void; optionUpdated(): void; getSourceManager(): SourceManager; } declare function install(registers: EChartsExtensionInstallRegisters): void; /** * [sourceFormat] * * + "original": * This format is only used in series.data, where * itemStyle can be specified in data item. * * + "arrayRows": * [ * ['product', 'score', 'amount'], * ['Matcha Latte', 89.3, 95.8], * ['Milk Tea', 92.1, 89.4], * ['Cheese Cocoa', 94.4, 91.2], * ['Walnut Brownie', 85.4, 76.9] * ] * * + "objectRows": * [ * {product: 'Matcha Latte', score: 89.3, amount: 95.8}, * {product: 'Milk Tea', score: 92.1, amount: 89.4}, * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2}, * {product: 'Walnut Brownie', score: 85.4, amount: 76.9} * ] * * + "keyedColumns": * { * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'], * 'count': [823, 235, 1042, 988], * 'score': [95.8, 81.4, 91.2, 76.9] * } * * + "typedArray" * * + "unknown" */ interface SourceMetaRawOption { seriesLayoutBy: SeriesLayoutBy; sourceHeader: OptionSourceHeader; dimensions: DimensionDefinitionLoose[]; } interface Source extends SourceImpl { } declare class SourceImpl { /** * Not null/undefined. */ readonly data: OptionSourceData; /** * See also "detectSourceFormat". * Not null/undefined. */ readonly sourceFormat: SourceFormat; /** * 'row' or 'column' * Not null/undefined. */ readonly seriesLayoutBy: SeriesLayoutBy; /** * dimensions definition from: * (1) standalone defined in option prop `dimensions: [...]` * (2) detected from option data. See `determineSourceDimensions`. * If can not be detected (e.g., there is only pure data `[[11, 33], ...]` * `dimensionsDefine` will be null/undefined. */ readonly dimensionsDefine: DimensionDefinition[]; /** * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`. * That is the same as `sourceHeader: number`, * which means from which line the real data start. * Not null/undefined, uint. */ readonly startIndex: number; /** * Dimension count detected from data. Only works when `dimensionDefine` * does not exists. * Can be null/undefined (when unknown), uint. */ readonly dimensionsDetectedCount: number; /** * Raw props from user option. */ readonly metaRawOption: SourceMetaRawOption; constructor(fields: { data: OptionSourceData; sourceFormat: SourceFormat; seriesLayoutBy?: SeriesLayoutBy; dimensionsDefine?: DimensionDefinition[]; startIndex?: number; dimensionsDetectedCount?: number; metaRawOption?: SourceMetaRawOption; encodeDefine?: HashMap; }); } interface DataProvider { /** * true: all of the value are in primitive type (in type `OptionDataValue`). * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`). * Like `data: [ { value: xx, itemStyle: {...} }, ...]` * At present it only happen in `SOURCE_FORMAT_ORIGINAL`. */ pure?: boolean; /** * If data is persistent and will not be released after use. */ persistent?: boolean; getSource(): Source; count(): number; getItem(idx: number, out?: OptionDataItem): OptionDataItem; fillStorage?(start: number, end: number, out: ArrayLike$1[], extent: number[][]): void; appendData?(newData: ArrayLike$1): void; clean?(): void; } declare type DimensionSummaryEncode = { defaultedLabel: DimensionName[]; defaultedTooltip: DimensionName[]; [coordOrVisualDimName: string]: DimensionName[]; }; declare type DimensionSummary = { encode: DimensionSummaryEncode; userOutput: DimensionUserOuput; dataDimsOnCoord: DimensionName[]; dataDimIndicesOnCoord: DimensionIndex[]; encodeFirstDimNotExtra: { [coordDim: string]: DimensionName; }; }; declare type DimensionUserOuputEncode = { [coordOrVisualDimName: string]: DimensionIndex[]; }; declare class DimensionUserOuput { private _encode; private _cachedDimNames; private _schema?; constructor(encode: DimensionUserOuputEncode, dimRequest?: SeriesDataSchema); get(): { fullDimensions: DimensionName[]; encode: DimensionUserOuputEncode; }; /** * Get all data store dimension names. * Theoretically a series data store is defined both by series and used dataset (if any). * If some dimensions are omitted for performance reason in `this.dimensions`, * the dimension name may not be auto-generated if user does not specify a dimension name. * In this case, the dimension name is `null`/`undefined`. */ private _getFullDimensionNames; } declare class Graph { type: 'graph'; readonly nodes: GraphNode[]; readonly edges: GraphEdge[]; data: SeriesData; edgeData: SeriesData; /** * Whether directed graph. */ private _directed; private _nodesMap; /** * @type {Object.} * @private */ private _edgesMap; constructor(directed?: boolean); /** * If is directed graph */ isDirected(): boolean; /** * Add a new node */ addNode(id: string | number, dataIndex?: number): GraphNode; /** * Get node by data index */ getNodeByIndex(dataIndex: number): GraphNode; /** * Get node by id */ getNodeById(id: string): GraphNode; /** * Add a new edge */ addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number): GraphEdge; /** * Get edge by data index */ getEdgeByIndex(dataIndex: number): GraphEdge; /** * Get edge by two linked nodes */ getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge; /** * Iterate all nodes */ eachNode(cb: (this: Ctx, node: GraphNode, idx: number) => void, context?: Ctx): void; /** * Iterate all edges */ eachEdge(cb: (this: Ctx, edge: GraphEdge, idx: number) => void, context?: Ctx): void; /** * Breadth first traverse * Return true to stop traversing */ breadthFirstTraverse(cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void, startNode: GraphNode | string, direction: 'none' | 'in' | 'out', context?: Ctx): void; update(): void; /** * @return {module:echarts/data/Graph} */ clone(): Graph; } interface GraphDataProxyMixin { getValue(dimension?: DimensionLoose): ParsedValue; setVisual(key: string | Dictionary, value?: any): void; getVisual(key: string): any; setLayout(layout: any, merge?: boolean): void; getLayout(): any; getGraphicEl(): Element; getRawIndex(): number; } declare class GraphEdge { /** * The first node. If directed graph, it represents the source node. */ node1: GraphNode; /** * The second node. If directed graph, it represents the target node. */ node2: GraphNode; dataIndex: number; hostGraph: Graph; constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number); getModel(): Model; getModel(path: S): Model; getAdjacentDataIndices(): { node: number[]; edge: number[]; }; getTrajectoryDataIndices(): { node: number[]; edge: number[]; }; } interface GraphEdge extends GraphDataProxyMixin { } declare class GraphNode { id: string; inEdges: GraphEdge[]; outEdges: GraphEdge[]; edges: GraphEdge[]; hostGraph: Graph; dataIndex: number; __visited: boolean; constructor(id?: string, dataIndex?: number); /** * @return {number} */ degree(): number; /** * @return {number} */ inDegree(): number; /** * @return {number} */ outDegree(): number; getModel(): Model; getModel(path: S): Model; getAdjacentDataIndices(): { node: number[]; edge: number[]; }; getTrajectoryDataIndices(): { node: number[]; edge: number[]; }; } interface GraphNode extends GraphDataProxyMixin { } declare type TreeTraverseOrder = 'preorder' | 'postorder'; declare type TreeTraverseCallback = (this: Ctx, node: TreeNode) => boolean | void; declare type TreeTraverseOption = { order?: TreeTraverseOrder; attr?: 'children' | 'viewChildren'; }; interface TreeNodeOption extends Pick, 'name' | 'value'> { children?: TreeNodeOption[]; } declare class TreeNode { name: string; depth: number; height: number; parentNode: TreeNode; /** * Reference to list item. * Do not persistent dataIndex outside, * besause it may be changed by list. * If dataIndex -1, * this node is logical deleted (filtered) in list. */ dataIndex: number; children: TreeNode[]; viewChildren: TreeNode[]; isExpand: boolean; readonly hostTree: Tree; constructor(name: string, hostTree: Tree); /** * The node is removed. */ isRemoved(): boolean; /** * Travel this subtree (include this node). * Usage: * node.eachNode(function () { ... }); // preorder * node.eachNode('preorder', function () { ... }); // preorder * node.eachNode('postorder', function () { ... }); // postorder * node.eachNode( * {order: 'postorder', attr: 'viewChildren'}, * function () { ... } * ); // postorder * * @param options If string, means order. * @param options.order 'preorder' or 'postorder' * @param options.attr 'children' or 'viewChildren' * @param cb If in preorder and return false, * its subtree will not be visited. */ eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void; eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void; eachNode(cb: TreeTraverseCallback, context?: Ctx): void; /** * Update depth and height of this subtree. */ updateDepthAndHeight(depth: number): void; getNodeById(id: string): TreeNode; contains(node: TreeNode): boolean; /** * @param includeSelf Default false. * @return order: [root, child, grandchild, ...] */ getAncestors(includeSelf?: boolean): TreeNode[]; getAncestorsIndices(): number[]; getDescendantIndices(): number[]; getValue(dimension?: DimensionLoose): ParsedValue; setLayout(layout: any, merge?: boolean): void; /** * @return {Object} layout */ getLayout(): any; getModel(): Model; getLevelModel(): Model; /** * @example * setItemVisual('color', color); * setItemVisual({ * 'color': color * }); */ setVisual(key: string, value: any): void; setVisual(obj: Dictionary): void; /** * Get item visual * FIXME: make return type better */ getVisual(key: string): unknown; getRawIndex(): number; getId(): string; /** * index in parent's children */ getChildIndex(): number; /** * if this is an ancestor of another node * * @param node another node * @return if is ancestor */ isAncestorOf(node: TreeNode): boolean; /** * if this is an descendant of another node * * @param node another node * @return if is descendant */ isDescendantOf(node: TreeNode): boolean; } declare class Tree { type: 'tree'; root: TreeNode; data: SeriesData; hostModel: HostModel; levelModels: Model[]; private _nodes; constructor(hostModel: HostModel); /** * Travel this subtree (include this node). * Usage: * node.eachNode(function () { ... }); // preorder * node.eachNode('preorder', function () { ... }); // preorder * node.eachNode('postorder', function () { ... }); // postorder * node.eachNode( * {order: 'postorder', attr: 'viewChildren'}, * function () { ... } * ); // postorder * * @param options If string, means order. * @param options.order 'preorder' or 'postorder' * @param options.attr 'children' or 'viewChildren' * @param cb * @param context */ eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void; eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void; eachNode(cb: TreeTraverseCallback, context?: Ctx): void; getNodeByDataIndex(dataIndex: number): TreeNode; getNodeById(name: string): TreeNode; /** * Update item available by list, * when list has been performed options like 'filterSelf' or 'map'. */ update(): void; /** * Clear all layouts */ clearLayouts(): void; /** * data node format: * { * name: ... * value: ... * children: [ * { * name: ... * value: ... * children: ... * }, * ... * ] * } */ static createTree(dataRoot: T, hostModel: HostModel, beforeLink?: (data: SeriesData) => void): Tree; } declare type VisualOptionBase = { [key in BuiltinVisualProperty]?: any; }; declare type LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string; interface VisualMapOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin { mainType?: 'visualMap'; show?: boolean; align?: string; realtime?: boolean; /** * 'all' or null/undefined: all series. * A number or an array of number: the specified series. * set min: 0, max: 200, only for campatible with ec2. * In fact min max should not have default value. */ seriesIndex?: 'all' | number[] | number; /** * min value, must specified if pieces is not specified. */ min?: number; /** * max value, must specified if pieces is not specified. */ max?: number; /** * Dimension to be encoded */ dimension?: number; /** * Visual configuration for the data in selection */ inRange?: T; /** * Visual configuration for the out of selection */ outOfRange?: T; controller?: { inRange?: T; outOfRange?: T; }; target?: { inRange?: T; outOfRange?: T; }; /** * Width of the display item */ itemWidth?: number; /** * Height of the display item */ itemHeight?: number; inverse?: boolean; orient?: 'horizontal' | 'vertical'; backgroundColor?: ZRColor; contentColor?: ZRColor; inactiveColor?: ZRColor; /** * Padding of the component. Can be an array similar to CSS */ padding?: number[] | number; /** * Gap between text and item */ textGap?: number; precision?: number; /** * @deprecated * Option from version 2 */ color?: ColorString[]; formatter?: string | LabelFormatter; /** * Text on the both end. Such as ['High', 'Low'] */ text?: string[]; textStyle?: LabelOption; categories?: unknown; } interface VisualMeta { stops: { value: number; color: ColorString; }[]; outerColors: ColorString[]; dimension?: DimensionIndex; } declare type ItrParamDims = DimensionLoose | Array; declare type CtxOrList = unknown extends Ctx ? SeriesData : Ctx; declare type EachCb0 = (this: CtxOrList, idx: number) => void; declare type EachCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => void; declare type EachCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => void; declare type EachCb = (this: CtxOrList, ...args: any) => void; declare type FilterCb0 = (this: CtxOrList, idx: number) => boolean; declare type FilterCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => boolean; declare type FilterCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => boolean; declare type FilterCb = (this: CtxOrList, ...args: any) => boolean; declare type MapArrayCb0 = (this: CtxOrList, idx: number) => any; declare type MapArrayCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => any; declare type MapArrayCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => any; declare type MapArrayCb = (this: CtxOrList, ...args: any) => any; declare type MapCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[]; declare type MapCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => ParsedValue | ParsedValue[]; declare type SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine; declare type SeriesDimensionLoose = DimensionLoose; declare type SeriesDimensionName = DimensionName; interface DefaultDataVisual { style: PathStyleProps; drawType: 'fill' | 'stroke'; symbol?: string; symbolSize?: number | number[]; symbolRotate?: number; symbolKeepAspect?: boolean; symbolOffset?: string | number | (string | number)[]; liftZ?: number; legendIcon?: string; legendLineStyle?: LineStyleProps; visualMeta?: VisualMeta[]; colorFromPalette?: boolean; decal?: DecalObject; } interface DataCalculationInfo { stackedDimension: DimensionName; stackedByDimension: DimensionName; isStackedByIndex: boolean; stackedOverDimension: DimensionName; stackResultDimension: DimensionName; stackedOnSeries?: SERIES_MODEL; } declare class SeriesData { readonly type = "list"; /** * Name of dimensions list of SeriesData. * * @caution Carefully use the index of this array. * Because when DataStore is an extra high dimension(>30) dataset. We will only pick * the used dimensions from DataStore to avoid performance issue. */ readonly dimensions: SeriesDimensionName[]; private _dimInfos; private _dimOmitted; private _schema?; /** * @pending * Actually we do not really need to convert dimensionIndex to dimensionName * and do not need `_dimIdxToName` if we do everything internally based on dimension * index rather than dimension name. */ private _dimIdxToName?; readonly hostModel: HostModel; /** * @readonly */ dataType: SeriesDataType; /** * @readonly * Host graph if List is used to store graph nodes / edges. */ graph?: Graph; /** * @readonly * Host tree if List is used to store tree nodes. */ tree?: Tree; private _store; private _nameList; private _idList; private _visual; private _layout; private _itemVisuals; private _itemLayouts; private _graphicEls; private _approximateExtent; private _dimSummary; private _invertedIndicesMap; private _calculationInfo; userOutput: DimensionSummary['userOutput']; hasItemOption: boolean; private _nameRepeatCount; private _nameDimIdx; private _idDimIdx; private __wrappedMethods; TRANSFERABLE_METHODS: readonly ["cloneShallow", "downSample", "lttbDownSample", "map"]; CHANGABLE_METHODS: readonly ["filterSelf", "selectRange"]; DOWNSAMPLE_METHODS: readonly ["downSample", "lttbDownSample"]; /** * @param dimensionsInput.dimensions * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius */ constructor(dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[], hostModel: HostModel); /** * * Get concrete dimension name by dimension name or dimension index. * If input a dimension name, do not validate whether the dimension name exits. * * @caution * @param dim Must make sure the dimension is `SeriesDimensionLoose`. * Because only those dimensions will have auto-generated dimension names if not * have a user-specified name, and other dimensions will get a return of null/undefined. * * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples: * ```js * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx); * ``` * * @return Concrete dim name. */ getDimension(dim: SeriesDimensionLoose): DimensionName; /** * Get dimension index in data store. Return -1 if not found. * Can be used to index value from getRawValue. */ getDimensionIndex(dim: DimensionLoose): DimensionIndex; /** * The meanings of the input parameter `dim`: * * + If dim is a number (e.g., `1`), it means the index of the dimension. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. * + If dim is a number-like string (e.g., `"1"`): * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`, * it means that concrete name. * + If not, it will be converted to a number, which means the index of the dimension. * (why? because of the backward compatibility. We have been tolerating number-like string in * dimension setting, although now it seems that it is not a good idea.) * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`, * if no dimension name is defined as `"1"`. * + If dim is a not-number-like string, it means the concrete dim name. * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`, * or customized in `dimensions` property of option like `"age"`. * * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`). */ private _recognizeDimIndex; private _getStoreDimIndex; /** * Get type and calculation info of particular dimension * @param dim * Dimension can be concrete names like x, y, z, lng, lat, angle, radius * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' */ getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine; /** * If `dimName` if from outside of `SeriesData`, * use this method other than visit `this._dimInfos` directly. */ private _getDimInfo; private _initGetDimensionInfo; /** * concrete dimension name list on coord. */ getDimensionsOnCoord(): SeriesDimensionName[]; /** * @param coordDim * @param idx A coordDim may map to more than one data dim. * If not specified, return the first dim not extra. * @return concrete data dim. If not found, return null/undefined */ mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName; mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName; mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[]; getStore(): DataStore; /** * Initialize from data * @param data source or data or data store. * @param nameList The name of a datum is used on data diff and * default label/tooltip. * A name can be specified in encode.itemName, * or dataItem.name (only for series option data), * or provided in nameList from outside. */ initData(data: Source | OptionSourceData | DataStore | DataProvider, nameList?: string[], dimValueGetter?: DimValueGetter): void; /** * Caution: Can be only called on raw data (before `this._indices` created). */ appendData(data: ArrayLike$1): void; /** * Caution: Can be only called on raw data (before `this._indices` created). * This method does not modify `rawData` (`dataProvider`), but only * add values to store. * * The final count will be increased by `Math.max(values.length, names.length)`. * * @param values That is the SourceType: 'arrayRows', like * [ * [12, 33, 44], * [NaN, 43, 1], * ['-', 'asdf', 0] * ] * Each item is exactly corresponding to a dimension. */ appendValues(values: any[][], names?: string[]): void; private _updateOrdinalMeta; private _shouldMakeIdFromName; private _doInit; /** * PENDING: In fact currently this function is only used to short-circuit * the calling of `scale.unionExtentFromData` when data have been filtered by modules * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on * an axis, but if a "axis related data filter module" is used, the extent of the axis have * been fixed and no need to calling `scale.unionExtentFromData` actually. * But if we add "custom data filter" in future, which is not "axis related", this method may * be still needed. * * Optimize for the scenario that data is filtered by a given extent. * Consider that if data amount is more than hundreds of thousand, * extent calculation will cost more than 10ms and the cache will * be erased because of the filtering. */ getApproximateExtent(dim: SeriesDimensionLoose): [number, number]; /** * Calculate extent on a filtered data might be time consuming. * Approximate extent is only used for: calculate extent of filtered data outside. */ setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void; getCalculationInfo>(key: CALC_INFO_KEY): DataCalculationInfo[CALC_INFO_KEY]; /** * @param key or k-v object */ setCalculationInfo(key: DataCalculationInfo): void; setCalculationInfo>(key: CALC_INFO_KEY, value: DataCalculationInfo[CALC_INFO_KEY]): void; /** * @return Never be null/undefined. `number` will be converted to string. Because: * In most cases, name is used in display, where returning a string is more convenient. * In other cases, name is used in query (see `indexOfName`), where we can keep the * rule that name `2` equals to name `'2'`. */ getName(idx: number): string; private _getCategory; /** * @return Never null/undefined. `number` will be converted to string. Because: * In all cases having encountered at present, id is used in making diff comparison, which * are usually based on hash map. We can keep the rule that the internal id are always string * (treat `2` is the same as `'2'`) to make the related logic simple. */ getId(idx: number): string; count(): number; /** * Get value. Return NaN if idx is out of range. * * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead. */ get(dim: SeriesDimensionName, idx: number): ParsedValue; /** * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead. */ getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue; getIndices(): globalThis.ArrayLike; getDataExtent(dim: DimensionLoose): [number, number]; getSum(dim: DimensionLoose): number; getMedian(dim: DimensionLoose): number; /** * Get value for multi dimensions. * @param dimensions If ignored, using all dimensions. */ getValues(idx: number): ParsedValue[]; getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[]; /** * If value is NaN. Including '-' * Only check the coord dimensions. */ hasValue(idx: number): boolean; /** * Retrieve the index with given name */ indexOfName(name: string): number; getRawIndex(idx: number): number; indexOfRawIndex(rawIndex: number): number; /** * Only support the dimension which inverted index created. * Do not support other cases until required. * @param dim concrete dim * @param value ordinal index * @return rawIndex */ rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number; /** * Retrieve the index of nearest value * @param dim * @param value * @param [maxDistance=Infinity] * @return If and only if multiple indices has * the same value, they are put to the result. */ indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[]; /** * Data iteration * @param ctx default this * @example * list.each('x', function (x, idx) {}); * list.each(['x', 'y'], function (x, y, idx) {}); * list.each(function (idx) {}) */ each(cb: EachCb0, ctx?: Ctx, ctxCompat?: Ctx): void; each(dims: DimensionLoose, cb: EachCb1, ctx?: Ctx): void; each(dims: [DimensionLoose], cb: EachCb1, ctx?: Ctx): void; each(dims: [DimensionLoose, DimensionLoose], cb: EachCb2, ctx?: Ctx): void; each(dims: ItrParamDims, cb: EachCb, ctx?: Ctx): void; /** * Data filter */ filterSelf(cb: FilterCb0, ctx?: Ctx, ctxCompat?: Ctx): this; filterSelf(dims: DimensionLoose, cb: FilterCb1, ctx?: Ctx): this; filterSelf(dims: [DimensionLoose], cb: FilterCb1, ctx?: Ctx): this; filterSelf(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2, ctx?: Ctx): this; filterSelf(dims: ItrParamDims, cb: FilterCb, ctx?: Ctx): this; /** * Select data in range. (For optimization of filter) * (Manually inline code, support 5 million data filtering in data zoom.) */ selectRange(range: Record): SeriesData; /** * Data mapping to a plain array */ mapArray>(cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[]; mapArray>(dims: DimensionLoose, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[]; mapArray>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[]; mapArray>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[]; mapArray>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[]; /** * Data mapping to a new List with given dimensions */ map(dims: DimensionLoose, cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): SeriesData; map(dims: [DimensionLoose], cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): SeriesData; map(dims: [DimensionLoose, DimensionLoose], cb: MapCb2, ctx?: Ctx, ctxCompat?: Ctx): SeriesData; /** * !!Danger: used on stack dimension only. */ modify(dims: DimensionLoose, cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): void; modify(dims: [DimensionLoose], cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): void; modify(dims: [DimensionLoose, DimensionLoose], cb: MapCb2, ctx?: Ctx, ctxCompat?: Ctx): void; /** * Large data down sampling on given dimension * @param sampleIndex Sample index for name and id */ downSample(dimension: DimensionLoose, rate: number, sampleValue: (frameValues: ArrayLike$1) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike$1, value: ParsedValueNumeric) => number): SeriesData; /** * Large data down sampling using largest-triangle-three-buckets * @param {string} valueDimension * @param {number} targetCount */ lttbDownSample(valueDimension: DimensionLoose, rate: number): SeriesData; getRawDataItem(idx: number): OptionDataItem; /** * Get model of one data item. */ getItemModel(idx: number): Model; /** * Create a data differ */ diff(otherList: SeriesData): DataDiffer; /** * Get visual property. */ getVisual(key: K): Visual[K]; /** * Set visual property * * @example * setVisual('color', color); * setVisual({ * 'color': color * }); */ setVisual(key: K, val: Visual[K]): void; setVisual(kvObj: Partial): void; /** * Get visual property of single data item */ getItemVisual(idx: number, key: K): Visual[K]; /** * If exists visual property of single data item */ hasItemVisual(): boolean; /** * Make sure itemVisual property is unique */ ensureUniqueItemVisual(idx: number, key: K): Visual[K]; /** * Set visual property of single data item * * @param {number} idx * @param {string|Object} key * @param {*} [value] * * @example * setItemVisual(0, 'color', color); * setItemVisual(0, { * 'color': color * }); */ setItemVisual(idx: number, key: K, value: Visual[K]): void; setItemVisual(idx: number, kvObject: Partial): void; /** * Clear itemVisuals and list visual. */ clearAllVisual(): void; /** * Set layout property. */ setLayout(key: string, val: any): void; setLayout(kvObj: Dictionary): void; /** * Get layout property. */ getLayout(key: string): any; /** * Get layout of single data item */ getItemLayout(idx: number): any; /** * Set layout of single data item */ setItemLayout(idx: number, layout: (M extends true ? Dictionary : any), merge?: M): void; /** * Clear all layout of single data item */ clearItemLayouts(): void; /** * Set graphic element relative to data. It can be set as null */ setItemGraphicEl(idx: number, el: Element): void; getItemGraphicEl(idx: number): Element; eachItemGraphicEl(cb: (this: Ctx, el: Element, idx: number) => void, context?: Ctx): void; /** * Shallow clone a new list except visual and layout properties, and graph elements. * New list only change the indices. */ cloneShallow(list?: SeriesData): SeriesData; /** * Wrap some method to add more feature */ wrapMethod(methodName: FunctionPropertyNames, injectFunction: (...args: any) => any): void; private static internalField; } interface SeriesData { getLinkedData(dataType?: SeriesDataType): SeriesData; getLinkedDataAll(): { data: SeriesData; type?: SeriesDataType; }[]; } /** * If string, e.g., 'geo', means {geoIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex, seriesId, seriesName, * geoIndex, geoId, geoName, * bmapIndex, bmapId, bmapName, * xAxisIndex, xAxisId, xAxisName, * yAxisIndex, yAxisId, yAxisName, * gridIndex, gridId, gridName, * ... (can be extended) * } * Each properties can be number|string|Array.|Array. * For example, a finder could be * { * seriesIndex: 3, * geoId: ['aa', 'cc'], * gridName: ['xx', 'rr'] * } * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify) * If nothing or null/undefined specified, return nothing. * If both `abcIndex`, `abcId`, `abcName` specified, only one work. * The priority is: index > id > name, the same with `ecModel.queryComponents`. */ declare type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false; declare type ModelFinderIdQuery = OptionId | OptionId[]; declare type ModelFinderNameQuery = OptionId | OptionId[]; declare type ModelFinder = string | ModelFinderObject; declare type ModelFinderObject = { seriesIndex?: ModelFinderIndexQuery; seriesId?: ModelFinderIdQuery; seriesName?: ModelFinderNameQuery; geoIndex?: ModelFinderIndexQuery; geoId?: ModelFinderIdQuery; geoName?: ModelFinderNameQuery; bmapIndex?: ModelFinderIndexQuery; bmapId?: ModelFinderIdQuery; bmapName?: ModelFinderNameQuery; xAxisIndex?: ModelFinderIndexQuery; xAxisId?: ModelFinderIdQuery; xAxisName?: ModelFinderNameQuery; yAxisIndex?: ModelFinderIndexQuery; yAxisId?: ModelFinderIdQuery; yAxisName?: ModelFinderNameQuery; gridIndex?: ModelFinderIndexQuery; gridId?: ModelFinderIdQuery; gridName?: ModelFinderNameQuery; dataIndex?: number; dataIndexInside?: number; }; /** * { * seriesModels: [seriesModel1, seriesModel2], * seriesModel: seriesModel1, // The first model * geoModels: [geoModel1, geoModel2], * geoModel: geoModel1, // The first model * ... * } */ declare type ParsedModelFinder = { [key: string]: ComponentModel | ComponentModel[] | undefined; }; declare type QueryReferringOpt = { useDefault?: boolean; enableAll?: boolean; enableNone?: boolean; }; declare class ComponentModel extends Model { /** * @readonly */ type: ComponentFullType; /** * @readonly */ id: string; /** * Because simplified concept is probably better, series.name (or component.name) * has been having too many responsibilities: * (1) Generating id (which requires name in option should not be modified). * (2) As an index to mapping series when merging option or calling API (a name * can refer to more than one component, which is convenient is some cases). * (3) Display. * @readOnly But injected */ name: string; /** * @readOnly */ mainType: ComponentMainType; /** * @readOnly */ subType: ComponentSubType; /** * @readOnly */ componentIndex: number; /** * @readOnly */ protected defaultOption: ComponentOption; /** * @readOnly */ ecModel: GlobalModel; /** * @readOnly */ static dependencies: string[]; readonly uid: string; /** * Support merge layout params. * Only support 'box' now (left/right/top/bottom/width/height). */ static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type']; /** * Prevent from auto set z, zlevel, z2 by the framework. */ preventAutoZ: boolean; __viewId: string; __requireNewView: boolean; static protoInitialize: void; constructor(option: Opt, parentModel: Model, ecModel: GlobalModel); init(option: Opt, parentModel: Model, ecModel: GlobalModel): void; mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void; mergeOption(option: Opt, ecModel: GlobalModel): void; /** * Called immediately after `init` or `mergeOption` of this instance called. */ optionUpdated(newCptOption: Opt, isInit: boolean): void; /** * [How to declare defaultOption]: * * (A) If using class declaration in typescript (since echarts 5): * ```ts * import {ComponentOption} from '../model/option.js'; * export interface XxxOption extends ComponentOption { * aaa: number * } * export class XxxModel extends Component { * static type = 'xxx'; * static defaultOption: XxxOption = { * aaa: 123 * } * } * Component.registerClass(XxxModel); * ``` * ```ts * import {inheritDefaultOption} from '../util/component.js'; * import {XxxModel, XxxOption} from './XxxModel.js'; * export interface XxxSubOption extends XxxOption { * bbb: number * } * class XxxSubModel extends XxxModel { * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, { * bbb: 456 * }) * fn() { * let opt = this.getDefaultOption(); * // opt is {aaa: 123, bbb: 456} * } * } * ``` * * (B) If using class extend (previous approach in echarts 3 & 4): * ```js * let XxxComponent = Component.extend({ * defaultOption: { * xx: 123 * } * }) * ``` * ```js * let XxxSubComponent = XxxComponent.extend({ * defaultOption: { * yy: 456 * }, * fn: function () { * let opt = this.getDefaultOption(); * // opt is {xx: 123, yy: 456} * } * }) * ``` */ getDefaultOption(): Opt; /** * Notice: always force to input param `useDefault` in case that forget to consider it. * The same behavior as `modelUtil.parseFinder`. * * @param useDefault In many cases like series refer axis and axis refer grid, * If axis index / axis id not specified, use the first target as default. * In other cases like dataZoom refer axis, if not specified, measn no refer. */ getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): { models: ComponentModel[]; specified: boolean; }; getBoxLayoutParams(): { left: string | number; top: string | number; right: string | number; bottom: string | number; width: string | number; height: string | number; }; /** * Get key for zlevel. * If developers don't configure zlevel. We will assign zlevel to series based on the key. * For example, lines with trail effect and progressive series will in an individual zlevel. */ getZLevelKey(): string; setZLevel(zlevel: number): void; static registerClass: ClassManager['registerClass']; static hasClass: ClassManager['hasClass']; static registerSubTypeDefaulter: SubTypeDefaulterManager['registerSubTypeDefaulter']; } declare type LabelFontOption = Pick; declare type LabelRectRelatedOption = Pick & LabelFontOption; declare class TextStyleMixin { /** * Get color property or get color from option.textStyle.color */ getTextColor(this: Model, isEmphasis?: boolean): ColorString; /** * Create font string from fontStyle, fontWeight, fontSize, fontFamily * @return {string} */ getFont(this: Model): string; getTextRect(this: Model & TextStyleMixin, text: string): BoundingRect; } interface Model extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin { } declare class Model { parentModel: Model; ecModel: GlobalModel; option: Opt; constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel); init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void; /** * Merge the input option to me. */ mergeOption(option: Opt, ecModel?: GlobalModel): void; get(path: R, ignoreParent?: boolean): Opt[R]; get(path: readonly [R], ignoreParent?: boolean): Opt[R]; get(path: readonly [R, S], ignoreParent?: boolean): Opt[R][S]; get(path: readonly [R, S, T], ignoreParent?: boolean): Opt[R][S][T]; getShallow(key: R, ignoreParent?: boolean): Opt[R]; getModel(path: R, parentModel?: Model): Model; getModel(path: readonly [R], parentModel?: Model): Model; getModel(path: readonly [R, S], parentModel?: Model): Model; getModel(path: readonly [Ra] | readonly [Rb, S], parentModel?: Model): Model | Model; getModel(path: readonly [R, S, T], parentModel?: Model): Model; /** * If model has option */ isEmpty(): boolean; restoreData(): void; clone(): Model; parsePath(path: string | readonly string[]): readonly string[]; resolveParentPath(path: readonly string[]): string[]; isAnimationEnabled(): boolean; private _doGet; } /** * ECharts option manager */ /** * TERM EXPLANATIONS: * See `ECOption` and `ECUnitOption` in `src/util/types.ts`. */ declare class OptionManager { private _api; private _timelineOptions; private _mediaList; private _mediaDefault; /** * -1, means default. * empty means no media. */ private _currentMediaIndices; private _optionBackup; private _newBaseOption; constructor(api: ExtensionAPI); setOption(rawOption: ECBasicOption, optionPreprocessorFuncs: OptionPreprocessor[], opt: InnerSetOptionOpts): void; mountOption(isRecreate: boolean): ECUnitOption; getTimelineOption(ecModel: GlobalModel): ECUnitOption; getMediaOption(ecModel: GlobalModel): ECUnitOption[]; } /** * Caution: If the mechanism should be changed some day, these cases * should be considered: * * (1) In `merge option` mode, if using the same option to call `setOption` * many times, the result should be the same (try our best to ensure that). * (2) In `merge option` mode, if a component has no id/name specified, it * will be merged by index, and the result sequence of the components is * consistent to the original sequence. * (3) In `replaceMerge` mode, keep the result sequence of the components is * consistent to the original sequence, even though there might result in "hole". * (4) `reset` feature (in toolbox). Find detailed info in comments about * `mergeOption` in module:echarts/model/OptionManager. */ interface GlobalModelSetOptionOpts { replaceMerge: ComponentMainType | ComponentMainType[]; } interface InnerSetOptionOpts { replaceMergeMainTypeMap: HashMap; } /** * @param condition.mainType Mandatory. * @param condition.subType Optional. * @param condition.query like {xxxIndex, xxxId, xxxName}, * where xxx is mainType. * If query attribute is null/undefined or has no index/id/name, * do not filtering by query conditions, which is convenient for * no-payload situations or when target of action is global. * @param condition.filter parameter: component, return boolean. */ interface QueryConditionKindA { mainType: ComponentMainType; subType?: ComponentSubType; query?: { [k: string]: number | number[] | string | string[]; }; filter?: (cmpt: ComponentModel) => boolean; } /** * If none of index and id and name used, return all components with mainType. * @param condition.mainType * @param condition.subType If ignore, only query by mainType * @param condition.index Either input index or id or name. * @param condition.id Either input index or id or name. * @param condition.name Either input index or id or name. */ interface QueryConditionKindB { mainType: ComponentMainType; subType?: ComponentSubType; index?: number | number[]; id?: OptionId | OptionId[]; name?: OptionName | OptionName[]; } interface EachComponentAllCallback { (mainType: string, model: ComponentModel, componentIndex: number): void; } interface EachComponentInMainTypeCallback { (model: ComponentModel, componentIndex: number): void; } declare class GlobalModel extends Model { option: ECUnitOption; private _theme; private _locale; private _optionManager; private _componentsMap; /** * `_componentsMap` might have "hole" because of remove. * So save components count for a certain mainType here. */ private _componentsCount; /** * Mapping between filtered series list and raw series list. * key: filtered series indices, value: raw series indices. * Items of `_seriesIndices` never be null/empty/-1. * If series has been removed by `replaceMerge`, those series * also won't be in `_seriesIndices`, just like be filtered. */ private _seriesIndices; /** * Key: seriesIndex. * Keep consistent with `_seriesIndices`. */ private _seriesIndicesMap; /** * Model for store update payload */ private _payload; scheduler: Scheduler; ssr: boolean; init(option: ECBasicOption, parentModel: Model, ecModel: GlobalModel, theme: object, locale: object, optionManager: OptionManager): void; setOption(option: ECBasicOption, opts: GlobalModelSetOptionOpts, optionPreprocessorFuncs: OptionPreprocessor[]): void; /** * @param type null/undefined: reset all. * 'recreate': force recreate all. * 'timeline': only reset timeline option * 'media': only reset media query option * @return Whether option changed. */ resetOption(type: 'recreate' | 'timeline' | 'media', opt?: Pick): boolean; private _resetOption; mergeOption(option: ECUnitOption): void; private _mergeOption; /** * Get option for output (cloned option and inner info removed) */ getOption(): ECUnitOption; getTheme(): Model; getLocaleModel(): Model; setUpdatePayload(payload: Payload): void; getUpdatePayload(): Payload; /** * @param idx If not specified, return the first one. */ getComponent(mainType: ComponentMainType, idx?: number): ComponentModel; /** * @return Never be null/undefined. */ queryComponents(condition: QueryConditionKindB): ComponentModel[]; /** * The interface is different from queryComponents, * which is convenient for inner usage. * * @usage * let result = findComponents( * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} * ); * let result = findComponents( * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} * ); * let result = findComponents( * {mainType: 'series', * filter: function (model, index) {...}} * ); * // result like [component0, componnet1, ...] */ findComponents(condition: QueryConditionKindA): ComponentModel[]; /** * Travel components (before filtered). * * @usage * eachComponent('legend', function (legendModel, index) { * ... * }); * eachComponent(function (componentType, model, index) { * // componentType does not include subType * // (componentType is 'a' but not 'a.b') * }); * eachComponent( * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}, * function (model, index) {...} * ); * eachComponent( * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}, * function (model, index) {...} * ); */ eachComponent(cb: EachComponentAllCallback, context?: T): void; eachComponent(mainType: string, cb: EachComponentInMainTypeCallback, context?: T): void; eachComponent(mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T): void; /** * Get series list before filtered by name. */ getSeriesByName(name: OptionName): SeriesModel[]; /** * Get series list before filtered by index. */ getSeriesByIndex(seriesIndex: number): SeriesModel; /** * Get series list before filtered by type. * FIXME: rename to getRawSeriesByType? */ getSeriesByType(subType: ComponentSubType): SeriesModel[]; /** * Get all series before filtered. */ getSeries(): SeriesModel[]; /** * Count series before filtered. */ getSeriesCount(): number; /** * After filtering, series may be different * from raw series. */ eachSeries(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void; /** * Iterate raw series before filtered. * * @param {Function} cb * @param {*} context */ eachRawSeries(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void; /** * After filtering, series may be different. * from raw series. */ eachSeriesByType(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void; /** * Iterate raw series before filtered of given type. */ eachRawSeriesByType(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void; isSeriesFiltered(seriesModel: SeriesModel): boolean; getCurrentSeriesIndices(): number[]; filterSeries(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean, context?: T): void; restoreData(payload?: Payload): void; private static internalField; } interface GlobalModel extends PaletteMixin { } interface DataFormatMixin extends DataHost { ecModel: GlobalModel; mainType: ComponentMainType; subType: ComponentSubType; componentIndex: number; id: string; name: string; animatedValue: OptionDataValue[]; } declare class DataFormatMixin { /** * Get params for formatter */ getDataParams(dataIndex: number, dataType?: SeriesDataType): CallbackDataParams; /** * Format label * @param dataIndex * @param status 'normal' by default * @param dataType * @param labelDimIndex Only used in some chart that * use formatter in different dimensions, like radar. * @param formatter Formatter given outside. * @return return null/undefined if no formatter */ getFormattedLabel(dataIndex: number, status?: DisplayState, dataType?: SeriesDataType, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: { interpolatedValue: InterpolatableValue; }): string; /** * Get raw value in option */ getRawValue(idx: number, dataType?: SeriesDataType): unknown; /** * Should be implemented. * @param {number} dataIndex * @param {boolean} [multipleSeries=false] * @param {string} [dataType] */ formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: string): TooltipFormatResult; } declare type TooltipFormatResult = string | TooltipMarkupBlockFragment; /** * [Notice]: * Consider custom bundle on demand, chart specified * or component specified types and constants should * not put here. Only common types and constants can * be put in this file. */ declare type RendererType = 'canvas' | 'svg'; declare type LayoutOrient = 'vertical' | 'horizontal'; declare type HorizontalAlign = 'left' | 'center' | 'right'; declare type VerticalAlign = 'top' | 'middle' | 'bottom'; declare type ColorString = string; declare type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject; declare type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[]; declare type ZRFontStyle = 'normal' | 'italic' | 'oblique'; declare type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number; declare type ZREasing = AnimationEasing; declare type ZRTextAlign = TextAlign; declare type ZRTextVerticalAlign = TextVerticalAlign; declare type ZRRectLike = RectLike; declare type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps; declare type ZRElementEventName = ElementEventName | 'globalout'; declare type ComponentFullType = string; declare type ComponentMainType = keyof ECUnitOption & string; declare type ComponentSubType = Exclude; interface DataHost { getData(dataType?: SeriesDataType): SeriesData; } interface DataModel extends Model, DataHost, DataFormatMixin { getDataParams(dataIndex: number, dataType?: SeriesDataType, el?: Element): CallbackDataParams; } interface PayloadItem { excludeSeriesId?: OptionId | OptionId[]; animation?: PayloadAnimationPart; [other: string]: any; } interface Payload extends PayloadItem { type: string; escapeConnect?: boolean; batch?: PayloadItem[]; } interface HighlightPayload extends Payload { type: 'highlight'; notBlur?: boolean; } interface DownplayPayload extends Payload { type: 'downplay'; notBlur?: boolean; } interface PayloadAnimationPart { duration?: number; easing?: AnimationEasing; delay?: number; } interface SelectChangedPayload extends Payload { type: 'selectchanged'; escapeConnect: boolean; isFromClick: boolean; fromAction: 'select' | 'unselect' | 'toggleSelected'; fromActionPayload: Payload; selected: { seriesIndex: number; dataType?: SeriesDataType; dataIndex: number[]; }[]; } interface ViewRootGroup extends Group { __ecComponentInfo?: { mainType: string; index: number; }; } interface ECElementEvent extends ECEventData, CallbackDataParams { type: ZRElementEventName; event?: ElementEvent; } /** * The echarts event type to user. * Also known as packedEvent. */ interface ECActionEvent extends ECEventData { type: string; componentType?: string; componentIndex?: number; seriesIndex?: number; escapeConnect?: boolean; batch?: ECEventData; } interface ECEventData { [key: string]: any; } interface EventQueryItem { [key: string]: any; } interface ActionInfo { type: string; event?: string; update?: string; } interface ActionHandler { (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData; } interface OptionPreprocessor { (option: ECUnitOption, isTheme: boolean): void; } interface PostUpdater { (ecModel: GlobalModel, api: ExtensionAPI): void; } interface StageHandlerReset { (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void; } interface StageHandlerOverallReset { (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void; } interface StageHandler { /** * Indicate that the task will be piped all series * (`performRawSeries` indicate whether includes filtered series). */ createOnAllSeries?: boolean; /** * Indicate that the task will be only piped in the pipeline of this type of series. * (`performRawSeries` indicate whether includes filtered series). */ seriesType?: string; /** * Indicate that the task will be only piped in the pipeline of the returned series. */ getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap; /** * If `true`, filtered series will also be "performed". */ performRawSeries?: boolean; /** * Called only when this task in a pipeline. */ plan?: StageHandlerPlan; /** * If `overallReset` specified, an "overall task" will be created. * "overall task" does not belong to a certain pipeline. * They always be "performed" in certain phase (depends on when they declared). * They has "stub"s to connect with pipelines (one stub for one pipeline), * delivering info like "dirty" and "output end". */ overallReset?: StageHandlerOverallReset; /** * Called only when this task in a pipeline, and "dirty". */ reset?: StageHandlerReset; } interface StageHandlerInternal extends StageHandler { uid: string; visualType?: 'layout' | 'visual'; __prio: number; __raw: StageHandler | StageHandlerOverallReset; isVisual?: boolean; isLayout?: boolean; } declare type StageHandlerProgressParams = TaskProgressParams; interface StageHandlerProgressExecutor { dataEach?: (data: SeriesData, idx: number) => void; progress?: (params: StageHandlerProgressParams, data: SeriesData) => void; } declare type StageHandlerPlanReturn = TaskPlanCallbackReturn; interface StageHandlerPlan { (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerPlanReturn; } interface LoadingEffectCreator { (api: ExtensionAPI, cfg: object): LoadingEffect; } interface LoadingEffect extends Element { resize: () => void; } /** * 'html' is used for rendering tooltip in extra DOM form, and the result * string is used as DOM HTML content. * 'richText' is used for rendering tooltip in rich text form, for those where * DOM operation is not supported. */ declare type TooltipRenderMode = 'html' | 'richText'; declare type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc'; declare type OrdinalRawValue = string | number; declare type OrdinalNumber = number; /** * @usage For example, * ```js * { ordinalNumbers: [2, 5, 3, 4] } * ``` * means that ordinal 2 should be displayed on tick 0, * ordinal 5 should be displayed on tick 1, ... */ declare type OrdinalSortInfo = { ordinalNumbers: OrdinalNumber[]; }; /** * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`. * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`) * into `ParsedValue` and stored into `data/SeriesData` storage. * Note: * (1) The term "parse" does not mean `src/scale/Scale['parse']`. * (2) If a category dimension is not mapped to any axis, its raw value will NOT be * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage. */ declare type ParsedValue = ParsedValueNumeric | OrdinalRawValue; declare type ParsedValueNumeric = number | OrdinalNumber; /** * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`. * (For example, used in `axis.min`, `axis.max`, `convertToPixel`). * Note: * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`. */ declare type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date; interface ScaleTick { level?: number; value: number; } declare type DimensionIndex = number; declare type DimensionIndexLoose = DimensionIndex | string; declare type DimensionName = string; declare type DimensionLoose = DimensionName | DimensionIndexLoose; declare type DimensionType = DataStoreDimensionType; interface DataVisualDimensions { tooltip?: DimensionIndex | false; label?: DimensionIndex; itemName?: DimensionIndex; itemId?: DimensionIndex; itemGroupId?: DimensionIndex; itemChildGroupId?: DimensionIndex; seriesName?: DimensionIndex; } declare type DimensionDefinition = { type?: DataStoreDimensionType; name?: DimensionName; displayName?: string; }; declare type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition; declare const SOURCE_FORMAT_ORIGINAL: "original"; declare const SOURCE_FORMAT_ARRAY_ROWS: "arrayRows"; declare const SOURCE_FORMAT_OBJECT_ROWS: "objectRows"; declare const SOURCE_FORMAT_KEYED_COLUMNS: "keyedColumns"; declare const SOURCE_FORMAT_TYPED_ARRAY: "typedArray"; declare const SOURCE_FORMAT_UNKNOWN: "unknown"; declare 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; declare const SERIES_LAYOUT_BY_COLUMN: "column"; declare const SERIES_LAYOUT_BY_ROW: "row"; declare type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW; declare type OptionSourceHeader = boolean | 'auto' | number; declare type SeriesDataType = 'main' | 'node' | 'edge'; /** * [ECUnitOption]: * An object that contains definitions of components * and other properties. For example: * * ```ts * let option: ECUnitOption = { * * // Single `title` component: * title: {...}, * * // Two `visualMap` components: * visualMap: [{...}, {...}], * * // Two `series.bar` components * // and one `series.pie` component: * series: [ * {type: 'bar', data: [...]}, * {type: 'bar', data: [...]}, * {type: 'pie', data: [...]} * ], * * // A property: * backgroundColor: '#421ae4' * * // A property object: * textStyle: { * color: 'red', * fontSize: 20 * } * }; * ``` */ declare type ECUnitOption = { baseOption?: unknown; options?: unknown; media?: unknown; timeline?: ComponentOption | ComponentOption[]; backgroundColor?: ZRColor; darkMode?: boolean | 'auto'; textStyle?: Pick; useUTC?: boolean; [key: string]: ComponentOption | ComponentOption[] | Dictionary | unknown; stateAnimation?: AnimationOption; } & AnimationOptionMixin & ColorPaletteOptionMixin; /** * [ECOption]: * An object input to echarts.setOption(option). * May be an 'option: ECUnitOption', * or may be an object contains multi-options. For example: * * ```ts * let option: ECOption = { * baseOption: { * title: {...}, * legend: {...}, * series: [ * {data: [...]}, * {data: [...]}, * ... * ] * }, * timeline: {...}, * options: [ * {title: {...}, series: {data: [...]}}, * {title: {...}, series: {data: [...]}}, * ... * ], * media: [ * { * query: {maxWidth: 320}, * option: {series: {x: 20}, visualMap: {show: false}} * }, * { * query: {minWidth: 320, maxWidth: 720}, * option: {series: {x: 500}, visualMap: {show: true}} * }, * { * option: {series: {x: 1200}, visualMap: {show: true}} * } * ] * }; * ``` */ interface ECBasicOption extends ECUnitOption { baseOption?: ECUnitOption; timeline?: ComponentOption | ComponentOption[]; options?: ECUnitOption[]; media?: MediaUnit[]; } declare type OptionSourceData = OptionDataItemOriginal> = OptionSourceDataOriginal | OptionSourceDataObjectRows | OptionSourceDataArrayRows | OptionSourceDataKeyedColumns | OptionSourceDataTypedArray; declare type OptionDataItemOriginal = VAL | VAL[] | OptionDataItemObject; declare type OptionSourceDataOriginal = OptionDataItemOriginal> = ArrayLike; declare type OptionSourceDataObjectRows = Array>; declare type OptionSourceDataArrayRows = Array>; declare type OptionSourceDataKeyedColumns = Dictionary>; declare type OptionSourceDataTypedArray = ArrayLike; declare type OptionDataItem = OptionDataValue | Dictionary | OptionDataValue[] | OptionDataItemObject; declare type OptionDataItemObject = { id?: OptionId; name?: OptionName; groupId?: OptionId; childGroupId?: OptionId; value?: T[] | T; selected?: boolean; }; declare type OptionId = string | number; declare type OptionName = string | number; interface GraphEdgeItemObject extends OptionDataItemObject { /** * Name or index of source node. */ source?: string | number; /** * Name or index of target node. */ target?: string | number; } declare type OptionDataValue = string | number | Date | null | undefined; declare type OptionDataValueNumeric = number | '-'; declare type OptionDataValueDate = Date | string | number; declare type ModelOption = any; declare type ThemeOption = Dictionary; declare type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select'; interface OptionEncodeVisualDimensions { tooltip?: OptionEncodeValue; label?: OptionEncodeValue; itemName?: OptionEncodeValue; itemId?: OptionEncodeValue; seriesName?: OptionEncodeValue; itemGroupId?: OptionEncodeValue; childGroupdId?: OptionEncodeValue; } interface OptionEncode extends OptionEncodeVisualDimensions { [coordDim: string]: OptionEncodeValue | undefined; } declare type OptionEncodeValue = DimensionLoose | DimensionLoose[]; declare type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode; interface CallbackDataParams { componentType: string; componentSubType: string; componentIndex: number; seriesType?: string; seriesIndex?: number; seriesId?: string; seriesName?: string; name: string; dataIndex: number; data: OptionDataItem; dataType?: SeriesDataType; value: OptionDataItem | OptionDataValue; color?: ZRColor; borderColor?: string; dimensionNames?: DimensionName[]; encode?: DimensionUserOuputEncode; marker?: TooltipMarker; status?: DisplayState; dimensionIndex?: number; percent?: number; $vars: string[]; } declare type InterpolatableValue = ParsedValue | ParsedValue[]; declare type DecalDashArrayX = number | (number | number[])[]; declare type DecalDashArrayY = number | number[]; interface DecalObject { symbol?: string | string[]; symbolSize?: number; symbolKeepAspect?: boolean; color?: string; backgroundColor?: string; dashArrayX?: DecalDashArrayX; dashArrayY?: DecalDashArrayY; rotation?: number; maxTileWidth?: number; maxTileHeight?: number; } interface MediaQuery { minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; minAspectRatio?: number; maxAspectRatio?: number; } declare type MediaUnit = { query?: MediaQuery; option: ECUnitOption; }; declare type ComponentLayoutMode = { type?: 'box'; ignoreSize?: boolean | boolean[]; }; declare type PaletteOptionMixin = ColorPaletteOptionMixin; interface ColorPaletteOptionMixin { color?: ZRColor | ZRColor[]; colorLayer?: ZRColor[][]; } /** * Mixin of option set to control the box layout of each component. */ interface BoxLayoutOptionMixin { width?: number | string; height?: number | string; top?: number | string; right?: number | string; bottom?: number | string; left?: number | string; } interface CircleLayoutOptionMixin { center?: (number | string)[]; radius?: (number | string)[] | number | string; } interface ShadowOptionMixin { shadowBlur?: number; shadowColor?: ColorString; shadowOffsetX?: number; shadowOffsetY?: number; } interface BorderOptionMixin { borderColor?: ZRColor; borderWidth?: number; borderType?: ZRLineType; borderCap?: CanvasLineCap; borderJoin?: CanvasLineJoin; borderDashOffset?: number; borderMiterLimit?: number; } declare type ColorBy = 'series' | 'data'; interface SunburstColorByMixin { colorBy?: ColorBy; } declare type AnimationDelayCallbackParam = { count: number; index: number; }; declare type AnimationDurationCallback = (idx: number) => number; declare type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number; interface AnimationOption { duration?: number; easing?: AnimationEasing; delay?: number; } /** * Mixin of option set to control the animation of series. */ interface AnimationOptionMixin { /** * If enable animation */ animation?: boolean; /** * Disable animation when the number of elements exceeds the threshold */ animationThreshold?: number; /** * Duration of initialize animation. * Can be a callback to specify duration of each element */ animationDuration?: number | AnimationDurationCallback; /** * Easing of initialize animation */ animationEasing?: AnimationEasing; /** * Delay of initialize animation * Can be a callback to specify duration of each element */ animationDelay?: number | AnimationDelayCallback; /** * Delay of data update animation. * Can be a callback to specify duration of each element */ animationDurationUpdate?: number | AnimationDurationCallback; /** * Easing of data update animation. */ animationEasingUpdate?: AnimationEasing; /** * Delay of data update animation. * Can be a callback to specify duration of each element */ animationDelayUpdate?: number | AnimationDelayCallback; } interface RoamOptionMixin { /** * If enable roam. can be specified 'scale' or 'move' */ roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale'; /** * Current center position. */ center?: (number | string)[]; /** * Current zoom level. Default is 1 */ zoom?: number; scaleLimit?: { min?: number; max?: number; }; } declare type SymbolSizeCallback = (rawValue: any, params: T) => number | number[]; declare type SymbolCallback = (rawValue: any, params: T) => string; declare type SymbolRotateCallback = (rawValue: any, params: T) => number; declare type SymbolOffsetCallback = (rawValue: any, params: T) => string | number | (string | number)[]; /** * Mixin of option set to control the element symbol. * Include type of symbol, and size of symbol. */ interface SymbolOptionMixin { /** * type of symbol, like `cirlce`, `rect`, or custom path and image. */ symbol?: string | (T extends never ? never : SymbolCallback); /** * Size of symbol. */ symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback); symbolRotate?: number | (T extends never ? never : SymbolRotateCallback); symbolKeepAspect?: boolean; symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback); } /** * ItemStyleOption is a most common used set to config element styles. * It includes both fill and stroke style. */ interface ItemStyleOption extends ShadowOptionMixin, BorderOptionMixin { color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor)); opacity?: number; decal?: DecalObject | 'none'; borderRadius?: (number | string)[] | number | string; } /** * ItemStyleOption is a option set to control styles on lines. * Used in the components or series like `line`, `axis` * It includes stroke style. */ interface LineStyleOption extends ShadowOptionMixin { width?: number; color?: Clr; opacity?: number; type?: ZRLineType; cap?: CanvasLineCap; join?: CanvasLineJoin; dashOffset?: number; miterLimit?: number; } /** * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle. * It only include fill style. */ interface AreaStyleOption extends ShadowOptionMixin { color?: Clr; opacity?: number; } interface VisualOptionUnit { symbol?: string; symbolSize?: number; color?: ColorString; colorAlpha?: number; opacity?: number; colorLightness?: number; colorSaturation?: number; colorHue?: number; decal?: DecalObject; liftZ?: number; } declare type VisualOptionFixed = VisualOptionUnit; /** * Option about visual properties used in piecewise mapping * Used in each piece. */ declare type VisualOptionPiecewise = VisualOptionUnit; /** * All visual properties can be encoded. */ declare type BuiltinVisualProperty = keyof VisualOptionUnit; interface TextCommonOption extends ShadowOptionMixin { color?: string; fontStyle?: ZRFontStyle; fontWeight?: ZRFontWeight; fontFamily?: string; fontSize?: number | string; align?: HorizontalAlign; verticalAlign?: VerticalAlign; baseline?: VerticalAlign; opacity?: number; lineHeight?: number; backgroundColor?: ColorString | { image: ImageLike | string; }; borderColor?: string; borderWidth?: number; borderType?: ZRLineType; borderDashOffset?: number; borderRadius?: number | number[]; padding?: number | number[]; width?: number | string; height?: number; textBorderColor?: string; textBorderWidth?: number; textBorderType?: ZRLineType; textBorderDashOffset?: number; textShadowBlur?: number; textShadowColor?: string; textShadowOffsetX?: number; textShadowOffsetY?: number; tag?: string; } interface LabelFormatterCallback { (params: T): string; } /** * LabelOption is an option set to control the style of labels. * Include color, background, shadow, truncate, rotation, distance, etc.. */ interface LabelOption extends TextCommonOption { /** * If show label */ show?: boolean; position?: ElementTextConfig['position']; distance?: number; rotate?: number; offset?: number[]; /** * Min margin between labels. Used when label has layout. */ minMargin?: number; overflow?: TextStyleProps['overflow']; ellipsis?: TextStyleProps['ellipsis']; silent?: boolean; precision?: number | 'auto'; valueAnimation?: boolean; rich?: Dictionary; } interface SeriesLabelOption extends LabelOption { formatter?: string | LabelFormatterCallback; } /** * Option for labels on line, like markLine, lines */ interface LineLabelOption extends Omit { position?: 'start' | 'middle' | 'end' | 'insideStart' | 'insideStartTop' | 'insideStartBottom' | 'insideMiddle' | 'insideMiddleTop' | 'insideMiddleBottom' | 'insideEnd' | 'insideEndTop' | 'insideEndBottom' | 'insideMiddleBottom'; /** * Distance can be an array. * Which will specify horizontal and vertical distance respectively */ distance?: number | number[]; } interface LabelLineOption { show?: boolean; /** * If displayed above other elements */ showAbove?: boolean; length?: number; length2?: number; smooth?: boolean | number; minTurnAngle?: number; lineStyle?: LineStyleOption; } interface SeriesLineLabelOption extends LineLabelOption { formatter?: string | LabelFormatterCallback; } interface LabelLayoutOptionCallbackParams { /** * Index of data which the label represents. * It can be null if label doesn't represent any data. */ dataIndex?: number; /** * Type of data which the label represents. * It can be null if label doesn't represent any data. */ dataType?: SeriesDataType; seriesIndex: number; text: string; align: ZRTextAlign; verticalAlign: ZRTextVerticalAlign; rect: RectLike; labelRect: RectLike; labelLinePoints?: number[][]; } interface LabelLayoutOption { /** * If move the overlapped label. If label is still overlapped after moved. * It will determine if to hide this label with `hideOverlap` policy. * * shiftX/Y will keep the order on x/y * shuffleX/y will move the label around the original position randomly. */ moveOverlap?: 'shiftX' | 'shiftY' | 'shuffleX' | 'shuffleY'; /** * If hide the overlapped label. It will be handled after move. * @default 'none' */ hideOverlap?: boolean; /** * If label is draggable. */ draggable?: boolean; /** * Can be absolute px number or percent string. */ x?: number | string; y?: number | string; /** * offset on x based on the original position. */ dx?: number; /** * offset on y based on the original position. */ dy?: number; rotate?: number; align?: ZRTextAlign; verticalAlign?: ZRTextVerticalAlign; width?: number; height?: number; fontSize?: number; labelLinePoints?: number[][]; } declare type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption; interface TooltipFormatterCallback { /** * For sync callback * params will be an array on axis trigger. */ (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[]; /** * For async callback. * Returned html string will be a placeholder when callback is not invoked. */ (params: T, asyncTicket: string, callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void): string | HTMLElement | HTMLElement[]; } declare type TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom'; declare type TooltipBoxLayoutOption = Pick; declare type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[]; /** * Position relative to the hoverred element. Only available when trigger is item. */ interface TooltipPositionCallback { (point: [number, number], /** * params will be an array on axis trigger. */ params: TooltipPositionCallbackParams, /** * Will be HTMLDivElement when renderMode is html * Otherwise it's graphic.Text */ el: HTMLDivElement | ZRText | null, /** * Rect of hover elements. Will be null if not hovered */ rect: RectLike | null, size: { /** * Size of popup content */ contentSize: [number, number]; /** * Size of the chart view */ viewSize: [number, number]; }): Array | TooltipBuiltinPosition | TooltipBoxLayoutOption; } /** * Common tooltip option * Can be configured on series, graphic elements */ interface CommonTooltipOption { show?: boolean; /** * When to trigger */ triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click'; /** * Whether to not hide popup content automatically */ alwaysShowContent?: boolean; formatter?: string | TooltipFormatterCallback; /** * Formatter of value. * * Will be ignored if tooltip.formatter is specified. */ valueFormatter?: (value: OptionDataValue | OptionDataValue[], dataIndex: number) => string; /** * Absolution pixel [x, y] array. Or relative percent string [x, y] array. * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom', * which is relative to the hovered element. * * Support to be a callback */ position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption; confine?: boolean; /** * Consider triggered from axisPointer handle, verticalAlign should be 'middle' */ align?: HorizontalAlign; verticalAlign?: VerticalAlign; /** * Delay of show. milesecond. */ showDelay?: number; /** * Delay of hide. milesecond. */ hideDelay?: number; transitionDuration?: number; /** * Whether mouse is allowed to enter the floating layer of tooltip * If you need to interact in the tooltip like with links or buttons, it can be set as true. */ enterable?: boolean; backgroundColor?: ColorString; borderColor?: ColorString; borderRadius?: number; borderWidth?: number; shadowBlur?: number; shadowColor?: string; shadowOffsetX?: number; shadowOffsetY?: number; /** * Padding between tooltip content and tooltip border. */ padding?: number | number[]; /** * Available when renderMode is 'html' */ extraCssText?: string; textStyle?: Pick & { decoration?: string; }; } declare type ComponentItemTooltipOption = CommonTooltipOption & { content?: string; /** * Whether to encode HTML content according to `tooltip.renderMode`. * * e.g. renderMode 'html' needs to encode but 'richText' does not. */ encodeHTMLContent?: boolean; formatterParams?: ComponentItemTooltipLabelFormatterParams; }; declare type ComponentItemTooltipLabelFormatterParams = { componentType: string; name: string; $vars: string[]; } & { [key in string]: unknown; }; /** * Tooltip option configured on each series */ declare type SeriesTooltipOption = CommonTooltipOption & { trigger?: 'item' | 'axis' | boolean | 'none'; }; declare type LabelFormatterParams = { value: ScaleDataValue; axisDimension: string; axisIndex: number; seriesData: CallbackDataParams[]; }; /** * Common axis option. can be configured on each axis */ interface CommonAxisPointerOption { show?: boolean | 'auto'; z?: number; zlevel?: number; triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click'; type?: 'line' | 'shadow' | 'none'; snap?: boolean; triggerTooltip?: boolean; triggerEmphasis?: boolean; /** * current value. When using axisPointer.handle, value can be set to define the initial position of axisPointer. */ value?: ScaleDataValue; status?: 'show' | 'hide'; label?: LabelOption & { precision?: 'auto' | number; margin?: number; /** * String template include variable {value} or callback function */ formatter?: string | ((params: LabelFormatterParams) => string); }; animation?: boolean | 'auto'; animationDurationUpdate?: number; animationEasingUpdate?: ZREasing; /** * Available when type is 'line' */ lineStyle?: LineStyleOption; /** * Available when type is 'shadow' */ shadowStyle?: AreaStyleOption; handle?: { show?: boolean; icon?: string; /** * The size of the handle */ size?: number | number[]; /** * Distance from handle center to axis. */ margin?: number; color?: ColorString; /** * Throttle for mobile performance */ throttle?: number; } & ShadowOptionMixin; seriesDataIndices?: { seriesIndex: number; dataIndex: number; dataIndexInside: number; }[]; } interface ComponentOption { mainType?: string; type?: string; id?: OptionId; name?: OptionName; z?: number; zlevel?: number; } declare type BlurScope = 'coordinateSystem' | 'series' | 'global'; /** * can be array of data indices. * Or may be an dictionary if have different types of data like in graph. */ declare type InnerFocus = DefaultEmphasisFocus | ArrayLike | Dictionary>; interface DefaultStatesMixin { emphasis?: any; select?: any; blur?: any; } declare type DefaultEmphasisFocus = 'none' | 'self' | 'series'; interface DefaultStatesMixinEmphasis { /** * self: Focus self and blur all others. * series: Focus series and blur all other series. */ focus?: DefaultEmphasisFocus; } interface StatesMixinBase { emphasis?: unknown; select?: unknown; blur?: unknown; } interface StatesOptionMixin { /** * Emphasis states */ emphasis?: StateOption & StatesMixin['emphasis'] & { /** * Scope of blurred element when focus. * * coordinateSystem: blur others in the same coordinateSystem * series: blur others in the same series * global: blur all others * * Default to be coordinate system. */ blurScope?: BlurScope; /** * If emphasis state is disabled. */ disabled?: boolean; }; /** * Select states */ select?: StateOption & StatesMixin['select'] & { disabled?: boolean; }; /** * Blur states. */ blur?: StateOption & StatesMixin['blur']; } interface UniversalTransitionOption { enabled?: boolean; /** * Animation delay of each divided element */ delay?: (index: number, count: number) => number; /** * How to divide the shape in combine and split animation. */ divideShape?: 'clone' | 'split'; /** * Series will have transition between if they have same seriesKey. * Usually it is a string. It can also be an array, * which means it can be transition from or to multiple series with each key in this array item. * * Note: * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent) * Transition between string key has higher priority. * * Default to use series id. */ seriesKey?: string | string[]; } interface SeriesOption extends ComponentOption, AnimationOptionMixin, ColorPaletteOptionMixin, StatesOptionMixin { mainType?: 'series'; silent?: boolean; blendMode?: string; /** * Cursor when mouse on the elements */ cursor?: string; /** * groupId of data. can be used for doing drilldown / up animation * It will be ignored if: * - groupId is specified in each data * - encode.itemGroupId is given. */ dataGroupId?: OptionId; data?: unknown; colorBy?: ColorBy; legendHoverLink?: boolean; /** * Configurations about progressive rendering */ progressive?: number | false; progressiveThreshold?: number; progressiveChunkMode?: 'mod'; /** * Not available on every series */ coordinateSystem?: string; hoverLayerThreshold?: number; /** * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series * namely, the series is "layout" on columns or rows * @default 'column' */ seriesLayoutBy?: 'column' | 'row'; labelLine?: LabelLineOption; /** * Overall label layout option in label layout stage. */ labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback; /** * Animation config for state transition. */ stateAnimation?: AnimationOption; /** * If enabled universal transition cross series. * @example * universalTransition: true * universalTransition: { enabled: true } */ universalTransition?: boolean | UniversalTransitionOption; /** * Map of selected data * key is name or index of data. */ selectedMap?: Dictionary | 'all'; selectedMode?: 'single' | 'multiple' | 'series' | boolean; } interface SeriesOnCartesianOptionMixin { xAxisIndex?: number; yAxisIndex?: number; xAxisId?: string; yAxisId?: string; } interface SeriesOnPolarOptionMixin { polarIndex?: number; polarId?: string; } interface SeriesOnSingleOptionMixin { singleAxisIndex?: number; singleAxisId?: string; } interface SeriesOnGeoOptionMixin { geoIndex?: number; geoId?: string; } interface SeriesOnCalendarOptionMixin { calendarIndex?: number; calendarId?: string; } interface SeriesLargeOptionMixin { large?: boolean; largeThreshold?: number; } interface SeriesStackOptionMixin { stack?: string; stackStrategy?: 'samesign' | 'all' | 'positive' | 'negative'; } declare type SamplingFunc = (frame: ArrayLike) => number; interface SeriesSamplingOptionMixin { sampling?: 'none' | 'average' | 'min' | 'max' | 'minmax' | 'sum' | 'lttb' | SamplingFunc; } interface SeriesEncodeOptionMixin { datasetIndex?: number; datasetId?: string | number; seriesLayoutBy?: SeriesLayoutBy; sourceHeader?: OptionSourceHeader; dimensions?: DimensionDefinitionLoose[]; encode?: OptionEncode; } interface AriaLabelOption { enabled?: boolean; description?: string; general?: { withTitle?: string; withoutTitle?: string; }; series?: { maxCount?: number; single?: { prefix?: string; withName?: string; withoutName?: string; }; multiple?: { prefix?: string; withName?: string; withoutName?: string; separator?: { middle?: string; end?: string; }; }; }; data?: { maxCount?: number; allData?: string; partialData?: string; withName?: string; withoutName?: string; separator?: { middle?: string; end?: string; }; }; } interface AriaOption extends AriaLabelOption { mainType?: 'aria'; enabled?: boolean; label?: AriaLabelOption; decal?: { show?: boolean; decals?: DecalObject | DecalObject[]; }; } declare type PipedDataTransformOption = DataTransformOption[]; declare type DataTransformType = string; declare type DataTransformConfig = unknown; interface DataTransformOption { type: DataTransformType; config?: DataTransformConfig; print?: boolean; } interface ExternalDataTransform { type: string; __isBuiltIn?: boolean; transform: (param: ExternalDataTransformParam) => ExternalDataTransformResultItem | ExternalDataTransformResultItem[]; } interface ExternalDataTransformParam { upstream: ExternalSource; upstreamList: ExternalSource[]; config: TO['config']; } interface ExternalDataTransformResultItem { /** * If `data` is null/undefined, inherit upstream data. */ data: OptionSourceDataArrayRows | OptionSourceDataObjectRows; /** * A `transform` can optionally return a dimensions definition. * The rule: * If this `transform result` have different dimensions from the upstream, it should return * a new dimension definition. For example, this transform inherit the upstream data totally * but add a extra dimension. * Otherwise, do not need to return that dimension definition. echarts will inherit dimension * definition from the upstream. */ dimensions?: DimensionDefinitionLoose[]; } declare type DataTransformDataItem = ExternalDataTransformResultItem['data'][number]; interface ExternalDimensionDefinition extends Partial { index: DimensionIndex; } /** * TODO: disable writable. * This structure will be exposed to users. */ declare class ExternalSource { /** * [Caveat] * This instance is to be exposed to users. * (1) DO NOT mount private members on this instance directly. * If we have to use private members, we can make them in closure or use `makeInner`. * (2) "source header count" is not provided to transform, because it's complicated to manage * header and dimensions definition in each transform. Source headers are all normalized to * dimensions definitions in transforms and their downstreams. */ sourceFormat: SourceFormat; getRawData(): Source['data']; getRawDataItem(dataIndex: number): DataTransformDataItem; cloneRawData(): Source['data']; /** * @return If dimension not found, return null/undefined. */ getDimensionInfo(dim: DimensionLoose): ExternalDimensionDefinition; /** * dimensions defined if and only if either: * (a) dataset.dimensions are declared. * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`). * If dimensions are defined, `dimensionInfoAll` is corresponding to * the defined dimensions. * Otherwise, `dimensionInfoAll` is determined by data columns. * @return Always return an array (even empty array). */ cloneAllDimensionInfo(): ExternalDimensionDefinition[]; count(): number; /** * Only support by dimension index. * No need to support by dimension name in transform function, * because transform function is not case-specific, no need to use name literally. */ retrieveValue(dataIndex: number, dimIndex: DimensionIndex): OptionDataValue; retrieveValueFromItem(dataItem: DataTransformDataItem, dimIndex: DimensionIndex): OptionDataValue; convertValue(rawVal: unknown, dimInfo: ExternalDimensionDefinition): ParsedValue; } declare function registerExternalTransform(externalTransform: ExternalDataTransform): void; declare function registerImpl(name: string, impl: any): void; declare const extensionRegisters: { registerPreprocessor: typeof registerPreprocessor; registerProcessor: typeof registerProcessor; registerPostInit: typeof registerPostInit; registerPostUpdate: typeof registerPostUpdate; registerUpdateLifecycle: typeof registerUpdateLifecycle; registerAction: typeof registerAction; registerCoordinateSystem: typeof registerCoordinateSystem; registerLayout: typeof registerLayout; registerVisual: typeof registerVisual; registerTransform: typeof registerExternalTransform; registerLoading: typeof registerLoading; registerMap: typeof registerMap; registerImpl: typeof registerImpl; PRIORITY: { PROCESSOR: { FILTER: number; SERIES_FILTER: number; STATISTIC: number; }; VISUAL: { LAYOUT: number; PROGRESSIVE_LAYOUT: number; GLOBAL: number; CHART: number; POST_CHART_LAYOUT: number; COMPONENT: number; BRUSH: number; CHART_ITEM: number; ARIA: number; DECAL: number; }; }; ComponentModel: typeof ComponentModel; ComponentView: typeof ComponentView; SeriesModel: typeof SeriesModel; ChartView: typeof ChartView; registerComponentModel(ComponentModelClass: Constructor): void; registerComponentView(ComponentViewClass: typeof ComponentView): void; registerSeriesModel(SeriesModelClass: Constructor): void; registerChartView(ChartViewClass: typeof ChartView): void; registerSubTypeDefaulter(componentType: string, defaulter: SubTypeDefaulter): void; registerPainter(painterType: string, PainterCtor: Parameters[1]): void; }; declare type EChartsExtensionInstallRegisters = typeof extensionRegisters; declare type EChartsExtensionInstaller = (ec: EChartsExtensionInstallRegisters) => void; interface EChartsExtension { install: EChartsExtensionInstaller; } declare function use(ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]): void; export { type AnimationDelayCallback, type AnimationDelayCallbackParam, type AnimationDurationCallback, type AnimationOption, type AnimationOptionMixin, Arc, type AreaStyleOption, type AriaOption, Axis, type AxisBaseModel, type AxisBaseOption, BezierCurve, type BlurScope, type BorderOptionMixin, BoundingRect, type BoxLayoutOptionMixin, type BrushOption, type CallbackDataParams, type CategoryAxisBaseOption, ChartView, Circle, type CircleLayoutOptionMixin, type ColorString, type CommonAxisPointerOption, type CommonTooltipOption, type ComponentItemTooltipOption, type ComponentMainType, ComponentModel, type ComponentOption, ComponentView, CompoundPath, type CustomSeriesOption, type CustomSeriesRenderItem, type CustomSeriesRenderItemAPI, type CustomSeriesRenderItemParams, type CustomSeriesRenderItemReturn, type DataCalculationInfo, type DataModel, DataStore, type DataVisualDimensions, type DatasetOption, type DecalObject, type DefaultDataVisual, type DefaultEmphasisFocus, type DefaultStatesMixin, type DefaultStatesMixinEmphasis, type Dictionary, type DimensionDefinition, type DimensionDefinitionLoose, type DimensionIndex, type DimensionName, type DisplayState, Displayable, type DisplayableProps, type DownplayPayload, type ECBasicOption, type ECElementEvent, type ECEventData, type ECUnitOption, type EChartsExtensionInstallRegisters, type EChartsInitOpts, type EChartsType, Element, type ElementEvent, type ElementEventNameWithOn, type ElementKeyframeAnimationOption, type ElementProps, type ElementTextConfig, Ellipse, type EncodeDefaulter, type GeoJSON, type GeoJSONCompressed, GeoJSONRegion, type GeoProjection, type GlobalModelSetOptionOpts, type GradientObject, type GraphEdgeItemObject, Group, type GroupProps, HashMap, type HighlightPayload, type HorizontalAlign, type ImagePatternObject, type ImageProps, type ImageStyleProps, type InnerFocus, type ItemStyleOption, type LabelFormatterCallback, type LabelLayoutOptionCallback, type LabelLayoutOptionCallbackParams, type LabelLineOption, type LabelOption, type LayoutOrient, type LegendOption, Line, type LineLabelOption, type LineStyleOption, LinearGradient, type LinearGradientObject, type LocaleOption, type MatrixArray, Model, type ModelFinderIdQuery, type ModelFinderIndexQuery, type NameMap, type OptionDataItemObject, type OptionDataValue, type OptionDataValueDate, type OptionDataValueNumeric, type OptionEncode, type OptionEncodeValue, type OptionId, type OptionName, type OptionSourceData, OrdinalMeta, type OrdinalSortInfo, PRIORITY, Path, type PathProps, type PathStyleProps, type PatternObject, type Payload, Polygon, Polyline, RadialGradient, type RadialGradientObject, Rect, type ResizeOpts, Ring, type RoamOptionMixin, type SVGPatternObject, Scale, type ScaleDataValue, Sector, type SelectChangedPayload, SeriesData, SeriesDataSchema, type SeriesDataType, SeriesDimensionDefine, type SeriesEncodeOptionMixin, type SeriesLabelOption, type SeriesLargeOptionMixin, type SeriesLineLabelOption, SeriesModel, type SeriesOnCalendarOptionMixin, type SeriesOnCartesianOptionMixin, type SeriesOnGeoOptionMixin, type SeriesOnPolarOptionMixin, type SeriesOnSingleOptionMixin, type SeriesOption, type SeriesSamplingOptionMixin, type SeriesStackOptionMixin, type SeriesTooltipOption, type SetOptionOpts, type SetOptionTransitionOpt, type SetOptionTransitionOptItem, type ShadowOptionMixin, type Source, type StatesMixinBase, type StatesOptionMixin, type SunburstColorByMixin, type SymbolOptionMixin, type TextCommonOption, type TextProps, type TextStyleProps, type TooltipFormatterCallback, type TooltipOrderMode, type TooltipPositionCallback, type TooltipPositionCallbackParams, type TooltipRenderMode, type TransformProp, Transformable, type TransitionOptionMixin, type ValueAxisBaseOption, type VectorArray, type VerticalAlign, type VisualMapOption, type VisualOptionPiecewise, type ZRColor, type ZREasing, ZRImage, type ZRRectLike, type ZRStyleProps, ZRText, type ZRTextAlign, type ZRTextVerticalAlign, addCommas, bind, capitalFirst, clone, connect, createSymbol, curry, dataTool, defaults, dependencies, disConnect, disconnect, dispose, each, extend, filter, formatTime, formatTpl, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, getTooltipMarker, indexOf, inherits, init, install, isArray, isFunction, isObject, isString, map, matrix_d, merge, normalizeCssArray, reduce, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, toCamelCase, use, util_d, vector_d, version, zrender_d };